问题描述
我想让y轴上的值显示为百分比,在C#中上下文。我的代码:
this 。chart.ChartAreas [0] .AxisX.Title =
" Year" ;
此 。chart.ChartAreas [0] .AxisY.Title =
" Percentage" ;
系列 curSerie =
此 。chartReturningRunners.Series.Add(" myName");
curSerie.Label = "#PERCENT" ; //不做诀窍,让积分显示
为百分比,而不是y轴值
curSerie.ChartType = System.Windows.Forms.DataVisualization.Charting。
SeriesChartType 。行;
curSerie.Points.AddXY(2010,20); // y显示20% -axis,但是如何......
curSerie.Points.AddXY(2011,40); //在y轴上显示40%,但是如何...
我希望有人能指出我正确的方向。此外,知道在哪里搜索简单的答案会很棒这样的问题。我查看了Microsoft Charts Add-On帮助文件,但这完全没用......; - (
Hi,
I want to have the values on the y-axis shown as percentage, in a C# context. My code:
this.chart.ChartAreas[0].AxisX.Title ="Year";
this.chart.ChartAreas[0].AxisY.Title ="Percentage";
Series curSerie =this.chartReturningRunners.Series.Add("myName");
curSerie.Label = "#PERCENT"; // does not do the trick, makes the points show as percentage, not the y-axis values
curSerie.ChartType = System.Windows.Forms.DataVisualization.Charting.
SeriesChartType.Line;
curSerie.Points.AddXY(2010, 20); // 20% shown on y-axis, but how...
curSerie.Points.AddXY(2011, 40);// 40% shown on y-axis, but how...
I hope someone can point me in the right direction. Also, it would be great to know where to search for answer to simple questions like this. I looked in the Microsoft Charts Add-On help-file but that is totally useless ... ;-(
这篇关于如何在Y轴上获得百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!