This topic is locked
[SOLVED]

 How to modify format value in chart

10/20/2017 8:18:13 PM
PHPRunner General questions
E
exora author

Hi all,
How to change format value in chart? For example 15000000 change to 15.000.000
I modify it in field properties area ("edit as" and "view as") and it's just working in table view but not in chart.
I search the similiar code in https://www.xlinesoft.com/phprunner/docs/chartmodify.htm but not found it.
Any body know how to modify those format value?
Thanks

HJB 10/21/2017



Hi all,
How to change format value in chart? For example 15000000 change to 15.000.000
I modify it in field properties area ("edit as" and "view as") and it's just working in table view but not in chart.
I search the similiar code in https://www.xlinesoft.com/phprunner/docs/chartmodify.htm but not found it.
Any body know how to modify those format value?
Thanks


http://www.asprunner.com/forums/topic/22896-format-a-chart-legend/
... for inspiration purposes only ...

jadachDevClub member 10/21/2017

Here is something I did to display values as percents. I did this on JavaScript Chart Modify event. Maybe this will get you pointed in the right direction.

var series = chart.getSeriesAt(0);

series.labels().textFormatter(function(){

var num = Number(this.value);

return((num*100).toFixed(0)+"%");

});
var series1 = chart.getSeriesAt(0);

series1.labels(true);

series1.labels().fontSize(15);

series1.labels().fontColor("#ff0000");
var yLabels = chart.yAxis(0).labels();

yLabels.textFormatter(function(){

var value = this.value;

value = Math.round(value*100);

return value+"%";

});
E
exora author 10/22/2017



Here is something I did to display values as percents. I did this on JavaScript Chart Modify event. Maybe this will get you pointed in the right direction.

var series = chart.getSeriesAt(0);

series.labels().textFormatter(function(){

var num = Number(this.value);

return((num*100).toFixed(0)+"%");

});
var series1 = chart.getSeriesAt(0);

series1.labels(true);

series1.labels().fontSize(15);

series1.labels().fontColor("#ff0000");
var yLabels = chart.yAxis(0).labels();

yLabels.textFormatter(function(){

var value = this.value;

value = Math.round(value*100);

return value+"%";

});



Thank you very much. It works great. I just replace the return row from toFixed(0)+"%" to toLocaleString().