You must be logged in to post your query.
Home › Forums › Chart Support › Pie Label Format for Zip Codes
Anyway to force zero leading labels on a pie chart.
This example –
https://www.bankdeposits.com/canvas-zip
so
8223 -> 08223 8230 -> 08230 8244 -> 08244 8226 -> 08226
?
@jimginn,
Since you are trying to use two values(y-value & label) in indexLabel, using indexLabelFormatter and formatNumber method to customize each of the values before displaying them as indexLabel should work fine. The code snippet below shows how you can achieve the same:
indexLabelFormatter: function(e){ return CanvasJS.formatNumber(e.dataPoint.label, "0####") + " (" + CanvasJS.formatNumber(e.dataPoint.y, "$#,##0.00\"\"") + ") " ; }
Please take a look at this JSFiddle for a working example with sample code.
— Shashi Ranjan Team CanvasJS
Shashi,
Thanks & Better e.g –
however, function/fix to fix the label on ‘onHover’ over pie section?
Jim
By using toolTipContent property, you can customize both the (y-value & label) values displayed in the toolTip. The code snippet below shows how you can achieve the same:
toolTipContent: "<span style='\"'color: {color};'\"'>0{label}</span>: {y}"
Please take a look at this JSFiddle for an example adding custom toolTip Content.
— Adithya Menon Team CanvasJS
You must be logged in to reply to this topic. Login/Register