custom axes items

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Friis
Newbie
Newbie
Posts: 26
Joined: Thu Oct 16, 2014 12:00 am

custom axes items

Post by Friis » Wed Oct 22, 2014 6:34 am

Hi,

In delphi I have with gtrea success been using this code:

Code: Select all

Chart1.CustomAxes.Items[0].Items.Add(0,'PO Nummer');
However, when trying to translate this into .NET I haven been able to find the same method. What is the equivalent method to the code above?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: custom axes items

Post by Christopher » Thu Oct 23, 2014 8:36 am

Hello,

With TeeChart.VCL you can do:

Code: Select all

procedure TForm1.InitializeChart;
var axis : TChartAxis;
begin
    Series1:=TLineSeries.Create(Self);
    Series1.ParentChart:=Chart1;

    Series1.FillSampleValues();

    axis:=Chart1.CustomAxes.Add;
    axis.Horizontal:=true;

    Series1.HorizAxis := aCustomHorizAxis;
    Series1.CustomHorizAxis := axis;

    Chart1.MarginBottom:=20;

    Chart1.CustomAxes.Items[0].Items.Add(0,'PO Nummer');
end;
in TeeChart.NET the equivalent is:

Code: Select all

    private void InitializeChart()
    {
      series1 = new Line(tChart1.Chart);
      series1.FillSampleValues();

      Axis axis;
      tChart1.Axes.Custom.Add(axis = new Axis());
      axis.Horizontal = true;

      series1.HorizAxis = HorizontalAxis.Custom;
      series1.CustomHorizAxis = axis;

      tChart1.Panel.MarginBottom = 20;

      tChart1.Axes.Custom[0].Labels.Items.Add(0, "PO Nummer");
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply