@tetacom/svg-charts 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -251,8 +251,13 @@ class ChartService {
251
251
  const hiddenSeries = localStorage.getItem(`${config.name}_${ChartService._hiddenSeriesPostfix}`);
252
252
  if (hiddenSeries) {
253
253
  const json = JSON.parse(hiddenSeries);
254
- config.series = config.series.map((serie) => {
254
+ config.series = config.series.map((serie, index) => {
255
255
  serie.visible = !json.includes(serie.id);
256
+ const currentSerieIndex = config.series.findIndex((_) => _.id === serie.id);
257
+ if (currentSerieIndex !== -1) {
258
+ const seriesLinkCount = config.series.filter((_) => _.yAxisIndex === config.series[currentSerieIndex].yAxisIndex && _.visible === true).length;
259
+ config.yAxis[config.series[currentSerieIndex].yAxisIndex].visible = seriesLinkCount !== 0;
260
+ }
256
261
  return serie;
257
262
  });
258
263
  return config;