views:

418

answers:

2

In my application, I am using a BarChart to display data. However, the text in the category axis can be too long to display on the chart, so flex adjusts the font size automatically to the point that the data is either unreadable, or the text is partially visible.

The length of the text varies every time new data comes in, so I can't set the gutterLeft attribute to a static value at runtime.

Two things that come to my mind are:

  1. Change the gutter dynamically according to new data

  2. Have a scroll bar on the categoryaxis so that if any text won't fit in the space, the user can scroll to see it

Any help would be appreciated.

EDIT: I have hundreds of rows of data being graphed at once, so I can't really use a legend for each item.

Also, I have no idea how to change the gutterLeft property with actionscript. Doing it in MXML is as simple as

gutterLeft="100"

but I cannot access the property using actionscript. I also tried to bind the gutterLeft variable to an integer and change that integer and it still didn't work. :|

A: 

Try this out by connected pixel

http://www.connectedpixel.com/blog/scrollingcharts?from=0&comments_per_page=50

jonbcampos
Tried it. Doesn't have anything to do with gutter size.
FlexMan
A: 

the problem is that gutterleft is a style, and therefor needs to be set as one when using actionscript.

I was hoping to see your code to give a more detailed answer but what you want to do is:

mychart.setStyle("gutterLeft",500);
invertedSpear