Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Gap between Y-axis and bar in horizontal bar

 Post Reply Post Reply
Author
Hennekens Stephan View Drop Down
New Member
New Member
Avatar

Joined: 16 Aug 2012
Posts: 22
Post Options Post Options   Quote Hennekens Stephan Quote  Post ReplyReply Direct Link To This Post Topic: Gap between Y-axis and bar in horizontal bar
    Posted: 09 Jul 2018 at 3:40pm
Which property do I have to set to get rid of the space between bars and Y-as (or X-axis if you like). I have tried many options but all failed. The code used is listed below the picture.


      Chart3.BeginUpdate;
      Chart3.Panes[0].Series.Clear;
      with Chart3.Panes[0] do
      begin
         XScaleOffset := True;
         Options := [poHorzScroll];
         Title.Text := 'Verdeling over gemeenschappen';
         Title.Font.Color := clBlue;
         Title.Font.Style := [fsBold];
         series.ChartMode := dmHorizontal;
         Range.RangeFrom := 0;
         Range.RangeTo := 13; //couples.Count - 1;
         YAxis.Position := yRight;
         XAxis.Text := IIFString(cmxSyntaxLevel.ItemIndex = 1, 'verbonden', 'assocaties');
      end;
      with Chart3.Panes[0].Series.Add do
      begin
         ClearPoints;
         ChartType := ctBar;
         ValueWidth := 15;
         ValueWidthType := wtPixels;
         Color := RGB(255, 120, 120);
         ColorTo := RGB(255, 175, 175);
         BorderColor := clRed;
         BorderWidth := 0;
         ShowValue := False;
         GradientType := gtHorizontal;
         AutoRange := arEnabledZeroBased;
         YScale := 10;
         YAxis.Position := yRight;
         Maximum := 100;
         Minimum := 0;
         for k := 0 to couples.Count - 1 do
            AddSinglePoint(couples[k].Y, couples[k].X);
      end;
      Chart3.EndUpdate;

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3205
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 2018 at 3:43pm
Hi, 

Please use the property ChartMargins on series level.
AdvChartView1.Panes[0].Chart.Margin
Back to Top
Hennekens Stephan View Drop Down
New Member
New Member
Avatar

Joined: 16 Aug 2012
Posts: 22
Post Options Post Options   Quote Hennekens Stephan Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 2018 at 5:12pm
Excellent. That does the job!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down