Search code examples
c#winformsmschart

MSChart: Setting Chart.ChartAreas[0].AxisX.Minimum to a floating point number


Problem in details is that:

Setting Chart.ChartAreas[0].AxisX.Minimum = 7.51 (in a separate thread (I have tried to set in the same UI thread as well)) is displayed as 7.00!

During debugging the code; value of AxisX.Minimum is successfully set to to 7.51 but right after entering the "Empty" Chart_PrePaint() event handler it is turned to 7.00 and remains 7!

Any information about this issue?


Solution

  • Finally I was able to detect the cause of the problem:

    ChartValueType.Int64 was the XValueType of the axis, changing it to ChartValueType.Single solved the problem.

    Thanks for help.