fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

Access to RangeAnnotation coordinates

Open Dnathan33 opened this issue 2 years ago • 4 comments

Feature Request Feature that provides access to the coordinates of the annotations drawn on the chart (RangeAnnotations). The current implementation of RangeAnnotations simply draws a colored container on the chart. This restricts how various applications would like to display annotations. Getting access to the annotation coordinates allows for custom annotations to be drawn.

Describe the solution you'd like A callback function that retrieves the list of annotation coordinates used to draw the annotation container on the chart. The following PR#970 implements the solution.

Additional context Here are some use cases where getting access to the RangeAnnotation coordinates can help in rendering custom annotations. The following was implemented with the changes made on this PR#970

Screen Shot 2022-04-04 at 9 12 06 AM Screen Shot 2022-04-04 at 9 12 28 AM

Dnathan33 avatar Apr 04 '22 16:04 Dnathan33

Hey @imaNNeoFighT, I'd appreciate your thoughts on this and PR request.

Dnathan33 avatar Apr 08 '22 16:04 Dnathan33

@Dnathan33 I didn't understand the problem. Where are the custom annotations in your samples?

imaNNeo avatar Apr 09 '22 20:04 imaNNeo

@imaNNeoFighT The custom annotations are drawn under the charts as seen in the images attached above |_____|. The custom annotation is drawn from the Offset coordinates returned.

I have added a sample chart that makes use of the coordinates to draw a custom annotation. Please, look at the attached image and /line_chart_sample11.dart for further details.

Simulator Screen Shot - iPhone 13 - 2022-05-12 at 10 48 40

Dnathan33 avatar May 12 '22 17:05 Dnathan33

cc @imaNNeoFighT

Dnathan33 avatar Jun 09 '22 18:06 Dnathan33