Page 1 of 1
Changing the legend values in surface or colorgrid
Posted: Fri Apr 30, 2004 6:19 pm
by 8123236
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
Posted: Sun May 02, 2004 7:26 am
by Marjan
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.
Need more help
Posted: Mon May 03, 2004 8:32 pm
by 8123236
Sounds great, but there is no .AddPalette function in VB....
Is there a more recent release that includes this?
Thanks,
Matt
Found it!
Posted: Mon May 03, 2004 8:51 pm
by 8123236
I down loaded the latest version. It has it. but things don't seem to work the same now...
Posted: Tue May 04, 2004 6:39 am
by Marjan
Hi, Matt.
Can you be a bit more specific ? The palette is not constructed correctly or ... ?
Posted: Tue May 04, 2004 1:18 pm
by 8123236
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
Posted: Tue May 04, 2004 8:17 pm
by Marjan
Hi, Matt.
AxTchart1.Series0
This won't work in any case. Instead, if you created series0 and series1 you should use the:
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.