Problem with Axis Relabelling
Posted: Thu Jul 09, 2015 2:15 pm
I am moving some code written on VS2005 C++ with TeeChart for .NET v2 , recompiling using VS2013 C++ with TeeChart for .NET 2014 4.1.2014.12150
The old compile produces a great image but the new compile produces a chart were the right axis title overlaps the custom labels.
It worked before but doesn't work now - I haven't changed any of this code.
PS How to I add images to demonstrate this problem? The "Upload Attachment" says "The extension bmp is not allowed."
Thanks
Bob
I have been relabelling a right axis using the following code ( VS2013 c++ ) :
System::Void Relabel_Right_Depth_Axis(double depth_increment, double sound_speed)
{
this->tChart1->Refresh();
this->tChart1->AutoRepaint = false;
//this->tChart1->Axes->Right->Labels->Visible = false;
this->tChart1->Axes->Right->Labels->Items->Clear();
this->tChart1->Axes->Right->Minimum = this->tChart1->Axes->Left->Minimum;
this->tChart1->Axes->Right->Maximum = this->tChart1->Axes->Left->Maximum;
// min time
double tmin = this->tChart1->Axes->Left->Minimum;
double tmax = this->tChart1->Axes->Left->Maximum;
double dstart = depth_increment * Math::Round(0.75*tmin/depth_increment);
double dmax = 0.75*tmax;
while ( dstart <= dmax)
{
double t = dstart/0.75;
this->tChart1->Axes->Right->Labels->Items->Add(t, dstart.ToString());
dstart += depth_increment;
}
this->tChart1->AutoRepaint = true;
//this->tChart1->Axes->Right->Labels->Visible = true;
this->tChart1->Refresh();
}
The old compile produces a great image but the new compile produces a chart were the right axis title overlaps the custom labels.
It worked before but doesn't work now - I haven't changed any of this code.
PS How to I add images to demonstrate this problem? The "Upload Attachment" says "The extension bmp is not allowed."
Thanks
Bob
I have been relabelling a right axis using the following code ( VS2013 c++ ) :
System::Void Relabel_Right_Depth_Axis(double depth_increment, double sound_speed)
{
this->tChart1->Refresh();
this->tChart1->AutoRepaint = false;
//this->tChart1->Axes->Right->Labels->Visible = false;
this->tChart1->Axes->Right->Labels->Items->Clear();
this->tChart1->Axes->Right->Minimum = this->tChart1->Axes->Left->Minimum;
this->tChart1->Axes->Right->Maximum = this->tChart1->Axes->Left->Maximum;
// min time
double tmin = this->tChart1->Axes->Left->Minimum;
double tmax = this->tChart1->Axes->Left->Maximum;
double dstart = depth_increment * Math::Round(0.75*tmin/depth_increment);
double dmax = 0.75*tmax;
while ( dstart <= dmax)
{
double t = dstart/0.75;
this->tChart1->Axes->Right->Labels->Items->Add(t, dstart.ToString());
dstart += depth_increment;
}
this->tChart1->AutoRepaint = true;
//this->tChart1->Axes->Right->Labels->Visible = true;
this->tChart1->Refresh();
}