本文整理汇总了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();
}