Page 1 of 1
Controlling axis labeling in polar plots
Posted: Thu Jun 14, 2007 3:58 pm
by 9094964
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
Posted: Fri Jun 15, 2007 9:24 am
by narcis
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.
Posted: Fri Jun 15, 2007 10:01 am
by narcis
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;
}
}
}