3

I'm trying to get AmChart chart legends into one line, but without luck. Legends are separated (one for line).

enter image description here

Actual settings for from documentation http://docs.amcharts.com/3/javascriptcharts/AmLegend is
following.

 "legend": {
                    "equalWidths": false,
                    //"periodValueText": "total: [[value.sum]]",
                    "position": "bottom",
                    "valueAlign": "left",
                    "labelWidth": 100,
                    "valueWidth": 200,
                    //"width": 100,
                    "align": "center"

                },

I Would like to ask how to get all chart legends into one line?

Many Thanks for any advice.

redrom
  • 11,502
  • 31
  • 157
  • 264
  • 1
    labelWidth 100 + valueWidth 200 makes one legend entry 300px width. And as your container is not very wide, entries are wrapped to fit. try to reduce these numbers or do not set them at all. – zeroin Sep 15 '14 at 15:22

4 Answers4

6

you can try legend{ "maxColumns": 1, }

Amal
  • 61
  • 1
  • 2
  • Actually @Amal is right {"[maxColumns](http://docs.amcharts.com/3/javascriptcharts/AmLegend#maxColumns)" :1,} is the correct approach for this – Cristian Marin Jan 17 '17 at 15:10
1

I think it auto resize follows width of div. Btw, You can change "valueWidth" lower.

Ruby Blood
  • 11
  • 1
1

Try reducing "labelWidth" and "valueWidth" to fit just the content

Youssef
  • 92
  • 1
  • 1
  • 9
0

Try setting equalWidths = false and valueWidth = 0, like this:

"legend": {
  "equalWidths": false,
  "valueWidth": 0
}
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68