Adding range markers on donut chart
Hello,
Thank you for all the work you've put in the library, I've enjoyed working with it! I've been working on this issue for a couple of days now and haven't been able to figure it out: Would it be possible to overlay 2 or more markers to indicate a range on a donut chart?
This is what I'm trying to achieve:

So far, I've tried adding content via an overlay svg and try to absolutely position that on top the chart. I would eventually pass variables (possibly with just a % value), however matching the exact location where the markers are placed on the donut chart is quite challenging. Do you have any suggestions on how to implement this?
Hey there. I felt like doing a plugin for that :-) Feel free to use it under WTFPL. If someone finds the time to wrap this into a repository and make a PR to add it to the docs please go ahead!
http://jsbin.com/huroho/edit?js,output
Thank you so much for taking the time to write the plugin! I wasn't expecting a full solution, this is great! I really like the fact that it allows for any number of markers, as well as the customization options for marker color and length.
Cool no worries! :-)
@gionkunz I am using your written plugin to draw the pointer in my gauge chart and it displays perfectly! But I'm having trouble updating the pointer when I use the myChart.update() functionality.
I initially have your jsbin setup. Then I try to update the pointers by doing the following but the pointers did not change. Is there something I'm missing?
chart.update(sameData, {
donut: true,
donutWidth: 150,
startAngle: 270,
total: 200,
plugins: [
ctDonutMarks({
marks: [80],
lineAttributes: {
stroke: 'red',
}
}),
ctDonutMarks({
marks: [50],
lineAttributes: {
stroke: 'blue',
}
})
]
});