I have a dynamically created chart and I need to add a horizontal and vertical axis in a script. I can't put the chart into MXML because I'm dynamically changing the chart type, deleting and creating a new chart. Therefore, the variable that I use to create the chart, an instance of chartBase, doesn't have either a horizontalAxis or verticalAxis. How do I assign to them if they don't exist? Should I be using a different type? The graphs I want to use are line, bar, and HLOC and/or candlestick.
R – Flex: How to add horizontal axes to a chart
actionscriptapache-flexcharts
Best Answer
I think you'll get better results by instantiating your chart as a proper type.
For example, in a component I have a skeleton lineChart setup in the mxml...
... but you could create it as a variable and add it to the container. Then for the axis I determine the type I want and create and apply them, here's some code I use for the horizontal axis...
Hope that helps.