I have a column chart that uses a label function to format a vertical axis. I added a button and I want the axis (or chart) to be redrawn when the button is clicked. Right now, the chart axis displays OK only when first added to the view state.
I have a function that sets various properties after creating a chart. There I tried it all:
myChart.verticalAxis.dataChanged();
myChart.validateNow();
myChart.validateDisplayList();
myChart.validateProperties();
myChart.invalidateDisplayList();
myChart.invalidateProperties();
But they do not change the formatting of the axis. How can i do this?
MXML Code for Axis:
< mx:LinearAxis id="verticalAxis" labelFunction="vAxisFormat"/>
Tag Function:
private function vAxisFormat(labelValue:Number, previousValue:Object, axis:IAxis):String { axis.getLabelEstimate(); if (_scale == 1){ return currencyFormatter.format(labelValue/_scale); }else { return numberFormatter.format(labelValue/_scale); } }
source share