【发布时间】:2013-06-20 10:15:20
【问题描述】:
我正在为 WPF 使用 Visiblox Chart V 2.1 控件。
我有一个基于毫秒值的数据。
如何格式化 visiblox 日期时间轴,以便在图表轴上显示毫秒值?
提前致谢。
【问题讨论】:
我正在为 WPF 使用 Visiblox Chart V 2.1 控件。
我有一个基于毫秒值的数据。
如何格式化 visiblox 日期时间轴,以便在图表轴上显示毫秒值?
提前致谢。
【问题讨论】:
我对 LinearAxis 做了类似的事情。您必须创建自己的轴,该轴继承自 DateTimeAxis。我不知道你的情况会有多大不同,但这是我为 LinearAxis 所做的:
chart.XAxis = new IRLinearAxis()
{
...
ShowLabels = true,
LabelFormatString = "feet",//This only works because I overrode the format function in the IRLinearAxis class
};
还有班级:
class IRLinearAxis : LinearAxis
{
protected override string GetFormattedDataValueInternal(double dataValue, string formatString)
{
return String.Format("{0} " + formatString, base.GetFormattedDataValueInternal(dataValue, ""));//ignore the formatString and just use the units that were passed as the formatString
}
}
我确信有一种更优雅的方式来传递你的单位并保持格式,但这对我有用。
【讨论】: