While the numeric labels are visible, I need to replace them with custom text labels on the depth axis. Is there a way to do this?
version 1.0.1189.31308
need custom labels on depth axis
Hi Dave,
yes, you can use the OnGetAxisLabel event :
yes, you can use the OnGetAxisLabel event :
Code: Select all
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if ((Steema.TeeChart.Axis)sender == tChart1.Axes.Depth)
{
e.LabelText = "Hello";
//..
}
}
Pep Jorge
http://support.steema.com
http://support.steema.com
I got it working, but noticed that e.LabelText sometimes contained strings that did not make sense. My data is from 0-16 but string values of -1.88 or 20 would sometimes be found in e.LabelText during this event. I've filtered these out, but is there any way to make this less "hacky"?
Thanks,
if((Steema.TeeChart.Axis)sender == tChart1.Axes.Depth)
{
// Get the index value for the label
int index = 0;
try
{
index = Convert.ToInt32(e.LabelText);
}
catch(FormatException)
{
// Bomb out if string did not represent an int
return;
}
// Populate the labels for the depth axis
// Ignore index values outside the allowed range
if(index < masterCal.CalibrationData.X_AxisSize)
e.LabelText = masterCal.CalibrationData.X_Axis.RowValue[index];
}
Thanks,
if((Steema.TeeChart.Axis)sender == tChart1.Axes.Depth)
{
// Get the index value for the label
int index = 0;
try
{
index = Convert.ToInt32(e.LabelText);
}
catch(FormatException)
{
// Bomb out if string did not represent an int
return;
}
// Populate the labels for the depth axis
// Ignore index values outside the allowed range
if(index < masterCal.CalibrationData.X_AxisSize)
e.LabelText = masterCal.CalibrationData.X_Axis.RowValue[index];
}