fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

feat: Add extraLinesData support to CandlestickChart

Open owenmoon1 opened this issue 4 months ago • 3 comments

Feature: Add extraLinesData support to CandlestickChart

Adds extraLinesData support to the CandlestickChart, implementing the same functionality available in LineChart.

Changes:

  • ✅ Added extraLinesData parameter to CandlestickChartData
  • ✅ Updated painter to draw horizontal and vertical extra lines
  • ✅ Added equality tests for the new functionality
  • ✅ Updated example app with median price line demonstration
  • ✅ Updated CHANGELOG.md

Use Case:

This feature enables traders and developers to draw reference lines on candlestick charts, such as:

  • Support/Resistance levels
  • Moving averages
  • Median prices
  • Any custom horizontal or vertical reference lines

Example:

See the updated candlestick_chart_sample1.dart for a working example showing a yellow median price line across Bitcoin prices.

Testing:

  • ✅ All 564 tests passing
  • ✅ No linter errors
  • ✅ Code properly formatted

owenmoon1 avatar Oct 09 '25 16:10 owenmoon1

Thanks, Owen, it already looks good to me. Can you please update our candlestick_chart.md file to add the new property there?

imaNNeo avatar Oct 25 '25 22:10 imaNNeo

Codecov Report

:x: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 92.47%. Comparing base (32e75f5) to head (808c5a8).

Files with missing lines Patch % Lines
...t/candlestick_chart/candlestick_chart_painter.dart 75.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2016      +/-   ##
==========================================
- Coverage   92.49%   92.47%   -0.02%     
==========================================
  Files          50       50              
  Lines        3731     3735       +4     
==========================================
+ Hits         3451     3454       +3     
- Misses        280      281       +1     
Flag Coverage Δ
flutter 92.47% <75.00%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

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

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 25 '25 22:10 codecov[bot]

Can you please add the unit tests for the new changes?

imaNNeo avatar Oct 26 '25 19:10 imaNNeo