【发布时间】:2013-08-11 04:47:57
【问题描述】:
我正在尝试使用 vb.net 自定义线性超图 X 轴的系列标签。
我查看了documentation from Infragistics,发现我可以使用这个代码:
UltraChart.Axis.Y.Labels.SeriesLabels.FormatString = "<Item_Label>"
可以查看可用标签类型的说明here。 但是,我没有得到预期的结果。我得到 "Row#1",我只想得到 "1"。
我已经尝试过 Infragistics 论坛中this post 的第一个回复中使用的方法,其中包括使用带有自定义标签的哈希表。那里使用的代码如下(在 C# 中):
Hashtable labelHash = new Hashtable();
labelHash.Add("CUSTOM", new MyLabelRenderer());
ultraChart1.LabelHash = labelHash;
xAxis.Labels.ItemFormatString = "<CUSTOM>";
public class MyLabelRenderer : IRenderLabel
{
public string ToString(Hashtable context)
{
string label = (string)context["ITEM_LABEL"];
int row = (int)context["DATA_ROW"];
int col = (int)context["DATA_COLUMN"];
//use row, col, current label's text or other info inside the context to get the axis label.
//the string returned here will replace the current label.
return label;
}
}
这种方法也不起作用。 我正在使用 Infragistics NetAdvantage 2011.1。
有人知道如何自定义这些标签以获得“Row#”之后的数字吗?
【问题讨论】:
标签: vb.net infragistics