No control over Y axis labels for TCustomSeries?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jeff S
Newbie
Newbie
Posts: 13
Joined: Thu Jul 03, 2003 4:00 am

No control over Y axis labels for TCustomSeries?

Post by Jeff S » Fri Aug 27, 2004 8:53 pm

Our code is relatively simple, we instantiate an instance of one of
the chart types
e.g.
TPointSeries* S = new TPointSeries(mChart);
where Chart::TChart* mChart;
do a minimal bit of setting parameters and then call AddXY() to
load the series
e.g.
S->AddXY(XValue, YValue, caption.c_str(), clTeeColor);
and finally show the graph
e.g.
S->ParentChart = mChart;

Another post recommends using either OnGetAxisLabel but this will not work when my Axis Labels are Values?
The other suggestion was to model after the 6.01 custom labels feature using: TChartAxis *axis = Chart1->Axes->Left;
but I do not see how to coerce S or mChart (in sample code above) to have Axes as a member.

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Sep 01, 2004 7:59 am

Hi Jeff,
Another post recommends using either OnGetAxisLabel but this will not work when my Axis Labels are Values?
Yes, it should work in the same manner. You can change the axis labels although they are Values.
The other suggestion was to model after the 6.01 custom labels feature using: TChartAxis *axis = Chart1->Axes->Left;
but I do not see how to coerce S or mChart (in sample code above) to have Axes as a member.
I'm able to have it using the following code :

Code: Select all

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include <Chart.hpp>
#include <Series.hpp>
#include <TeEngine.hpp>
#include <TeeProcs.hpp>
#include <TeeTools.hpp>
#include <TeeFunci.hpp>


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TChart *chart = new TChart(this);
  chart->Parent = this;
  chart->Align = alClient;

  TLineSeries *ser = new TLineSeries(chart);
  ser->ParentChart = chart;
  ser->FillSampleValues(10);

  TCursorTool *MyCursor= new  TCursorTool(chart);
  MyCursor->ParentChart=chart;
  MyCursor->FollowMouse= True;


  TLineSeries *tmpLineSeries = new TLineSeries(chart);
  TAverageTeeFunction  *func = new TAverageTeeFunction(chart);
  tmpLineSeries->SetFunction(func);

  chart->Axes->Bottom->SetMinMax(0,3);
}

Post Reply