Consider a sequence of data along the following lines:
data = [{angle:1.2,value:1.2},...,{angle:355.2: value:5.6}];
I'd like to display this data on a radially scaled plot (i.e. circular bands indicating how high the value of each point is) to show angle vs value. Angles will change by a small but uncontrollable quantity for each data set but there will always be ~50 of them spaced fairly evenly around the chart.
It looks like chart.js
has two options which don't quite fit the bill:
Is there a way to combine the two perhaps or some option I've missed to control them to achieve the result I'm looking for here?
Edit - for example, this shows the data but lacks a radial scale:
https://jsfiddle.net/7d7ghaxx/4/
**Edit2 - This is the sort of thing I Would expect to see as a result:
Radar charts (also known as spider charts, polar charts, web charts, or star plots) are a way to visualize multivariate data. They are used to plot one or more groups of values over multiple common variables.
https://stackblitz.com/edit/js-jp4xm4?file=index.js
beforeUpdate
so you don't have to worry about converting before every updategridLines
: { color: 'transparent' }
and ticks
: { display: false }
min
and max
(options in ticks
) of both axes equal so that the orgin is at the centerradialLinear
scale for the polar grid(Update 1)
(Update 2)
beforeDraw
plugin to fill the ctx
with light blue color as the OP wanted PS: (Pointing out just to be a little competitive) I have used chartjs (unlike other answers) because the OP wants a chartjs solution as it's clearly written in the question: "using chart.js". There might be solutions better than chartjs but that's irrelevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With