Recent

Author Topic: Problem with PieChart  (Read 2322 times)

bigeno

  • Full Member
  • ***
  • Posts: 231
Re: Problem with PieChart
« Reply #15 on: March 23, 2019, 08:40:42 pm »
Nice, now I can clean up my code and use OnDrawPie. :) working...

wp

  • Hero Member
  • *****
  • Posts: 5636
Re: Problem with PieChart
« Reply #16 on: March 24, 2019, 12:22:49 am »
I changed my mind and renamed the new event to OnCustomDrawPie, sorry. I want all custom-draw events having a drawer as parameter to be named alike. I also added an event OnCustomDrawBar to TBarSeries, and deprecated the old OnBeforeDrawBar (which required a canvas as parameter). TAChart is not very consistent in using a drawer or a canvas as parameters in custom-draw events - by and by I want to remove the events having a canvas.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

wp

  • Hero Member
  • *****
  • Posts: 5636
Re: Problem with PieChart
« Reply #17 on: March 24, 2019, 12:26:20 am »
Nice, now I can clean up my code and use OnDrawPie. :) working...
Very nice pie charts! If you could post the event handlers used for such charts I would add it to one of the TAChart demos (I don't have much experience with BGRABitmap).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

bigeno

  • Full Member
  • ***
  • Posts: 231
Re: Problem with PieChart
« Reply #18 on: March 24, 2019, 11:31:31 am »
Can you also add OnCustomDrawPie for ADrawer.RadialPie ? need spTop data also when FInnerRadiusPercent = 0. (line 653).

wp

  • Hero Member
  • *****
  • Posts: 5636
Re: Problem with PieChart
« Reply #19 on: March 24, 2019, 11:40:29 am »
Sorry, I thought I had done that... Try the new revision.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

bigeno

  • Full Member
  • ***
  • Posts: 231
Re: Problem with PieChart
« Reply #20 on: March 24, 2019, 08:47:28 pm »
Attached modified your radial demo.
Thats simple demo without range checking on APoints etc.
For now its gradient based on Prev and Next angle for every slice, first color for gradient get from series, second always white. Added required package BGRABitmapPack.
Oh, Radius property of TCustomPieSeries need to be public. Please check the code.

JD

  • Hero Member
  • *****
  • Posts: 1755
Re: Problem with PieChart
« Reply #21 on: March 30, 2019, 08:47:13 am »
Hi there wp,

Wonderful work, as usual. Thanks a lot. Will this trunk version work with Lazarus 2.0 release version?

Cheers,

JD
Windows (10, 7) - Lazarus 2.0RC3/FPC 3.2, NewPascal, Delphi

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

wp

  • Hero Member
  • *****
  • Posts: 5636
Re: Problem with PieChart
« Reply #22 on: March 30, 2019, 12:01:45 pm »
No, not suitable for v2.0-fixes due to lots of new features.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10