Charts : how to format numbers

Hi

I’m trying to format numbers in a chart and I don’t see how I should define it.

image

Looking at amcharts doc, there should be somewhere a numberFormatter property for a chart but I don’t see it in CUBA components.

How this has been mapped ?

Regards
Michael

Hi,

the link that you’ve posted refferences to the AmCharts v4, but in CUBA plutform the v3 is used. Try to add the precision="<desired_precision>" attribute to the chart element. That should help. Let me know if you still have problems.

Regards,
Gleb

Also, you can use baloonFunction for more flexible formatting, for instance I have the following graph definition:

<chart:graph type="COLUMN"
             valueField="income">
    <chart:balloonFunction>
        <![CDATA[
            function(item, graph) {
                return item.dataContext["income"].toFixed(2);
            }
        ]]>
    </chart:balloonFunction>
</chart:graph>
1 Like