Improve the graph display; hide the bottom bar when no data exists.
This commit is contained in:
parent
bf287c45d6
commit
5f156e193a
1 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@ const options: ChartOptions<'line'> = {
|
||||||
radius: 0,
|
radius: 0,
|
||||||
},
|
},
|
||||||
line: {
|
line: {
|
||||||
tension: 0.3,
|
tension: 0.15,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -90,7 +90,7 @@ function getEmptyData(label: string, sets = 1, callback?: ChartDatasetCallback |
|
||||||
{
|
{
|
||||||
fill: true,
|
fill: true,
|
||||||
label,
|
label,
|
||||||
data: Array(20).fill(0),
|
data: Array(20).fill(-5),
|
||||||
borderColor: theme('colors.cyan.400'),
|
borderColor: theme('colors.cyan.400'),
|
||||||
backgroundColor: hexToRgba(theme('colors.cyan.700'), 0.5),
|
backgroundColor: hexToRgba(theme('colors.cyan.700'), 0.5),
|
||||||
},
|
},
|
||||||
|
@ -129,7 +129,7 @@ function useChart(label: string, opts?: UseChartOptions) {
|
||||||
merge(state, {
|
merge(state, {
|
||||||
datasets: state.datasets.map((value) => ({
|
datasets: state.datasets.map((value) => ({
|
||||||
...value,
|
...value,
|
||||||
data: Array(20).fill(0),
|
data: Array(20).fill(-5),
|
||||||
})),
|
})),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue