I have the requirement to generate the Charts Y Axis manually on some conditions. Code below:
double maxValue = myRadChart.DefaultView.ChartArea.AxisY.ActualMaxValue;
myRadChart.DefaultView.ChartArea.AxisY.AutoRange = true;
if (maxValue <= avg_weekly_budget)
myRadChart.DefaultView.ChartArea.AxisY.AutoRange = false;
myRadChart.DefaultView.ChartArea.AxisY.MinValue = 0;
myRadChart.DefaultView.ChartArea.AxisY.MaxValue = Math.Floor(avg_weekly_budget);
myRadChart.DefaultView.ChartArea.AxisY.Step = avg_weekly_budget/10;
I'm binding the chart before above code with my data and want to retrieve the MaxValue from it, If the MaxValue is greater than some value, i want to draw thw chart manually..
This ActualMaxValue does not always give me the latest value. It seems like charts is getting created on another thread. However if I put the breakpoint, I could see latest value always, probably because of the delay.
How can I make sure that value I have got is the latest one.
I can always get the max value from my data, but I don't want to dependent on it.