Reputation: 1
I'm using dotnet library provided by Codeplex to draw Highcharts plots on an asp.net web form. Although I managed to plot several types of charts successfully, I have difficulty in plotting the 3D scatter plot. It has some additional functionality for rotating the plot by tracking the mouse.
Anybody tried this 3D scatter plot on .Net platform before? How do you use the js code that cannot be put inside the var chart = new Highcharts.Chart(...)
block?
Upvotes: 0
Views: 270
Reputation: 7886
On the project web site is a package with samples. In those demos you can find 3d column. After editing it's code to change series type and data format I got a working 3d scatter chart. The code I used:
public ActionResult ThreeDColumn()
{
Highcharts chart = new Highcharts("chart")
.InitChart(new Chart
{
Type = ChartTypes.Scatter,
Margin = new[] { 75 },
Options3d = new ChartOptions3d
{
Enabled = true,
Alpha = 15,
Beta = 15,
Depth = 50,
ViewDistance = 25
}
})
.SetTitle(new Title { Text = "Chart rotation demo" })
.SetSubtitle(new Subtitle { Text = "Test options by dragging the sliders below" })
.SetLegend(new Legend { Enabled = false })
.SetSeries(new Series { Data = new Data(new object[,] { { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 } }) });
return View(chart);
}
The file is DemoController.cs
in project's Controllers
directory.
In case you need to create the same Highcharts chart as a one in Highcharts demo page you might get some problems. The code in the DotNet.Highcharts is from 2014 and runs on old Highcharts version. Newer code is used in an unrelated and official Highcharts product that is still being developed - http://dotnet.highcharts.com/ so you could try that.
Upvotes: 0