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.
No control over Y axis labels for TCustomSeries?
Hi Jeff,
Yes, it should work in the same manner. You can change the axis labels although they are Values.Another post recommends using either OnGetAxisLabel but this will not work when my Axis Labels are Values?
I'm able to have it using the following code :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.
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);
}
Pep Jorge
http://support.steema.com
http://support.steema.com