Profile Picture

Surface (Delphi Prism)

Posted By Janusz Cichocki 13 Years Ago
Author
Message
Janusz Cichocki
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 1, Visits: 1

Hi,

There are my first steps in Nevron Chart. I have prepared an example (based on yours...) :

begin

var title : NLabel := nChartControl1.Labels.AddHeader ("Grid Surface Chart");

title.TextStyle.FontStyle := new NFontStyle("Times New Roman", 14, FontStyle.Italic);

title.TextStyle.ShadowStyle.Type := ShadowType.LinearBlur;

var Chart : NCartesianChart := new NCartesianChart ();

nChartControl1.Charts.Clear();

nChartControl1.Charts.Add(chart);

chart.Enable3D := true;

chart.Width := 55;

chart.Depth := 70;

chart.Height := 30;

chart.Projection.Type := ProjectionType.Perspective;

chart.Projection.Elevation := 30;

chart.Projection.Rotation := -60;

chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.None); //.NorthernLights);

var XL : Byte := 40;

var ZL : Byte := 40;

var Surface : NGridSurfaceSeries := NGridSurfaceSeries (chart.Series.Add(SeriesType.GridSurface));

chart.Series.Add(Surface);

surface.Name := "Surface";

surface.Legend.Mode := SeriesLegendMode.SeriesLogic;

surface.Legend.TextStyle.FontStyle.EmSize := new NLength(8, NGraphicsUnit.Point);

surface.PositionValue := 10.0;

Surface.Data.Clear;

surface.Data.SetGridSize (XL, ZL);

surface.SyncPaletteWithAxisScale := FALSE;

surface.PaletteSteps := 16; //132; //16; ;

surface.ValueFormatter.FormatSpecifier := "0.0";

for I : Int32 := 1 to XL - 1 do

for J : Int32 := 1 to ZL - 1 do

Surface.Data.Setvalue (I, J, Math.Sin (0.01 * I * J));

end;

In Surface.doc you can se the result.  X axis is "to long"

(two times). would you be so king and say me where is my mistake ?

                                           Janusz



Attachments
Surface.doc (128 views, 144.00 KB)
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Janusz,
The problem is that the same surface series instance is being added two times to the series collection. In other words when you use the following code:

 var Surface : NGridSurfaceSeries := NGridSurfaceSeries (chart.Series.Add (SeriesType.GridSurface));

you must not call Add again with the same series:

 chart.Series.Add(Surface); // please remove this line

Unfortunately, the chart control doesn't throw an exception in this situation, which is somewhat misleading. We will try to fix this in the next service pack.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic