Nivo: only show final point on a line chart?

Created on 31 Oct 2020  路  2Comments  路  Source: plouc/nivo

Thanks for this great library!

Right now I can render line charts either with all the points visible or with no points visible. Is there a way to make it so that only the last datum as a point rendered? Or even a way to add a custom point to the plot that is easy to position exactly where the last data point would be?

line

Most helpful comment

I don't think this will be added as an option for out of the box, but like @plouc said you can use a custom layer. I have a codesandbox that shows exactly that right here: https://codesandbox.io/s/fancy-line-chart-3quqe

All 2 comments

You could use a custom layer, layers receive all computed data and can be used to augment or completely replace part of a chart. You can see an example here.

I don't think this will be added as an option for out of the box, but like @plouc said you can use a custom layer. I have a codesandbox that shows exactly that right here: https://codesandbox.io/s/fancy-line-chart-3quqe

Was this page helpful?
0 / 5 - 0 ratings