0
我对WPF使用Visiblox图表V 2.1控件。Visiblox V 2.1日期时间轴格式问题
我有一个基于毫秒值的数据。
如何格式化visiblox日期时间轴,以便在图表轴上显示毫秒值?
在此先感谢。
我对WPF使用Visiblox图表V 2.1控件。Visiblox 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
}
}
我敢肯定有一个更优雅的方式传入你的单位并保持格式化,但这对我有用。
我可以告诉你这里是新的。如果这适用于您,请选择此作为接受的答案,并且如果有用,请选择upvote。 – NielW