【问题标题】:dotnet Highcharts 3D Scatter Plotdotnet Highcharts 3D 散点图
【发布时间】:2016-11-22 21:57:51
【问题描述】:

我正在使用 Codeplex 提供的 dotnet 库在 asp.net 网络表单上绘制 Highcharts 图。虽然我成功地绘制了几种类型的图表,但我很难绘制 3D 散点图。它具有一些附加功能,可通过跟踪鼠标来旋转绘图。

之前有人在 .Net 平台上尝试过这个 3D 散点图吗? var chart = new Highcharts.Chart(...)块里面不能放的js代码怎么用?

【问题讨论】:

    标签: highcharts dotnethighcharts


    【解决方案1】:

    在项目网站上是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/,因此您可以尝试一下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-11
      • 1970-01-01
      相关资源
      最近更新 更多