Skip to content

Commit

Permalink
fix(Highcharts plugin): navigator series visibility on legend item cl…
Browse files Browse the repository at this point in the history
…ick (#148)

* fix(Highcharts plugin): navigator series visibility on legend element click

* fix after review
  • Loading branch information
kuzmadom authored Apr 12, 2023
1 parent cc49d48 commit ae7d38b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const getSeriesIdentifier = (item: Highcharts.Series | Highcharts.Point): string
if (item instanceof Highcharts.Point) {
return item.name;
}

if (isNavigatorSeries(item) && item.baseSeries) {
return (item.baseSeries.userOptions.id as string | undefined) || item.baseSeries.name;
}

return (item.userOptions.id as string | undefined) || item.name;
};

Expand Down
6 changes: 6 additions & 0 deletions src/plugins/highcharts/types/highcharts-extends.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ declare module 'highcharts' {
}

interface SeriesOptionsRegistry extends Record<string, Record<string, unknown>> {}

// for Stock chart from https://github.com/highcharts/highcharts/blob/master/ts/Stock/Navigator/NavigatorComposition.ts#L65
interface Series {
baseSeries?: Series;
navigatorSeries?: Series;
}
}

0 comments on commit ae7d38b

Please sign in to comment.