我使用的是WPF的Visiblox Chart V2.1控件。
我有一个基于毫秒值的数据。
如何设置visiblox DateTime轴的格式,以便在图表轴上显示毫秒值?
提前谢谢。
发布于 2013-06-23 00:54:13
我用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
}
}我相信有一种更优雅的方式来传递你的单元,并保持格式,但这对我很有效。
https://stackoverflow.com/questions/17211064
复制相似问题