当前位置: 首页>>代码示例>>C#>>正文


C# Highcharts.SetPane方法代码示例

本文整理汇总了C#中DotNet.Highcharts.Highcharts.SetPane方法的典型用法代码示例。如果您正苦于以下问题:C# Highcharts.SetPane方法的具体用法?C# Highcharts.SetPane怎么用?C# Highcharts.SetPane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNet.Highcharts.Highcharts的用法示例。


在下文中一共展示了Highcharts.SetPane方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WeightYearProgressNet

        public string WeightYearProgressNet()
        {
            var startWeight = pedometerCalcService.GetStartWeight(DateTime.Now.Year);
            const int goalWeight = 144;
            var currentWeight = pedometerCalcService.GetRecentWeight();
            var goalLoss = startWeight - goalWeight;
            var actualLoss = Math.Round(startWeight - currentWeight, 1);
            var expectedPct = (DateTime.Now.DayOfYear / 365.0);
            var expectedLoss = Math.Round(expectedPct * goalLoss, 1);

            var highchart = new Highcharts("weightloss");
            var chart = new Chart()
                {
                    Type = ChartTypes.Gauge
                };
            highchart.InitChart(chart);
            highchart.SetTitle(new Title{Text = "Weight Loss " + Math.Round(currentWeight,1)});
            var series = new Series {Data = new Data(new object[] {actualLoss})};
            highchart.SetSeries(series);
            var pane = new Pane
                {
                    Background = new[]
                        {
                            new BackgroundObject
                                {
                                    InnerRadius = new PercentageOrPixel(60, true),
                                    OuterRadius = new PercentageOrPixel(100, true)
                                }
                        },
                        StartAngle = 0,
                        EndAngle = 360
                };
            highchart.SetPane(pane);
            var yaxis = new YAxis
                {
                    Min = 0,
                    Max = goalLoss,
                    PlotBands = new[]
                            {
                                new YAxisPlotBands { From = 0, To = expectedLoss, Color = Color.Red },
                                new YAxisPlotBands { From = expectedLoss, To = expectedLoss+0.7, Color = Color.Yellow },
                                new YAxisPlotBands { From = expectedLoss+0.7, To = goalLoss, Color = Color.Green }
                            },
                    Labels = new YAxisLabels() { Style = "color:'black'"}
                };
            highchart.SetYAxis(yaxis);
            highchart.SetTooltip(new Tooltip() {Enabled = false});
            highchart.SetSubtitle(new Subtitle()
                {
                    Text = string.Format("Actual: {0} | Expected: {1} | Difference: {2}", actualLoss, expectedLoss, actualLoss-expectedLoss)
                });
            highchart.SetLegend(new Legend() {Enabled = false});
            return highchart.ToHtmlString();
        }
开发者ID:RC7502,项目名称:BitsmackGTWeb,代码行数:54,代码来源:ChartService.cs


注:本文中的DotNet.Highcharts.Highcharts.SetPane方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。