我需要格式化 BarItem 内的标签,以便它可以具有时间格式,例如 00:10。我正在使用 BarSeries.Format 函数,但如果我不使用 BarSeries.LabelFormatString 则标签不会显示,如果我使用 LabelFormatString 所有标签将具有相同的格式/值。
这是我的代码:
BarItem baritem = new BarItem {Value = 10}; //in seconds
Object[] time = new object[2];
time [0] = "00";
time [1] = "10";
barSeries.Format("{0}:{1}",baritem,time);
使用此代码,它不会显示任何标签。使用barSeries.LabelFormatString = "{0}"
显示 10。
我试过barSeries.LabelFormatString = barSeries.Format("{0}:{1}",baritem,time)
了,但后来所有的标签都一样了......