diff --git a/src/components/BootstrapBlazor.Chart/BootstrapBlazor.Chart.csproj b/src/components/BootstrapBlazor.Chart/BootstrapBlazor.Chart.csproj index 7a16f1a4..3570d624 100644 --- a/src/components/BootstrapBlazor.Chart/BootstrapBlazor.Chart.csproj +++ b/src/components/BootstrapBlazor.Chart/BootstrapBlazor.Chart.csproj @@ -1,7 +1,7 @@ - 10.0.1 + 10.0.2 diff --git a/src/components/BootstrapBlazor.Chart/Components/Chart/Chart.razor.js b/src/components/BootstrapBlazor.Chart/Components/Chart/Chart.razor.js index 6dfa0bb8..9b46c58e 100644 --- a/src/components/BootstrapBlazor.Chart/Components/Chart/Chart.razor.js +++ b/src/components/BootstrapBlazor.Chart/Components/Chart/Chart.razor.js @@ -356,7 +356,6 @@ const getChartOption = function (option) { } } - // pie 图除外默认显示 网格线与坐标系 if (option.type !== 'pie' && option.type !== 'doughnut') { if (option.options.showXScales === null) { scale.x.display = true @@ -491,7 +490,13 @@ export function init(id, invoke, method, option) { } export function update(id, option, method, angle) { - const { invoke, chart } = Data.get(id) + const { invoke, chart } = Data.get(id); + option.data.forEach(d => { + const l = chart.legend.legendItems.find(i => i.text === d.label); + if(l) { + d.hidden = l.hidden; + } + }); let op = getChartOption(option); handlerClickData(invoke, op, option.options.onClickDataMethod); op.angle = angle