Page 1 of 1

Labels for MultiBar=mbSideAll on all Series

Posted: Wed Sep 30, 2015 1:16 am
by 16675185
I saw a reference to this wish list entry in the VCL forum: TV52014973 under a 2009 post with subject: "Side All, Labels on Axis X".

It relates to putting X-Axis labels on all columns of a bar chart when MultiBar= 4 i.e. mbSideAll in cases where you have more then one series. Some code was proposed, seebelow, but I cannot get it to work.

Code: Select all

  tmpPos:=0;
  DBChart.Axes.Bottom.Items.Clear;
  for i:=0 to DBChart.SeriesCount-1 do
  begin
    for j:=0 to DBChart[i].Count-1 do
    begin
      DBChart.Axes.Bottom.Items.Add(tmpPos,DBChart[i].Labels.Labels[j]);
      Inc(tmpPos);
    end;
  end;
I am using TeeChart AX 15.0.0.2, on Win8.1(64) with dBase, so I have to convert the code, but even then certain methods do not exist.

Regards,
Graham

Re: Labels for MultiBar=mbSideAll on all Series

Posted: Fri Oct 02, 2015 11:28 am
by yeray
Hello,
Graham wrote:I saw a reference to this wish list entry in the VCL forum: TV52014973 under a 2009 post with subject: "Side All, Labels on Axis X".
Yes, here it is.
Graham wrote:It relates to putting X-Axis labels on all columns of a bar chart when MultiBar= 4 i.e. mbSideAll in cases where you have more then one series. Some code was proposed, seebelow, but I cannot get it to work.
That was an example in Delphi for TeeChart VCL/FMX; in ActiveX some properties/functions may be a bit different.
This works fine for me in VB6:

Code: Select all

Private Sub Form_Load() 
  TChart1.Aspect.View3D = False
  
  TChart1.AddSeries scBar
  TChart1.AddSeries scBar
  TChart1.AddSeries scBar
  
  Dim i, j As Integer
  For i = 0 To TChart1.SeriesCount - 1
    TChart1.Series(i).FillSampleValues 4
    For j = 0 To TChart1.Series(i).Count - 1
      TChart1.Series(i).PointLabel(j) = "Series " + Str$(i) + ", Point " + Str$(j)
    Next j
  Next i
  
  TChart1.Series(0).asBar.MultiBar = mbSideAll
  TChart1.Axis.Bottom.Labels.Angle = 90
  
  Dim tmpPos As Integer
  tmpPos = 0
  TChart1.Axis.Bottom.Labels.Clear
  For i = 0 To TChart1.SeriesCount - 1
    For j = 0 To TChart1.Series(i).Count - 1
      TChart1.Axis.Bottom.Labels.Add tmpPos, TChart1.Series(i).PointLabel(j)
      tmpPos = tmpPos + 1
    Next j
  Next i
End Sub

Re: Labels for MultiBar=mbSideAll on all Series

Posted: Sun Oct 04, 2015 8:30 pm
by 16675185
Many thanks, that is a great help.

Graham