Improve the graph display; hide the bottom bar when no data exists.

This commit is contained in:
DaneEveritt 2022-06-27 19:59:36 -04:00
parent bf287c45d6
commit 5f156e193a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -65,7 +65,7 @@ const options: ChartOptions<'line'> = {
radius: 0,
},
line: {
tension: 0.3,
tension: 0.15,
},
},
};
@ -90,7 +90,7 @@ function getEmptyData(label: string, sets = 1, callback?: ChartDatasetCallback |
{
fill: true,
label,
data: Array(20).fill(0),
data: Array(20).fill(-5),
borderColor: theme('colors.cyan.400'),
backgroundColor: hexToRgba(theme('colors.cyan.700'), 0.5),
},
@ -129,7 +129,7 @@ function useChart(label: string, opts?: UseChartOptions) {
merge(state, {
datasets: state.datasets.map((value) => ({
...value,
data: Array(20).fill(0),
data: Array(20).fill(-5),
})),
})
);