I have a column chart and I've enabled the dataLabel to show the values for each column.
How can I decide the format of the numbers?
I'd like to show always two decimal places, like 1,234.56 even if the number in the data source has no decimal places and it's an integer.
here is my code:
$("#cur-ex-rate-chart").ejChart({
//Initializing Primary X Axis
primaryXAxis:
{
valueType: 'category',
majorGridLines: { visible: false }
},
//Initializing Primary Y Axis
primaryYAxis:
{
labelFormat: "{value}",
majorGridLines: { visible: false }
},
//Initializing Common Properties for all the series
commonSeriesOptions:
{
type: 'column',
enableAnimation: true,
tooltip: { visible: false },
columnWidth: 0.4,
marker: {
visible: false,
dataLabel: {
font: {
size: '14px',
fontFamily: 'Arial',
fontStyle: 'Normal',
fontWeight: 'regular',
color: '#ffffff'
},
textPosition: 'middle',
visible: true,
enableContrastColor: false
}
}
},
//Initializing Series
series: [{
fill: '#DC952A',
xName: 'date',
yName: 'val',
dataSource: jsonData
}],
isResponsive: true,
size: { height: "200", width: '70%' },
legend: { visible: false }
});