Custom axes with different units for same series?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Heraclitus
Newbie
Newbie
Posts: 10
Joined: Thu Jul 07, 2005 4:00 am

Custom axes with different units for same series?

Post by Heraclitus » Tue Aug 23, 2005 5:38 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 24, 2005 10:36 am

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);
			}
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Heraclitus
Newbie
Newbie
Posts: 10
Joined: Thu Jul 07, 2005 4:00 am

Post by Heraclitus » Wed Aug 24, 2005 3:52 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Aug 25, 2005 8:33 am

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:

Code: Select all

line1.ShowInLegend=false;
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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply