Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to alter legend labelText for AmCharts?

I am creating a pie chart using AmCharts. I am trying to alter the legend lablelText to show the title, percent and value. I have tried the following which is not working: (This is being passed to the AmCharts.makeChart() method

            "legend": {
                "align": "center",
                "position": "right",
                "marginRight": 21,
                "markerType": "circle",
                "right": -4,
                "labelText": "[[title]]: [[percents]]% $[[value]]",
            },
like image 862
juliet Avatar asked Feb 03 '15 19:02

juliet


1 Answers

In the end I discovered I should be using valueText not labelText and so was able to change to this:

           "legend": {
                "align": "center",
                "position": "bottom",
                "marginRight": 21,
                "markerType": "circle",
                "right": -4,
                "labelText": "[[title]]",
                "valueText": " $[[value]] [[percents]]%",
                "valueWidth": 80,
                "textClickEnabled": true
            },
like image 68
juliet Avatar answered Sep 27 '22 23:09

juliet