FlexChart: axisX label formatting, from OLE date to DateTime

Posted by: a.sharov on 18 November 2021, 1:25 pm EST

    • Post Options:
    • Link

    Posted 18 November 2021, 1:25 pm EST

    Hi.

    How can I format axisX labels given they are in OLE date format (double value) and I want to format them as datetime values? Smth like dd/MM/YY or similiart.

    I think Format property is not helpful here. Also flexchart events LabelRendering, LabelRendered events seems also of no use for this case.

    Thanks in advance.

  • Posted 22 November 2021, 6:20 am EST

    Hi Anton,

    Since, OLE values are of double type and hence FlexChart will not treat them as DataTime values. Therefore, the Format property won’t work in this case.

    However, you can add custom formatted labels for AxisX using its Binding and DataSource property as follows:

    
    flexChart.AxisX.Binding = "Value,FormattedLabel";
    flexChart.AxisX.DataSource = data.Select(x => new AxisLabel() // creating labels from x (OLE) values
    {
                   Value = x.X,
                   Format = "dd/MM/yy"
    });  
    
    

    Please refer to the same from the attached sample. (see FlexChartFormat.zip)

    Best Regards,

    Kartik

    FlexChartFormat.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels