Skip to content

Commit

Permalink
fix(frontend): チャートのlegendがクリックに反応しない問題を修正
Browse files Browse the repository at this point in the history
これにより発生 #12926
  • Loading branch information
syuilo committed Feb 2, 2024
1 parent 430290c commit 6c67b2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkChartLegend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 6c67b2e

Please sign in to comment.