Used cursor pointer in bar charts

This commit is contained in:
Alejandro Celaya 2020-04-10 13:04:39 +02:00
parent ed584d19e5
commit b863c2e19d

View file

@ -79,6 +79,9 @@ const renderGraph = (title, isBarChart, stats, max, highlightedStats, onClick) =
// Do not show tooltip on items with empty label when in a bar chart // Do not show tooltip on items with empty label when in a bar chart
filter: ({ yLabel }) => !isBarChart || yLabel !== '', filter: ({ yLabel }) => !isBarChart || yLabel !== '',
}, },
onHover: isBarChart && (({ target }, chartElement) => {
target.style.cursor = chartElement[0] ? 'pointer' : 'default';
}),
}; };
const graphData = generateGraphData(title, isBarChart, labels, data, highlightedData); const graphData = generateGraphData(title, isBarChart, labels, data, highlightedData);
const height = isBarChart && labels.length > 20 ? labels.length * 8 : null; const height = isBarChart && labels.length > 20 ? labels.length * 8 : null;