ZoomControl: Getting rid of Y-Label

Hello,


I have a problem with the ZoomControl in the following Line chart.

The ZoomControl constantly displays the same text on its left Y-Axis as the main chart and I don't know how to get rid of it.

See picture below.

procedure TMainForm.InitializeChart;
begin
  Chart.BeginUpdate;
  try
    Chart.Panes.Clear;


    with Chart.Panes.Add do
      begin
        BorderStyle := bsSingle;
        BorderColor := clBlack;


        Title.Text := FormatDateTime('ddddd', FRecordDate);
        Title.Size := 20;
        Title.Position := tTop;
        Title.Alignment := taCenter;
        Title.Font.Style := [fsBold];


        Legend.Visible := FALSE;
        YAxis.AutoUnits := FALSE;
        YAxis.AutoSize := TRUE;
        XAxis.AutoSize := FALSE;
        XAxis.Size := 100;


        Range.RangeFrom := 0;
        Range.RangeTo := 0;


        Options := [poMoving, poHorzScroll];
      end;


    with Chart.Panes[0].Series.Add do
      begin
        AutoRange := arDisabled;
        SerieType := stBoth;
        Maximum := 1100;
        Minimum := -Maximum;
        Marker.MarkerType := mDiamond;
        XAxis.Visible := TRUE;
        XAxis.TextBottom.Text := 'Zeit';
        XAxis.AutoUnits := FALSE;
        XAxis.DateTimeFormat := 'hh:nn:ss';
        XAxis.MajorUnitTimeFormat := XAxis.DateTimeFormat;
        YAxis.Visible := TRUE;
        YAxis.TextRight.Text := '';
        YAxis.TextLeft.Text := 'Stouffer Z Kummuliert';
        YAxis.TextLeft.Position := ctCenter;
        XAxis.MinorUnit := 1;
        XAxis.MajorUnit := 100;
        ChartType := ctLine;
        Color := clMoneyGreen;
        LineColor := clBlack;
        GradientType := gtHorizontal;
        ColorTo := clSkyBlue;
        BorderColor := clBlack;
        LineWidth := 2;
      end;


    with Chart.Panes[0].ZoomControl	do
      begin
        Visible := TRUE;
        Position := zpCustom;
        AutoUpdate := auImmediate;
        SlideAutoRange := FALSE;
        Opacity := 75;
        Scaled := TRUE;
        Color := clLime;


        // Doesn't work
        Chart.YAxis.AutoSize := FALSE;
        Chart.YAxis.LeftSize := 0;


        // Doesn't work either
        Chart.YAxis.Text := '';
      end;


    UpdateZoomControlPosition;
  finally
    Chart.EndUpdate;
  end;
end;

Thanks for any help! :)


Hi,

I moved the post to the "Charts" forum, since this doesn't seem FlexCel related :)

Hi, 


For finer control, you will need to duplicate the series, and set the y-Axis text empty, or hide the y-Axis on the second series. The first series needs to be set as a normal serietype and the second as a zoomcontrol serietype.

      Chart.Panes[0].Series.Add.Assign(Chart.Panes[0].Series[0]);
      Chart.Panes[0].Series[1].SerieType := stZoomControl;
      Chart.Panes[0].Series[1].YAxis.TextLeft.text := '';

Kind regards, 
Pieter
Oops, sorry. Don't know how it got there?! D:

Thanks! :)

I tried that. It wasn't working at first until I set the SerieType of Series[0] to stNormal and duplicated the values to Series[1] aswell:
Chart.Panes[0].Series[0].AddSinglePoint(Value, FormatDateTime('hh:nn:ss', Now));
Chart.Panes[0].Series[1].AddSinglePoint(Value, FormatDateTime('hh:nn:ss', Now));

Is this the correct approach?

Yes, this is the correct approach.


Kind Regards, 
Pieter

Thanks.