Skip to content

Commit

Permalink
Allow to pass a custom style to the conditions graph
Browse files Browse the repository at this point in the history
Bump submodule
  • Loading branch information
bperel committed Oct 23, 2023
1 parent 7b6298c commit 60e9e62
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions apps/web/src/components/stats/ConditionsComponent.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="wrapper">
<div class="wrapper" :style="style || {}">
<pie :data="chartData" :options="options" />
</div>
</template>
Expand All @@ -17,16 +17,11 @@ import {
} from "chart.js";
import { Pie } from "vue-chartjs";
const props = withDefaults(
defineProps<{
linkToCollectionIfNoIssue: boolean;
conditions: { dbValue: string; color: string; text: string }[];
numberPerCondition: Record<string, number>;
}>(),
{
linkToCollectionIfNoIssue: true,
},
);
const props = defineProps<{
conditions: { dbValue: string; color: string; text: string }[];
numberPerCondition: Record<string, number>;
style: Record<string, string>;
}>();
Chart.register(Legend, PieController, Tooltip, Title, ArcElement);
const values = computed(() =>
Expand Down Expand Up @@ -75,10 +70,8 @@ const options = computed(

<style scoped lang="scss">
.wrapper {
> div {
max-width: 100%;
max-height: 100%;
}
max-width: 100%;
max-height: 100%;
:deep(canvas) {
max-width: 100% !important;
Expand Down

0 comments on commit 60e9e62

Please sign in to comment.