Skip to content
Snippets Groups Projects
Commit 6c67b2e4 authored by syuilo's avatar syuilo
Browse files

fix(frontend): チャートのlegendがクリックに反応しない問題を修正

これにより発生 https://github.com/misskey-dev/misskey/pull/12926
parent 430290c0
No related branches found
No related tags found
No related merge requests found
......@@ -30,9 +30,9 @@ function onClick(item: LegendItem) {
if (chart.value == null) return;
if (type.value === 'pie' || type.value === 'doughnut') {
// Pie and doughnut charts only have a single dataset and visibility is per item
if (item.index) chart.value.toggleDataVisibility(item.index);
if (item.index != null) chart.value.toggleDataVisibility(item.index);
} else {
if (item.datasetIndex) chart.value.setDatasetVisibility(item.datasetIndex, !chart.value.isDatasetVisible(item.datasetIndex));
if (item.datasetIndex != null) chart.value.setDatasetVisibility(item.datasetIndex, !chart.value.isDatasetVisible(item.datasetIndex));
}
chart.value.update();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment