RangeColumn图表-显示条形值,而不是高值. [英] RangeColumn chart - Display bar value rather than high value.

查看:124
本文介绍了RangeColumn图表-显示条形值,而不是高值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个RangeColumn图表.一切都很好,除了所有标签都显示出很高的价值.我们需要显示的是酒吧的价值.我们如何实现呢?

I have created a RangeColumn chart. Everything is fine except all labels are showing high values.  What we need to display is the bar's value. How can we achieve it?

我们现在得到的结果是-

The result we are getting now is -

https://social.msdn.microsoft.com/Forums/getfile/952831

https://social.msdn.microsoft.com/Forums/getfile/952831

我们试图达到的结果是-

The result we are trying to achieve is -

https://social.msdn.microsoft.com/Forums/getfile/952832

https://social.msdn.microsoft.com/Forums/getfile/952832

推荐答案

我找到了解决方案.我们可以使用TextAnnotation类来实现这一目的.

I have found the solution. We can use TextAnnotation class to achieve this.


TextAnnotation a = default(TextAnnotation);            

for (int i = 0; i < chart1.Series[0].Points.Count; i++)            
{                
a = new TextAnnotation();                
a.AxisX = chart1.ChartAreas[0].AxisX;                a.AxisY = chart1.ChartAreas[0].AxisY;                a.AnchorX = chart1.Series[0].Points[i].XValue;                
a.AnchorY = chart1.Series[0].Points[i].YValues[0];                
a.AnchorAlignment = ContentAlignment.TopCenter;                a.Text = "


" +(chart1.Series [0] .Points [i] .YValues [0]- chart1.Series [0] .Points [i] .YValues [1]).ToString();    //dp.YValues [0] .ToString(); chart1.Annotations.Add(a);              }
" + (chart1.Series[0].Points[i].YValues[0] - chart1.Series[0].Points[i].YValues[1]).ToString();    //dp.YValues[0].ToString();                chart1.Annotations.Add(a);                }



这篇关于RangeColumn图表-显示条形值,而不是高值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆