imaNNeo / imaNNeo/fl_chart

Feature Request: Custom Widgets at Chart Corners in fl_chart

Open
#2,021 0 comments 0 reactions 0 assignees View on GitHub
enhancement Fundamental
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

`fl_chart` currently lacks a way to place custom widgets (e.g., icons, arrows, text) at the four corners of the chart area (LeftBottom, LeftTop, RightBottom, RightTop). This is useful for adding markers like arrowheads or labels to indicate axis direction or context in visualizations, especially for scientific or educational apps.

**Proposed Solution:**
Add a property to `FlBorderData` to place a custom `Widget` at each chart corner:
```dart
FlBorderData(
show: true,
cornerWidgets: {
ChartCorner.leftTop: Icon(Icons.arrow_upward, size: 12), // Top-left corner
ChartCorner.rightBottom: Text('Max'), // Bottom-right corner
},
),
```
Where `ChartCorner` is an enum: `{leftTop, leftBottom, rightTop, rightBottom}`. This ensures each corner is uniquely addressable, avoiding overlap or ambiguity between axes.

**Benefits:**
- Precise placement at chart corners, independent of axis overlaps.
- Supports responsive scaling and chart interactions (zoom/pan).
- Enables flexible customization for markers or annotations.

Contributor guide

Open the contributing guide

Research direction

Start by reading FlBorderData and tracing the chart layout entry point that consumes it. Define how a ChartCorner enum and per-corner custom Widgets fit the existing border and axis layout, then verify that all four corners can be addressed without ambiguity and remain usable with responsive scaling and chart interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.