
- React / Next.js
- HTML (coming soon)
1
Import components from Nivo Charts
2
Import VeltNivoChartComments component from Velt
- Add
VeltCommentsonce to the root of your app. This component is required to render comments in your app.
3
Add a container div for the Nivo Chart component
- Add a
nivo-chart-containerclass to it. This will help us position the Velt Comment Pins accurately.
4
Add VeltNivoChartComments to the Nivo Chart component
- Add a custom function as a layer inside your Nivo Chart component and return
VeltNivoChartCommentscomponent. - Set a unique
idin the VeltNivoChartComments component to scope comments to the specific chart, isolating them from other charts. - Pass the
chartComputedDataprops to it.
5
(Optional) Customize the Chart Metadata displayed in the Comment Dialog
- Pass an array to the
dialogMetadataTemplateprop in the VeltHighChartsComments component. - This array determines the chart metadata displayed in the comment dialog, representing the data point (e.g., x-axis and y-axis values) on which the comment was added.
- Customize the order of the keys or remove unnecessary keys to control how the metadata is presented in the comment dialog.
Default: ['groupId', 'label', 'value']For example:
