我已经使用Kendo ui创建了一个Stacked条形图,在这里:http://jsfiddle.net/Came19xx/t06zq2nr/4/
我的问题是图表不是按顺序放置值。 在我的数据源中,我有一个" open"和"暂停"价值,就像那样:
var data2 = [{"name":"abc","num":1,"state":"open"},
{"name":"abc","num":1,"state":"suspended"},
{"name":"def","num":2,"state":"open"},
{"name":"def","num":5,"state":"suspended"},
{"name":"ghi","num":3,"state":"open"},
{"name":"ghi","num":21,"state":"suspended"},
{"name":"jkl","num":4,"state":"open"},
{"name":"jkl","num":9,"state":"suspended"},
{"name":"mno","num":5,"state":"open"},
{"name":"mno","num":5,"state":"suspended"},
{"name":"pqr","num":6,"state":"open"},
{"name":"pqr","num":14,"state":"suspended"},
{"name":"stu","num":7,"state":"open"},
{"name":"stu","num":6,"state":"suspended"},
{"name":"vwxyz","num":8,"state":"open"},
{"name":"vwxyz","num":5,"state":"suspended"}];
所以我按状态分组数据源,但是我没有获得与条形图上的名称对应的开放值,我无法按名称对其进行排序,因为它将停止工作。
例如,我希望abc在第一行,堆叠条的左侧(橙色)为1,右侧为2(红色),而是使用正确的暂停值(5)获得vwxyz )和错误的开放值(3而不是8)
""名称"字段和" num"字段可能会改变它们的价值。