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;
}
Problem with TChartAxis
Re: Problem with TChartAxis
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!
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Problem with TChartAxis
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;
}
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;
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Problem with TChartAxis
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é!
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 |
Instructions - How to post in this forum |
Re: Problem with TChartAxis
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
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
Re: Problem with TChartAxis
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:
You could also try adding some margin to the left side of your chart:
I hope it helps!
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();
Code: Select all
Chart1->MarginLeft = 10;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |