Flexchart datetime to double

Posted by: remy.schorkops on 13 March 2023, 12:26 am EST

    • Post Options:
    • Link

    Posted 13 March 2023, 12:26 am EST

    I am working with Flexchart from WPF library.

    Chart properties (min, max, …) are always in double but my datas are timebased.

    i am getting position from mouse mouve

    chart.AddHandler(FlexChart.MouseMoveEvent, new MouseEventHandler(flexChart_MouseMove), true);

    and i would like to get x as datetime

    how to convert datetime type to double ?

  • Posted 14 March 2023, 2:35 pm EST

    Hi Remy,

    You can convert the DateType data to double type by using the DateTime.ToOADate() method and set its value to the x-axis of the flexchart as shown in the following code:

    DateTime date = new DateTime(2020, 5, 20);
    flexChart.AxisX.Min = date.ToOADate();

    Kindly refer to the attached sample for full implementation. (See DateTimeAxisToDouble.zip)

    Please let us know if you have any further concerns.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels