imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.87k stars 1.78k forks source link

Dynamically changing tooltipBgColor #1595

Closed xvrh closed 7 months ago

xvrh commented 8 months ago

This PR is to replace this one: https://github.com/imaNNeo/fl_chart/pull/1348.

All credits goes to @apekshamehta

Original description:

Changes Made:

In the bar_chart_data.dart file:

Added a new parameter getTooltipColor to the constructor of BarTouchTooltipData. Defined a new type GetBarTooltipColor, which is a function that takes a BarChartGroupData parameter and returns a Color. In the bar_chart_painter.dart file:

Assigned the tooltip color to the _bgTouchTooltipPaint.color property using the getTooltipColor function from the tooltipData object. Additionally, the getTooltipColor function has been utilized in the bar_chart_sample1.dart file within the feature/dynamic-tooltip-bgcolor branch.

Please review the changes for this pull request.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.52%. Comparing base (34a6af0) to head (526c16a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1595 +/- ## ========================================== + Coverage 87.51% 87.52% +0.01% ========================================== Files 45 45 Lines 3075 3078 +3 ========================================== + Hits 2691 2694 +3 Misses 384 384 ```

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

imaNNeo commented 7 months ago

There are some minor changes. Please fix them, then It is ready to be merged!

imaNNeo commented 7 months ago

Thanks for your quick response and action! I hope to see more from you xD