We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Regarding Chart control LayoutCompleted Event

Hi All

I am using the syncfusion version 4.4.0.51 and my previuos version is 4.4.0.50

I am using the chart control layoutcompleted event for Setting the series location and series scale max and min value in previous version 4.4.0.50

Now i am updated syncfusion version 4.4.0.50 with 4.4.0.51 ,In that layoutcompleted event calling so may times and program throwing Stackoverflow exception

Below is the code i am calling in layoutcompleted event

"series.ChartSeries.YAxis.Location = new PointF(this.Chart.PrimaryYAxis.Location.X - offset, this.Chart.PrimaryYAxis.Location.Y);
series.ChartSeries.YAxis.Size = new SizeF(0, this.Chart.ChartArea.RenderBounds.Height);
series.ChartSeries.YAxis.Title = series.ChartSeries.Text;
offset += 60;

SetYAxisRange(series); "

private void SetYAxisRange(chartseries series)
{

ChartSeries chartSeries = series.ChartSeries;

if (series.YAxisMinValue == 0 &&
series.YAxisMaxValue == 0 &&
series.YAxisMinorScaleValue == 0 &&
series.YAxisMajorScaleValue == 0)
{
double max = double.MinValue, min = double.MaxValue;
for (int i = 0; i < chartSeries.Points.Count; i++)
{
ChartPoint cp = chartSeries.Points[i];
if (cp.YValues[0] > max)
max = cp.YValues[0];

if (cp.YValues[0] < min)
min = cp.YValues[0];
}
chartSeries.YAxis.RangeType = ChartAxisRangeType.Set;
chartSeries.YAxis.Range.Max = max + 1;
chartSeries.YAxis.Range.Min = min - 1;
chartSeries.YAxis.Range.Interval = (max - min + 2) / 10;
chartSeries.YAxis.Format = "#.###";
}
else
{
chartSeries.YAxis.RangeType = ChartAxisRangeType.Set;
chartSeries.YAxis.Range.Max = series.YAxisMaxValue;
chartSeries.YAxis.Range.Min = series.YAxisMinValue;
chartSeries.YAxis.Range.Interval = series.YAxisMajorScaleValue;
chartSeries.YAxis.SmallTicksPerInterval = (int)Math.Round((decimal)(series.YAxisMajorScaleValue / series.YAxisMinorScaleValue));
chartSeries.YAxis.Format = "#.###";
}
}

Please anyone help me....

Thanks and Regards
K.Sathishkumar





2 Replies

AD Administrator Syncfusion Team December 13, 2006 01:50 AM UTC

Hi Sathish,

I regret very much for my delayed response.

I am looking this issue and will get back to you with in a day.

Thanks for using Syncfusion products.

Sorry again.

Regards,
Sureshbabu


AD Administrator Syncfusion Team December 13, 2006 11:20 PM UTC

Hi Sathish,

Sorry for the inconvenience caused.

I am not able to reproduce this issue using the given code which is not enough. Please give me more information.

If possible send me a sample which reproduces this issue. It will helpful to solve this issue quickly.

Let me know if you have any questions.

Thanks for your patience.

Regards,
Sureshbabu

Loader.
Live Chat Icon For mobile
Up arrow icon