Skip to content

Tag: chart.js

ChartJS show value in legend (Chart.js V3.5)

I need the value of chart show after name of data for example ([colour of data] Car 50, [colour of data] Motorcycle 200). I’ve tried change the value of legend title but it doesn’t work at all Here is it my code: Answer You can use a custom generateLabels function for this:

Putting label array to the chartjs?

I have these codes: let arr = []; This is what console.log(arr); shows: [“Item1”, “Item2”, “Item3”, “Item4”] Below is my graph: How can I loop through the object arr to be put inside the labels? Answer The charts label receives a string or an array of strings: S…

Error with Chartjs radar pointLabels color Scriptable

Refering to documentation (3.4.1) the color of labels in chartjs radar chart is a scriptable and customizable via options.scales.r.pointLabels.color, I have been trying to set a different label color for each tick. The problem is that when passing a function as the property value as explained in the scriptabl…

Line graph with linear timescale in Chart.js

I’m trying to use Chart.js 3.3.2 to display some a line graph with an equally spaced x date axis. Like the example they give here. I cannot get a simple version of this example working (see below snippet) as it outputs the error: Error: This method is not implemented: Check that a complete date adapter …