How do you use contour custom levels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
TeeNee
Newbie
Newbie
Posts: 9
Joined: Fri Nov 15, 2002 12:00 am

How do you use contour custom levels

Post by TeeNee » Sun Jan 01, 2006 11:26 am

How do you use contour custom levels? I have looked at the example in
Contour_CustLev.cs and they way that it works seems messy. First it
draws a contour plot using automatic levels. Then to use custom levels
you turn off automatic levels then manually fill in the Levels values.

Is there a way to draw a contour plot straight off with custom levels
without drawing an automatic level plot first? The problem is that if you
try to assign your custom levels before drawing the plot the Levels
ArrayList has not been allocated. I have gotton this to work by setting
AutomaticLevels then changing the levels to custome levels in the
BeforeDrawValues event. That's extremely messy and cryptic. And I'm
not sure that my levels won't get overwritten anyway.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Jan 02, 2006 2:57 pm

Hi -
First it
draws a contour plot using automatic levels. Then to use custom levels
you turn off automatic levels then manually fill in the Levels values.
This is because a number of important Contour/Custom3DPalette calculations are made internally as the chart is painted.
Is there a way to draw a contour plot straight off with custom levels without drawing an automatic level plot first?
Because of the above, the answer to this is yes and no. Yes a chart can be drawn straight off but no, it can't be done without painting the chart first.

The following code should be of help to you (the constructor in Contour_CustLev.cs):

Code: Select all

public Contour_Levels()
		{
			// This call is required by the Windows Form Designer.
			InitializeComponent();

			this.contour1.ColorEach = false;
			this.contour1.FillSampleValues(20);
			Bitmap bmp = tChart1.Bitmap; //do an "internal" repaint
			this.contour1.AutomaticLevels = false;
			AddCustomLevels();
		}
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

TeeNee
Newbie
Newbie
Posts: 9
Joined: Fri Nov 15, 2002 12:00 am

Post by TeeNee » Mon Jan 02, 2006 11:18 pm

That bitmap code is handy to know about. Cheers

Post Reply