Page 1 of 1

BoxPlot Initial Paint seems to be wrong

Posted: Fri Sep 11, 2020 2:56 pm
by 16488761
Hello,

If I add some values for a BoxPlot series , where the minimum is grater than 0, the BoxPlot is not painted correctly for the first time.
If I move around with the mouse, the scale and painting is fixed. (then the Chart repaints itself)

e.g:

Code: Select all

  for I:=0 to 30 do begin
    self.Series1.Add(I+100);
  end;
.Repaint .Invalidate does not solve this issue.

Do You know any workaround to get rid of this problem?

Thanks in advance:
MicroSolutions

Re: BoxPlot Initial Paint seems to be wrong

Posted: Wed Sep 16, 2020 6:13 am
by yeray
Hello,

Try forcing a repaint calling Chart1.Draw;.

Re: BoxPlot Initial Paint seems to be wrong

Posted: Thu Sep 17, 2020 11:39 am
by 16488761
Hello,

Thx for the answer, but unfortunately it does not seems to work.
What is very interesting, if I call Chart.Draw in a separate function, it works.
If I call Chart.Draw directly after adding the values, it does not work.

Any Idea?
Can You reproduce the issue on Your side?

Regards:
MicroSolutions

Re: BoxPlot Initial Paint seems to be wrong

Posted: Fri Sep 18, 2020 5:29 am
by yeray
Hello,

No I can't reproduce it. Could you please arrange a simple example project we can run as-is here?
Thanks in advance.

Re: BoxPlot Initial Paint seems to be wrong

Posted: Fri Sep 18, 2020 9:10 am
by 16488761
Hello,

Sure.
I have attached a simple project.

Best Regards:
MicroSolutions

Re: BoxPlot Initial Paint seems to be wrong

Posted: Tue Sep 29, 2020 7:47 am
by yeray
Hello,

You are right, Chart1.Draw isn't enough with this kind of series because this series min and max doesn't correspond to the y values min and max. It needs Series1.RecalcStats to be called instead.

Re: BoxPlot Initial Paint seems to be wrong

Posted: Wed Sep 30, 2020 7:59 am
by 16488761
Yes, Series1.RecalcStats did the trick!
Thank You!