我有关于图表列顺序的错误 [英] I have an error about chart columns order

查看:192
本文介绍了我有关于图表列顺序的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

       for(chr=0;chr<10;chr++)
     {
      //some definitions and calculations here
       chrisim[chr] = lst.Columns[chr].Text;
       chrdeger[chr] = ((temp1 + temp3) * 100) / chrdeger[chr];
            if (chrisim[chr].Contains("/3")) chart15.Series["1.Çeyrek Net Kârı"].Points.AddXY(chrisim[chr], chrdeger[chr]);
            if (chrisim[chr].Contains("/6")) chart15.Series["2.Çeyrek Net Kârı"].Points.AddXY(chrisim[chr], chrdeger[chr] - temp);
            if (chrisim[chr].Contains("/9")) chart15.Series["3.Çeyrek Net Kârı"].Points.AddXY(chrisim[chr], chrdeger[chr] - temp);
            if (chrisim[chr].Contains("/12")) chart15.Series["4.Çeyrek Net Kârı"].Points.AddXY(chrisim[chr], chrdeger[chr] - temp);

    }

chrisim是字符串数组,chrdeger数组。

"chrisim" is string array and "chrdeger" is double array.

我的问题是,当我在图表上写数据时,它没有命令是我的发送。例如当我发送一个数据到图表这里是图片(蓝色列是2013/03。

my problem is, when I write data on chart, it has not order which is my sending. for example when I send one data to chart here is the picture(blue column is "2013/03".

然后我发送第二个数据(黄色列是2012/12:

then I am sending the second data(yellow column is "2012/12":

到目前为止,一切正常。

everything is normal so far.

但是,当我发送第三个数据(红色列是2012/09)时,

but,


列的顺序在这里不正确你看到第三个picture.red列应该有黄色的权利。

the order of columns is wrong here as you see the third picture.red column should have the right of yellow.

我要在发送数据时订购这些

I want to order these as I send data

2013 / 03,2012 / 12,2012 / 09,2012 / 06,2012 / 03 ..

2013/03,2012/12,2012/09,2012/06,2012/03..

这是什么原因?

推荐答案

为什么你需要4个系列?根据我的理解,你需要一个列表(x,y)值,其中x是日期(年/月),y是双精度值。现在,一旦您正确填充此列表,您应该将其作为图表中的系列的数据源。现在,柱形图将按年的递增顺序显示值。这是你想要的吗?

Why do you need 4 series? As far as I can understand, you need a list of (x, y) values where x is a date (year/month) and y is a double value. Now once you have this list populated correctly, you should give it as the data source for a series in the chart. Now the column chart will show the values in the increasing order of the year. Is this what you want?

此外,我不明白是你的声明
我的问题是,当我在图表上写数据,它没有命令是我的发送。
为什么图表按照数据点添加的顺序显示数据。数据点将显示在图表的2D空间中的正确位置,而不是按照它们添加到图表的顺序显示。

Moreover what i didnt understand is your statement "my problem is, when I write data on chart, it has not order which is my sending." Why should a chart show data in the order that the data points are added. The data points will be shown at their correct position in the 2D space of the chart and not in the order in which they were added to the chart.

这篇关于我有关于图表列顺序的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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