juliet
juliet

Reputation: 917

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

Upvotes: 4

Views: 12741

Answers (1)

juliet
juliet

Reputation: 917

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

Upvotes: 7

Related Questions