DotNet.HighCharts StepLine

时间:2017-09-28 17:08:09

标签: asp.net-mvc highcharts

我开始使用Dotnet.HighCharts控件在ASP.NET MVC应用程序中在我的页面上绘制图表。 我使用的是谷歌图表,但它们没有足够的功能。

任务是在多个图表上制作包含面积范围,步长线和同步十字准线的图表。 DotNet.HighCharts可以做到吗? 到这个时候我确实画了区域范围。 如果没有,请给我一个提示,控制可以做到。

 Highcharts chart = new Highcharts("chart")
            .InitChart(new Chart())
            .SetTitle(new Title { Text = "July temperatures" })
            .SetXAxis(new XAxis { Type = AxisTypes.Datetime })
            .SetYAxis(new YAxis { Title = new YAxisTitle { Text = string.Empty } })
            .SetLegend(new Legend { Enabled = false })
            .SetTooltip(new Tooltip
            {
                Crosshairs = new Crosshairs(true),
                Shared = true,
                ValueSuffix = "°C"
            })
            .SetLegend(new Legend())
            .SetSeries(new[]
            {
                new Series
                {
                    Name = "Temperature",
                    Data = ChartsData.TemperatureVariationAverages,
                    ZIndex = 1,
                    Type = ChartTypes.Line,
                    PlotOptionsLine = new PlotOptionsLine
                    {

                        Marker = new PlotOptionsLineMarker
                        {
                            FillColor = Color.White,
                            LineWidth = 2,
                            LineColor = Color.Black
                        }
                    }
                },
                new Series
                {
                    Name = "Range",
                    Data = ChartsData.TemperatureVariationRanges,
                    Type = ChartTypes.Arearange,
                    ZIndex = 0,
                    PlotOptionsArearange = new PlotOptionsArearange
                    {
                        LineWidth = 0,
                        LinkedTo = ":previous",
                        Color = Color.Green,
                        FillOpacity = 0.1,
                    }
                },
                new Series
                {
                    Name = "Range3",
                    Data = ChartsData.TemperatureVariationRanges1,
                    Type = ChartTypes.Arearange,
                    ZIndex = 0,
                    PlotOptionsArearange = new PlotOptionsArearange
                    {
                        LineWidth = 0,
                        LinkedTo = ":previous",
                        Color = Color.Red,
                        FillOpacity = 0.1,
                    }
                },
                                                        new Series
                {
                    Name = "Range2",
                    Data = ChartsData.TemperatureVariationRanges2,
                    Type = ChartTypes.Arearange,
                    ZIndex = 0,
                    PlotOptionsArearange = new PlotOptionsArearange
                    {
                        LineWidth = 0,
                        LinkedTo = ":previous",
                        Color = Color.Yellow,
                        FillOpacity = 0.1,
                    }
                }
            });

0 个答案:

没有答案