Asp.net charts-多个y值 [英] Asp.net charts- multiple y values

查看:232
本文介绍了Asp.net charts-多个y值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我想在该方法作为Y参数显示两个值的堆积条形图:

I have a stacked bar chart where I want to display two values for the Y parameter at the method :

public void DataBindXY(
    IEnumerable xValue,
    string xField,
    IEnumerable yValue,
    string yFields
)

我的问题是,我想有Y两值,而不是只有一个,如提及[MS文档] [1]

My problem is that I would like to have two values for Y and not just one, as mentioned at [MS documentation][1]

[1]: http://msdn.microsoft.com/en-美国/库/ dd488523.aspx ,我试图在yField参数的两个值推杆,而我不断收到您只能为这个数据点设置1 Y值参数名:y值

[1]: http://msdn.microsoft.com/en-us/library/dd488523.aspx , I tried putting at the yField parameter two values , and I am keep getting "You can only set 1 Y values for this data point. Parameter name: yValue"

这里是我的code的一个例子,而DV是带有三个参数的DataView对象,适用两个用于Y轴和适用于X轴之一:

here is an example of my code , while DV is a DataView object with three parameters, two applicable for Y axis and one applicable for X axis:

Points.DataBindXY(dv, "Xfield", dv, "Yfield1,Yfield2");

谢谢,大卫

推荐答案

我觉得你只需要让它知道你的需要系列2 Y值,所以只是尝试设置

I think you just need to make it aware that your series needs 2 Y values, so just try setting

Chart1.Series[0].YValuesPerPoint = 2;

但按照堆积图只允许一个单一的Y值每点。

But as per Stacked Chart it only allows a single Y value per point.

如果你正在寻找被堆叠起来的值,那么我认为你需要一系列的同等数​​量,只要你想那么这将被基于他们共同的X值呈现堆栈的数量。

In case you are looking for the values to be stacked up, then i think you would need equivalent number of series as the number of stacks you want which would then be rendered based upon their common X Values.

1系列 - > Xfield,Yfield1

Series 1 --> Xfield,Yfield1

2系列 - > Xfield,Yfield2

Series 2 --> Xfield,Yfield2

这篇关于Asp.net charts-多个y值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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