首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Visiblox V2.1 DateTime轴格式问题

Visiblox V2.1 DateTime轴格式问题
EN

Stack Overflow用户
提问于 2013-06-20 18:15:21
回答 1查看 238关注 0票数 0

我使用的是WPF的Visiblox Chart V2.1控件。

我有一个基于毫秒值的数据。

如何设置visiblox DateTime轴的格式,以便在图表轴上显示毫秒值?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-06-23 00:54:13

我用LinearAxis做了类似的事情。您必须创建自己的轴,该轴继承自DateTimeAxis。我不知道你的情况会有多大的不同,但以下是我为LinearAxis所做的:

代码语言:javascript
复制
chart.XAxis = new IRLinearAxis()
        {
            ...
            ShowLabels = true,
            LabelFormatString = "feet",//This only works because I overrode the format function in the IRLinearAxis class

        };

还有这个类:

代码语言:javascript
复制
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
    }

}

我相信有一种更优雅的方式来传递你的单元,并保持格式,但这对我很有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17211064

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档