I have a pie chart with two types of data: ok and not ok. I want to render ok with green and not ok with red. I have searched in the documentation but with no results. So far my code is:
new CanvasXpress("orderProgressCanvas", {
"y": {
"vars": [
"Ok",
"No"
],
"smps": [
"Percentuale completamento"
],
"colorRGB": [
"rgb(0,255,0)",
"rgb(255,0,0)"
],
"data": [
[
progress
],
[
100-progress
]
]
}
}, {
"graphType": "Pie",
"pieSegmentPrecision": 1,
"pieSegmentSeparation": 2,
"pieSegmentLabels": "outside",
"pieType": "solid",
"showLegend": false,
"background" : "rgb(192,208,216)"
});
But color definition doesn’t work.. any idea?
progress is a javascript variable from 0 to 100.
Thanks
I asked to the main developer:
My code has become: