在项目网站上是a package with samples。在这些演示中,您可以找到 3d 列。编辑代码以更改系列类型和数据格式后,我得到了一个有效的 3d 散点图。我使用的代码:
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);
}
该文件是项目的Controllers 目录中的DemoController.cs。
如果您需要创建与 Highcharts 演示页面中相同的 Highcharts 图表,您可能会遇到一些问题。 DotNet.Highcharts 中的代码来自 2014 年,在旧的 Highcharts 版本上运行。较新的代码用于不相关且仍在开发中的official Highcharts product - http://dotnet.highcharts.com/,因此您可以尝试一下。