Polar Plot Clipping Question

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
johnf
Newbie
Newbie
Posts: 6
Joined: Mon Jun 11, 2007 12:00 am

Polar Plot Clipping Question

Post by johnf » Wed Nov 19, 2008 4:43 pm

When I draw a polar plot in which the axis limit is less than the data space the line in drawn outside the plot range. Is there a way to clip the plot data without physically changing the data each time the user changes the axis limits?

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 Nov 19, 2008 5:03 pm

Hi johnf,

Yes, you can try doing something like this:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private Steema.TeeChart.Styles.Polar polar1;

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			polar1 = new Steema.TeeChart.Styles.Polar(tChart1.Chart);
			polar1.FillSampleValues();

			polar1.BeforeDrawValues += new Steema.TeeChart.PaintChartEventHandler(polar1_BeforeDrawValues);
			polar1.AfterDrawValues += new Steema.TeeChart.PaintChartEventHandler(polar1_AfterDrawValues);
		}

		void polar1_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.ClearClipRegions();
		}

		void polar1_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.ClipEllipse(tChart1.Chart.ChartRect);
		}
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