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
<SeriesTable
series={[
{
// stroke is typed as CanvasRenderingContext2D['strokeStyle'] - we are using strings only for now
color: plotContext.getSeries()[focusedSeriesIdx!].stroke as string,
// TODO: align with uPlot typings
color: (plotContext.getSeries()[focusedSeriesIdx!].stroke as any)(),
label: getFieldDisplayName(field, data),
value: fieldFmt(field.values.get(focusedPointIdx)).text,
},
......@@ -76,8 +76,8 @@ export const TooltipPlugin: React.FC<TooltipPluginProps> = ({ mode = 'single', t
return [
...agg,
{
// stroke is typed as CanvasRenderingContext2D['strokeStyle'] - we are using strings only for now
color: plotContext.getSeries()[i].stroke as string,
// TODO: align with uPlot typings
color: (plotContext.getSeries()[i].stroke as any)!(),
label: getFieldDisplayName(f, data),
value: formattedValueToString(f.display!(f.values.get(focusedPointIdx!))),
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