Problem with TChartAxis
Posted: 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;
}
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;
}