The chart has two sets of dynamically-generated series A & B, one associated
with the left axis, one with the right. There are two checkboxes controlling
the visibility. I would like each checkbox to remove the corresponding
series set, and corresponding axis. So you can view none, A (left), B
(right) or A & B (left and right).

I was able to get rid of the unwanted third (default) axis only if I defined
the verticalAxisRenderers within the body of the LineChart tag rather than
using my buidAxisRenderers binding function. If I then call
buildAxisRenderers from within buildSeriesList, the axes disappear, but the
bogus one reappears as soon as I uncheck both checkboxes.

My workaround for now is to leave the verticalAxisRenders property
unchanged, but set the visibility flag of each renderer instead. This means
the chart does not re-layout.

Thanks.

On Thu, Aug 6, 2009 at 2:38 PM, Vivian Richard <[email protected]> wrote:

>
>
> Do you think that you get this gap, because there is another axis there?
> By the way as I understand you need 2 axises - left and right - then why
> are you adding another axis on left and then rendering. Why not just
> render the axis that comes with the chart?
>
>
> On Thu, Aug 6, 2009 at 1:24 PM, Richard 
> Rodseth<[email protected]<rrodseth%40gmail.com>>
> wrote:
> >
> >
> > I don't think that's it. Seems others have the same issue:
> >
> >
> http://www.nabble.com/flex-charts:-disable-default-verticalAxisRenderer-issue-td22309463.html
> >
> > Even if I do what that thread suggests as below, I get a gap on the left
> > when the right axis is added.
> >
> >            private function buildAxisRenderers(showLeftAxis:Boolean,
> > showRightAxis:Boolean):Array {
> >
> >             // Workaround
> >             var verticalAxisRenderer:AxisRenderer = new AxisRenderer();
> >             verticalAxisRenderer.visible = false;
> >             verticalAxisRenderer.height = 0;
> >             verticalAxisRenderer.width = 0;
> >             verticalAxisRenderer.setStyle("showLabels", false);
> >             lineChart.verticalAxisRenderer = verticalAxisRenderer;
> >
> >               if (showLeftAxis && showRightAxis)
> >                   return [ leftAxisRenderer, rightAxisRenderer];
> >             if (showLeftAxis && !showRightAxis)
> >                   return [ leftAxisRenderer ];
> >             if (showRightAxis && !showLeftAxis)
> >                 return [ rightAxisRenderer ];
> >             return [ ];
> >
> >           }
> >
> >
> > On Thu, Aug 6, 2009 at 12:45 PM, Vivian Richard 
> > <[email protected]<kanpsack%40gmail.com>>
> wrote:
> >>
> >>
> >>
> >> I guess you are adding an additional axis. As you know if you
> >> do not define your axis and put an id for it. The chart will add
> >> the default axis. Now do not do it that way declare both axis
> >> and then tie up the axis renderer with it. I guess that will resolve
> >> you issue.
> >>
> >> Here you can see the example:
> >> http://livedocs.adobe.com/flex/3/langref/mx/charts/AxisRenderer.html
> >>
> >> On Thu, Aug 6, 2009 at 11:52 AM, Richard 
> >> Rodseth<[email protected]<rrodseth%40gmail.com>
> >
> >> wrote:
> >> >
> >> >
> >> > I have a line chart where the user can show/hide the left and right
> axes
> >> > (which have custom colours) and the corresponding series.
> >> >
> >> >             <mx:LineChart
> >> >                 dataProvider="{...}"
> >> >                 verticalAxisRenderers="{this.buildAxisRenderers(...)}"
> >> >                 series="{this.buildSeriesList(...)}"
> >> >             >
> >> >
> >> >    Works fine, except I get two left axes, my custom one and the
> default
> >> > grey one which never goes away. Any ideas? Thanks in advance.
> >> >
> >> >
> >> >
> >
> >
>  
>

Reply via email to