Visiblox V 2.1 DateTime axis format issue

257 views Asked by At

I am using Visiblox Chart V 2.1 control for WPF.

I have a data based on millisecond value.

How can i format visiblox DateTime axis such that i will show millisecond value on chart axis?

thanks in advance.

1

There are 1 answers

1
NielW On

I did something similar with a LinearAxis. You have to create your own axis that inherits from DateTimeAxis. I don't know how different it will be for your case, but here's what I did for a LinearAxis:

chart.XAxis = new IRLinearAxis()
        {
            ...
            ShowLabels = true,
            LabelFormatString = "feet",//This only works because I overrode the format function in the IRLinearAxis class

        };

And the 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
    }

}

I'm sure there's a more elegant way to pass in your units AND keep the formatting as well, but this worked for me.