Hi,
I need to hide/remove parts of the axes labels for a Points Chart. For example, I do not want to display any labels that less than zero:
Y Axis: -50 to 150
Aim: To display labels on the chart only between 0 and 150
How can I achieve this?
Thanks,
Hiding Axis Labels
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Hiding Axis Labels
Hello,
You can use the GetNextAxisLabel event, e.g.lilo wrote:Y Axis: -50 to 150
Aim: To display labels on the chart only between 0 and 150
Code: Select all
private Steema.TeeChart.Styles.Points series1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
series1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 20; i++)
{
series1.Add(i, rnd.Next(-50, 150));
}
tChart1.GetNextAxisLabel += tChart1_GetNextAxisLabel;
}
void tChart1_GetNextAxisLabel(object sender, GetNextAxisLabelEventArgs e)
{
if(tChart1.Axes.Left.Equals(sender))
{
e.Stop = false;
switch (e.LabelIndex)
{
case 0: e.LabelValue = 0; break;
case 1: e.LabelValue = 50; break;
case 2: e.LabelValue = 100; break;
case 3: e.LabelValue = 150; break;
default: e.Stop = true; break;
}
}
}
Best Regards,
Christopher Ireland / 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 |