Changing the legend values in surface or colorgrid

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

Changing the legend values in surface or colorgrid

Post by Matt G » Fri Apr 30, 2004 6:19 pm

Hello,

I am having a hard time with formatting the legend with both surface or colorgrid (mayb others, haven't tried yet).

I want to force the legend to span the values that I am interested in, but can't find a way. Also, I can't format the legend to use reasonable significant digits (always defaults to ##.####).

Is there a way to do this?

Also, can I make the depth axis (dependant variable) logarithmic in the legend?

My data spans several orders of magnitude and the ability to do this is important to me.

Thanks,
Matt

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Sun May 02, 2004 7:26 am

Hi, Matt.

As far as custom palette goes, you can use the following code:

Code: Select all

			// populate series with data
      for (int i = -5; i<5; i++)
        for (int j = -3; j < 5; j++)
          surface1.Add(i,2.5*Math.Sin(Math.PI*Math.Pow(i*j,2)/10.0),j);

      // create custom palette
      surface1.UsePalette = true;
      surface1.UseColorRange = false;
      surface1.ClearPalette();
      // beige from -2.5 to -2.0
      surface1.AddPalette(-2.0,Color.Beige);
      // white from -2.0 to 0.0
      surface1.AddPalette(0.0,Color.White);
      // blue from 0.0 to to to 2.0
      surface1.AddPalette(2.0,Color.Blue);
      // violet from 2.0 to 2.5
      surface1.AddPalette(2.5,Color.Violet);          
For logarithmic depth axis, you could use the following code:

Code: Select all

tChart1.Axes.Depth.Logarithmic = true;
But please be aware that number of points in surface series in any direction is limited to 2000 points.
Marjan Slatinek,
http://www.steema.com

Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

Need more help

Post by Matt G » Mon May 03, 2004 8:32 pm

Sounds great, but there is no .AddPalette function in VB....

Is there a more recent release that includes this?

Thanks,
Matt

Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

Found it!

Post by Matt G » Mon May 03, 2004 8:51 pm

:roll: I down loaded the latest version. It has it. but things don't seem to work the same now...

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue May 04, 2004 6:39 am

Hi, Matt.

Can you be a bit more specific ? The palette is not constructed correctly or ... ?
Marjan Slatinek,
http://www.steema.com

Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

Post by Matt G » Tue May 04, 2004 1:18 pm

It seems with the new version, I cannot add data the same way.

Before I would add a series at design time (default name surface1). Then I would use:

Surface1.Add (myX, myY,myZ)

The default names are now series0,series1, ... which is fine, but I can't figure out how to address them now!

Even using AxTchart1.Series0.Add does not work.

Thanks,
Matt

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue May 04, 2004 8:17 pm

Hi, Matt.
AxTchart1.Series0
This won't work in any case. Instead, if you created series0 and series1 you should use the:

Code: Select all

series0.Add(....);
But using the latest available build I was not able to replicate the problem i.e. when I added new surface series, it was named as surface1 and not as series0.
Marjan Slatinek,
http://www.steema.com

Post Reply