sudidela Posted February 25, 2009 Report Share Posted February 25, 2009 When i have to use Chart.Refresh(); We have implemented Custom Zoom where in we take the coordinates of the area that is selected for Zoom and create the rectangle using the coordinates.The created rectangle is sent as a argument for Chart.ZoomToWindow(Rectangle.Left, Rectangle.Top,Rectangle.Right, Rectangle.Bottom); double dblmin = 0; double dblMax = 0;cfxBaseChart.AxisX.GetScrollView(out dblmin, out dblMax); DateTime dtStartDate;DateTime dtEndDate; dtStartDate = DateTime.FromOADate(dblmin);dtEndDate = DateTime.FromOADate(dblMax); TimeSpan ts = dtEndDate.Subtract(dtStartDate);Chart.AxisX.Step = (1 * (int)ts.TotalHours) / (24.0 * 6.0); Chart.AxisX.Zoom(dblmin, dblMax); foreach (AxisY axisY in cfxBaseChart.AxesY) { double dblmin = 0;double dblMax = 0;axisY.GetScrollView(out dblmin, out dblMax); axisY.Step = (dblMax - dblmin) / 10; axisY.Zoom(dblmin, dblMax); } After that Chart.Refresh() is used.. But After zoom, scales are not getting refreshed. And because of this, if we scroll the axis at that instant, application will crash. Quote Link to comment Share on other sites More sharing options...
RandyJ Posted February 27, 2009 Report Share Posted February 27, 2009 Hi, Is the AutoScale property enabled? When it is enabled, Chart FX recalculates the scale values according to the data set. Additionally, please note that if you preset any of the scale values (Min, Max, Step or MinorStep) Chart FX will not recalculate the scale when new data is sent to the chart.However, this behavior can be altered by invoking the AxisY ResetScale method. This method recalculates scale values associated to that specific numerical axis. If you want to recalculate ALL numerical axes settings, the Chart exposes a method called RecalculateScale. Please keep in mind that RecalcScale method applies to ALL numerical axes and reads the entire data array. In other words, you should avoid calling this method repeatedly as it will adversely affect the performance of your application. Regards,Randy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.