css - base chart slice color on series value? -
right i'm using custom palette display warning level counts in pie chart. however, alarm comes in unexpected severity messes colors. set css classes warningpie, criticalpie or minorpie orange, red , yellow respectively. then, i'd use series label text apply class.
i don't see in dxchart documentation make possible. anyoe have ideas?
here full chart code if curious.
dxpiechart: { datasource: fieldvaluecount(['severity']), palette: ['#cc3300', '#ff9900', '#ffff00', '#33cc33', '#0066ff'], animation: true, legend: { backgroundcolor: '#fcfcfc', border: { color: 'black', width: .5, visible: true, cornerradius: 10 }, visible: false }, series: [{ type: 'doughnut', argumentfield: 'severity', valuefield: 'count', label: { visible: false, font: { size: 12, color: 'black' }, radialoffset: -15, backgroundcolor: 'rgba(0,0,0,0)', connector: { visible: false, width: 0.5 }, position: 'inside', customizetext: function(arg) { globaltest = arg; return arg.value + ' (' + arg.percenttext + ')'; } }, border: { color: 'black', width: .5, visible: true }, hoverstyle: { border: { color: 'black', width: .5, visible: true } } }], tooltip: { enabled: true, color: 'cornflowerblue', font: { size: 14 }, customizetext: function(arg) { globaltest = arg; var content = arg.argumenttext + '<br>' + arg.value + ' (' + math.round(arg.percent * 100) + '%)'; return content } }, title: { text: ' ', font: { size: 14 }, horizontalalignment: 'center' } }
you can use customizepoint , customizelabel options in pie chart.
Comments
Post a Comment