沿XAxis的位置注释 [英] Position Annotations Along XAxis

查看:84
本文介绍了沿XAxis的位置注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含3个系列的柱形图。 DrawSideBySide设置为false。我试图在* each *列的基础上为每列定位注释。我以为你会这样做:


I have a column chart with 3 series. DrawSideBySide is set to false.  I am trying to position annotations for each column at the base of *each* column. I thought you would do that like this:

         for (int i = 0; i < Chart1.Series[0].Points.Count; i++)
          {

              TextAnnotation annotation = new TextAnnotation();
              annotation.Text = "test"; 

              annotation.AxisX = Chart1.ChartAreas[0].AxisX;
              annotation.AxisY = Chart1.ChartAreas[0].AxisY;
              annotation.AnchorX = total.XValue;
              annotation.AnchorY = 20;

             Chart1.Annotations.Add(annotation);
           }


但是,这并没有将注释放在系列中每列的基础上。所以,似乎我必须使用annotation.SetAnchor();将注释绑定到数据点。这让我更接近,但这使得注释的Y值而不是0.实际上,我希望注释放在*列*的X值和Y值为0.任何想法?

谢谢!

However, that doesn't put the annotations at the base of each column in the series. So, it seems I have to tie the annotation to the datapoint using annotation.SetAnchor();  That gets me closer, but that puts the annotation's Y Value and not at 0. Essentially, i want the annotation to be placed at the X value of the *column* and a Y value of 0.  Any ideas??

Thanks!

推荐答案

Hi qingli

Hi qingli

你可以做一些类似于反转图表的事情,比如在Y轴上显示X轴值,反之亦然。并加上注释。

Can you do something like that reversing the chart like showing the X Axis value on Y Axis and vice a versa. and put the annotation.


这篇关于沿XAxis的位置注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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