Commit 2293ae2e by Dominik Prokop Committed by GitHub

GraphNG: assume uPlot's series stroke is always a function (#30416)

parent b7b6632a
...@@ -48,8 +48,8 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({ mode = 'single', t ...@@ -48,8 +48,8 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({ mode = 'single', t
<SeriesTable <SeriesTable
series={[ series={[
{ {
// stroke is typed as CanvasRenderingContext2D['strokeStyle'] - we are using strings only for now // TODO: align with uPlot typings
color: plotContext.getSeries()[focusedSeriesIdx!].stroke as string, color: (plotContext.getSeries()[focusedSeriesIdx!].stroke as any)(),
label: getFieldDisplayName(field, data), label: getFieldDisplayName(field, data),
value: fieldFmt(field.values.get(focusedPointIdx)).text, value: fieldFmt(field.values.get(focusedPointIdx)).text,
}, },
...@@ -76,8 +76,8 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({ mode = 'single', t ...@@ -76,8 +76,8 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({ mode = 'single', t
return [ return [
...agg, ...agg,
{ {
// stroke is typed as CanvasRenderingContext2D['strokeStyle'] - we are using strings only for now // TODO: align with uPlot typings
color: plotContext.getSeries()[i].stroke as string, color: (plotContext.getSeries()[i].stroke as any)!(),
label: getFieldDisplayName(f, data), label: getFieldDisplayName(f, data),
value: formattedValueToString(f.display!(f.values.get(focusedPointIdx!))), value: formattedValueToString(f.display!(f.values.get(focusedPointIdx!))),
isActive: focusedSeriesIdx === i, isActive: focusedSeriesIdx === i,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment