Hi
If you drop an FNC Chart and a button on a form and then put the following code in the button on click event:
procedure TForm1.Button1Click(Sender: TObject);vari : integer;beginChart.BeginUpdate;Chart.Series[0].YValues.AutoUnits := false;Chart.Series[0].YValues.MajorUnitSpacing := 1.0; // not required to generate errorfor i := 0 to Chart.Series.Count-1 doChart.Series.Points.Clear;Chart.EndUpdate;end;
When you call Chart.EndUpdate you get a divide by zero error.
The error happens on line 4014 of VCL.TMSFNCChart.pas because "max" is zero
dv.ValueRadius := PointF((pr.Bottom - pr.Top) / max * JMax / 2, (pr.Bottom - pr.Top) / max * JMax / 2);
Changing the AutoUnits to true avoids the error so I can get around this but setting it to true when I clear and then back to false when I add a point is a bit clunky and causes me difficulties if it started false (i.e. I have to track for each series in each chart...)
Hope you can help/explain so I can get around this more eloquently.
Cheers,
Mark