Chart.js: Adding custom points to Line Chart

Created on 1 Sep 2016  路  4Comments  路  Source: chartjs/Chart.js

Hello.
Is it possible to add custom point to Line Chart?
Custom point

Most helpful comment

Yes, you have to find the point you want to change and do

point.custom = point.custom || {};
point.custom.borderColor = border color
point.custom.borderWidth = stroke width
point.custom.radius = point radius

alternatively, you can set the the dataset pointRadius and other properties to an array of values.

All 4 comments

Yes, you have to find the point you want to change and do

point.custom = point.custom || {};
point.custom.borderColor = border color
point.custom.borderWidth = stroke width
point.custom.radius = point radius

alternatively, you can set the the dataset pointRadius and other properties to an array of values.

How to get points of chart? Could you give me an example, please?

point = chartInstance.getDatasetMeta(datasetIndex).data[index];

Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings