如果仅仅是显示Y轴值的话,那很简单。但是现在我需要它显示DataSource绑定的表格中另外一个字段的值,不是Y轴绑定字段的值。
代码先写了一部分:
Series series1 = new Series(null, ViewType.Bar);
series1.DataSource = dt;
series1.ArgumentDataMember = "detail";
series1.ArgumentScaleType = ScaleType.Qualitative;
series1.ValueDataMembers.AddRange(new string[] { "average", "count" });
series1.ValueDataMembers[0] = "average";
series1.ValueDataMembers[1] = "count";
// ラベルの設定
series1.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
SideBySideBarSeriesLabel label = (SideBySideBarSeriesLabel)series1.Label;
label.Position = BarSeriesLabelPosition.Top;
label.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
label.LineVisibility = DevExpress.Utils.DefaultBoolean.False;
label.TextPattern = "n={V2}";
this.comparisonGraph.Series.Add(series1);
目前label显示的结果是n=0,取不到count的值。
急急急!!!