feat: candlestick chart support CandleMarkerPainter#2032
feat: candlestick chart support CandleMarkerPainter#2032artshooter wants to merge 1 commit intoimaNNeo:mainfrom
Conversation
|
@SAGARSURI |
| /// [spotIndex] is the index of the spot in the candlestickSpots list. | ||
| /// | ||
| /// Return true if you want to draw this marker on this spot, false otherwise. | ||
| bool shouldShow(CandlestickSpot spot, int spotIndex); |
There was a problem hiding this comment.
Do we actually need it? I think we can have an empty paint() implementation to not show anything.
This way simplifies the implementation
| } | ||
|
|
||
| /// Signal type enum for buy/sell markers. | ||
| enum BuyAndSellSignalType { |
There was a problem hiding this comment.
In my opinion, we should prevent defining domain-specific models inside the fl_chart. And it's better to keep things generic.
So I suggest removing it (and adding it inside the candlestick_chart_sample1.dart if you want), and here we can rename the BuyAndSellSignalPainter() to CandleBalloonTextPainter(). This way, it feels like a generic implementation of balloon text, and you can use it to show buy/sell in your implementation.
And the logic of CandleBalloonTextPainter() will be way simpler, and the complexity goes into the candlestick_chart_sample1.dart where you want to show sell/buy points.
| /// For example, buy/sell signal markers, important point markers, etc. | ||
| /// If null, no markers will be drawn. | ||
| /// You can use the built-in [BuySellSignalMarkerPainter] or implement your own. | ||
| final CandleMarkerPainter? candleMarkerPainter; |
There was a problem hiding this comment.
What do you think if we allow users to have a list of CandleMarkerPainter?
This way, we can let the user compose different marker painters to render on top of each other.

Hi, I've made improvements and refinements based on the feedback from the previous PR.
Feature Summary
This PR adds a candle marker system to CandlestickChart for marking trading signals on candlestick charts.
Key Features:
customizable bubble styles and labels to easily extend various trading signal scenarios