mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 20:26:40 +00:00
Ensured bar charts start at 0
This commit is contained in:
@@ -33,9 +33,18 @@ export function GraphCard({ title, isBarChart, stats }) {
|
||||
});
|
||||
const renderGraph = () => {
|
||||
const Component = isBarChart ? HorizontalBar : Doughnut;
|
||||
const legend = isBarChart ? { display: false } : { position: 'right' };
|
||||
const options = {
|
||||
legend: isBarChart ? { display: false } : { position: 'right' },
|
||||
scales: isBarChart ? {
|
||||
xAxes: [
|
||||
{
|
||||
ticks: { beginAtZero: true },
|
||||
},
|
||||
],
|
||||
} : null,
|
||||
};
|
||||
|
||||
return <Component data={generateGraphData(stats)} options={{ legend }} />;
|
||||
return <Component data={generateGraphData(stats)} options={options} />;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user