fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

Add shadow for Pie Chart

Open samir7osny opened this issue 1 year ago • 7 comments

This adds the drop shadow to the Pie Chart with some cool customizations

  1. You can add simply a drop shadow like this (check the pie chart sample 4 here) image

  2. Also you can simulate the third dimension like this (check the pie chart sample 5 here) image

solves #1482

samir7osny avatar Nov 21 '23 21:11 samir7osny

Codecov Report

Attention: Patch coverage is 9.25926% with 49 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@0ae88cf). Learn more about missing BASE report.

Files Patch % Lines
lib/src/chart/pie_chart/pie_chart_painter.dart 9.25% 49 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1497   +/-   ##
=======================================
  Coverage        ?   85.34%           
=======================================
  Files           ?       45           
  Lines           ?     3078           
  Branches        ?        0           
=======================================
  Hits            ?     2627           
  Misses          ?      451           
  Partials        ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 24 '23 18:11 codecov[bot]

It seems there is an issue, it freezes the app (tested on iPhone and macOS)

imaNNeo avatar Nov 24 '23 19:11 imaNNeo

It seems there is an issue, it freezes the app (tested on iPhone and macOS)

Can you test again? I changed the number of layers to be drawn, it should fix this issue.

samir7osny avatar Nov 25 '23 01:11 samir7osny

Tested on iPhone 15 Pro and simulator on MacBook Pro (2023). Seems to work now!

Simulator Screenshot - iPhone 15 Pro - 2023-11-25 at 19 59 39

3DExtended avatar Nov 25 '23 19:11 3DExtended

Okay, I found the freeze issue, if you change the offset to Offset(0, 0), it freezes the app process (it seems a low-level exception happens)

imaNNeo avatar Dec 01 '23 00:12 imaNNeo

Please update the pie_chart.md and base_chart.md docs. Also please write some unit-tests. Read more about the contributing guideline here

imaNNeo avatar Dec 01 '23 00:12 imaNNeo

Also, please use different style/color/value for the new charts. You just copy-pasted the sample1 and they look exactly the same except the shadow. It doesn't feel good to see some duplicate charts. You can combine the sample 4 and 5 together and add some options to change the shadow style (it helps users/developers to understand how it works). For example you can add a slider to allow user/developer to increase the shadow layers, offset, ... Or when you hover/touch it, instead of adding stroke radius, you can increase/decrease the shadow.

image

imaNNeo avatar Dec 01 '23 00:12 imaNNeo