Page 1 of 1
Custom axes with different units for same series?
Posted: Tue Aug 23, 2005 5:38 pm
by 9637652
Is it possible to have two custom axes with different units that reference the same series?
I would like to create a chart that displays temperature information in both Celsius and Fahrenheit (the scales would be on the left and right sides of the graph, respectively). The data is in Celsius.
What I was hoping to avoid was adding another series of Fahrenheit data that is not visible. In other words, I wanted to add a custom axis with the tick marks set for Fahrenheit, but not an entirely new Fahrenheit series.
I am using TeeChart.NET ver 2 (2.0.1992.14012).
Thanks in advance.
Posted: Wed Aug 24, 2005 10:36 am
by narcis
Hi Heraclitus,
Not using custom axis as only one vertical custom axis can be associated to a series. However you can do it using chart's default left and right axes as shown here:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
line1.FillSampleValues();
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
tChart1.Axes.Left.Title.Text="Celsius";
tChart1.Axes.Right.Title.Text="Fahrenheit";
}
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if (sender == tChart1.Axes.Right)
{
//0 degree Celsius = 32 degree Fahrenheit
e.LabelText = Convert.ToString(Convert.ToInt32(e.LabelText)+32);
}
}
Posted: Wed Aug 24, 2005 3:52 pm
by 9637652
Hi Narcis,
Thanks for the reply. I did get this to work as you described above.
Unfortunately, I am creating a chart with multiple custom axis "stacked" on top of one another similar to your example under "All Features/Axes/Permanent custom axes". So I actually need to associate multiple vertical custom axes with a particular series.
One work around I found was to add a hidden series of Fahrenheit values and associate a custom vertical axis with this series. The problem here is when I add a Legend with "Legend Style" set to "Series Names" the hidden series shows up in the Legend. Is there a way to specify which series are shown in a Legend set to "Series Names"?
Also, are there any plans to add the ability to associate multiple vertical custom axes to a series in a future release of TeeChart.NET?
Posted: Thu Aug 25, 2005 8:33 am
by narcis
Hi Heraclitus,
One work around I found was to add a hidden series of Fahrenheit values and associate a custom vertical axis with this series. The problem here is when I add a Legend with "Legend Style" set to "Series Names" the hidden series shows up in the Legend. Is there a way to specify which series are shown in a Legend set to "Series Names"?
Yes, this is possible. To do it use series ShowInLegend property:
Also, are there any plans to add the ability to associate multiple vertical custom axes to a series in a future release of TeeChart.NET?
It's a very interesting idea. I've added your request to our wish list to be considered for future releases.