Problem with TChartAxis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
soulianis
Newbie
Newbie
Posts: 3
Joined: Tue Mar 30, 2010 12:00 am

Problem with TChartAxis

Post by soulianis » Wed Jun 02, 2010 12:24 pm

hi,

I am using the TChartAxis class to customise the axis when I try to split a graphics where there are two graphs creating two, everyone with their title, etc. The problem is that the title doesn't appears. If I only show one of them, it doesn't matter which, the title appears, but not in both.

I show you the code and I'll try to explain you.

Can you help me if you see something wrong

thanks in advance
Josep Miquel Salvador

// Loop for the graphs
for(int i=0;i<NumeroVols;i++){
Axis = new TChartAxis( Chart2->CustomAxes ); // I create a new tcharaxis (one for every graph)
Axis->StartPosition = part;
Axis->EndPosition = part + partIni;
if(col == 0) Axis->LabelsFont->Color = clWhite;
Axis->LabelsSize = 25;
if(ContColor == 6) ContColor = 0;
Axis->Axis->Color = Llista_Colors.RegPLlista_Colors[ContColor]; // get color
ContColor++;

//I get the title
DString NomCY = "";
Nombre_Campo (campos_Y[0/*Valor_Y*/].tipo,NomCY,false);
TEnumTipoMagnitudes magn;
magn = Magnitud_Campo(campos_Y[0/*Valor_Y*/].tipo);
NomCY << " [" << Unidades.Nombre_Unidad_Mag (magn) <<"]";
Axis->Title->Caption = NomCY; // here the string is "Height Graph (m)"
Axis->Title->Angle = 90;

VolsSeries.RegPVol_Serie.EixY.RegPLineSeries[0].CustomVertAxis = Axis; // I assign this axis to the series
part = part + partIni;
}

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with TChartAxis

Post by Yeray » Thu Jun 03, 2010 1:36 pm

Hi Salvador,

In the code snipped above we can see too many variables unknown or undefined. It would help us to understand what are you exactly trying to do if you could send a simple example project we can run as-is to reproduce the issue here.

Thanks in advance.

Salut! ;)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

soulianis
Newbie
Newbie
Posts: 3
Joined: Tue Mar 30, 2010 12:00 am

Re: Problem with TChartAxis

Post by soulianis » Fri Jun 04, 2010 9:31 am

hi Yeray,

It it difficult to give you an exemple of this because my code is very related to personal variables.
I'll try to simplify.
If I draw only one chart, (if I run the loop once, the title of the graphs appears)
If I draw two, no title in any chart.
I hope that you understand my problem now.

Thanks in advance
soulianis
Salut i bon cap de setmana !

-----------------------------------------------------------------------

int partIni = 50;
int part =0;
TLineSeries VolsSeries[2];
TChart *Chart2;


// Loop for the 2 graphs
for(int i=0;i<2;i++){
Axis = new TChartAxis( Chart2->CustomAxes ); // I create a new tchartaxis (one for every graph)
Axis->StartPosition = part;
Axis->EndPosition = part + partIni;
Axis->LabelsSize = 25;
if (i==0)
Axis->Axis->Color = 255;
else
Axis->Axis->Color = 16711680;

//I get the title
Axis->Title->Caption = " [Height Graph (m)"]";
Axis->Title->Angle = 90;

VolsSeries.CustomVertAxis = Axis; // I assign this axis to the series
part = part + partIni;
}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Problem with TChartAxis

Post by Narcís » Fri Jun 04, 2010 3:37 pm

Hi Josep,

Sorry, but it's still not clear to me what you are trying to do. Can you please attach a simple example project we can run "as-is" to reproduce the probem here and debug it?

Gràcies i bon cap de setmana també!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

soulianis
Newbie
Newbie
Posts: 3
Joined: Tue Mar 30, 2010 12:00 am

Re: Problem with TChartAxis

Post by soulianis » Wed Nov 24, 2010 2:43 pm

hi again,

My problem is not solved. I will attach a couple of images to explain my problem. At first (image before_click) , when the chart appears the vertical axis texts almost doesn't appear.
If I click on the chart (image after_click) the texts appear more, overlapped but they appears.

What can be the problem ?
I am looking for the answer and I can't find the solution.

thanks in advance
soulianis
before_click.png
before_click.png (5.69 KiB) Viewed 4042 times
after_click.png
after_click.png (6.47 KiB) Viewed 4050 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with TChartAxis

Post by Yeray » Wed Nov 24, 2010 3:53 pm

Hi soulianis,

Clicking on the chart changes it? Are you using OnClick event to change something on it?
If not, it could be a chart repaint more than a click. If so, you could try forcing the chart to be redrawn when the initialization finishes. Try the call:

Code: Select all

Chart1->Draw();
You could also try adding some margin to the left side of your chart:

Code: Select all

Chart1->MarginLeft = 10;
I hope it helps!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply