Controlling axis labeling in polar plots

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jonsberndt
Newbie
Newbie
Posts: 21
Joined: Wed May 02, 2007 12:00 am
Location: Houston, TX

Controlling axis labeling in polar plots

Post by jonsberndt » Thu Jun 14, 2007 3:58 pm

I have data that looks like this:

-175 -170 5E-20
-170 -165 2.7972E-08
...
175 180 5E-20
180 -175 5E-20

I've got this data plotted in a polar plot and it looks great, except that the angular labels that are placed about the circumference of the plot go from 0 to 360. I'd like the labels to go from -180 to +180, just like the data. I can't figure out how to do that. Any hints? Can it be done?

Jon

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

Post by Narcís » Fri Jun 15, 2007 9:24 am

Hi Jon,

I'm afraid this is not possible for now. The only way I can think of to achieve that is if you are a TeeChart for .NET source code customer and modify existing series to support this feature or create you own polar series.

I'll add your request to our wish-list to be considered for inclusion in 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

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

Post by Narcís » Fri Jun 15, 2007 10:01 am

Hi Jon,

Looking further into the issue I've found that what you request is possible creating your custom polar series and overriding GetCircleLabel method as shown here:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace PolarLabels
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			MyPolar polar1 = new MyPolar();

			tChart1.Series.Add(polar1);
			polar1.CircleLabels = true;
			polar1.FillSampleValues();			
		}
	}

	public class MyPolar : Steema.TeeChart.Styles.CustomPolar
	{
		private bool clockWiseLabels = false;

		public MyPolar() {}

		protected override string GetCircleLabel(double angle, int index)
		{
			double tmp = clockWiseLabels ? 360 - angle : angle;
			if (tmp == 360) tmp = 0;
			return (tmp - 180).ToString() + Steema.TeeChart.Texts.PolarDegreeSymbol;
		}
	}
}
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