Help on coding 3d surface mesh chart


Author
Message
lian jia jie
lian jia jie
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 8, Visits: 89
Doing a project of a 3d surface chart to show the changing temperature from several sensors. The temperature data is retrieved from MySql database.  

I need help on manually assign the sensor data on certain coordinate. Eg. [x1,y1] - sensor1 , [x2,y1] -sensor 2, [x1,y2] - sensor3, [x2,y2]-sensor 4 , etc...
Any sample coding or guidance is appreciated.
Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Lian,
Yes sure - the following code shows how to display a chart similar to the one you attached:

   NChart chart = nChartControl1.Charts[0];
   chart.Enable3D = true;
   chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveTilted);
   chart.Width = chart.Height = chart.Depth = 50;

   NOrdinalScaleConfigurator xScale = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
   xScale.AutoLabels = false;
   xScale.Labels.Add("A");
   xScale.Labels.Add("B");
   xScale.Labels.Add("C");

   NOrdinalScaleConfigurator yScale = chart.Axis(StandardAxis.Depth).ScaleConfigurator as NOrdinalScaleConfigurator;
   yScale.AutoLabels = false;
   yScale.Labels.Add("X");
   yScale.Labels.Add("Y");
   yScale.Labels.Add("Z");

   NBarSeries bar1 = new NBarSeries();
   bar1.Values.Add(10);
   bar1.Values.Add(20);
   bar1.Values.Add(30);
   chart.Series.Add(bar1);

   NBarSeries bar2 = new NBarSeries();
   bar2.Values.Add(12);
   bar2.Values.Add(22);
   bar2.Values.Add(32);
   chart.Series.Add(bar2);

   NBarSeries bar3 = new NBarSeries();
   bar3.Values.Add(15);
   bar3.Values.Add(25);
   bar3.Values.Add(35);
   chart.Series.Add(bar3);

   NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Bright).Apply(nChartControl1.Document);

Hope this helps - let us know if you have any questions.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
lian jia jie - 8 Years Ago
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
                         Hi, You need to call the Clear method of the surface data, update the...
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
Nevron Support - 8 Years Ago
lian jia jie - 8 Years Ago
Blagovest Milanov 1 - 8 Years Ago
lian jia jie - 7 Years Ago
Nevron Support - 7 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search