diff --git a/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx b/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx index b05286b..537d8a0 100644 --- a/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx +++ b/src/screens/C03LineChartWithLegendScreen/comps/LineChart/Legend/index.tsx @@ -12,12 +12,12 @@ const NOT_VISIBLE_COLOR = 'gainsboro'; type LegendProps = LegendOptions & { series: TimeSeries[]; linesOptions?: LinesOptions; - onClickItem?: (sr: TimeSeries, idx: number) => void; + onPressItem?: (sr: TimeSeries, idx: number) => void; }; function Legend({ series, linesOptions, - onClickItem, + onPressItem, enabled = true, @@ -68,7 +68,7 @@ function Legend({ paddingBottom: itemPaddingBottom ?? itemPadding ?? 2, }, ]} - onPress={() => onClickItem?.(sr, i)} + onPress={() => onPressItem?.(sr, i)} > { + const onPressLegendItem = (sr: TimeSeries, idx: number) => { setState(dr => { dr.series = dr.series.map((sr, i) => i !== idx ? sr : { ...sr, visible: !sr.visible } @@ -114,7 +114,7 @@ function LineChart({