How to alter legend labelText for AmCharts?

juliet picture juliet · Feb 3, 2015 · Viewed 11.8k times · Source

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]]",
            },

Answer

juliet picture juliet · Feb 4, 2015

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
            },