-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Is your feature request related to a problem? Please describe.
Currently, fl_chart only supports basic geometric shapes (circle, square, cross) for dot markers on line charts through FlDotCirclePainter, FlDotSquarePainter, and FlDotCrossPainter.
However, many use cases require custom visual markers such as:
- User profile pictures on activity charts
- Product icons on sales trend charts
- Custom branded icons for different data series
- Weather icons on temperature charts
There's no built-in way to use custom images as dot markers, forcing developers to either:
- Use the limited geometric shapes
- Implement complex custom painters from scratch
- Use workarounds that don't integrate well with the existing dot system
Describe the solution you'd like
I propose adding a FlDotImagePainter class that extends FlDotPainter to support rendering custom images as dot markers.
Proposed API:
// Load image asynchronously
final image = await FlDotImagePainter.loadImageFromAsset('assets/icon.png');
final painter = FlDotImagePainter(image: image, size: 20.0);
// Use in chart
LineChart(
LineChartData(
lineBarsData: [
LineChartBarData(
dotData: FlDotData(
show: true,
getDotPainter: (spot, percent, barData, index) => painter,
),
),
],
),
)injae-kiminjae-kiminjae-kim
Metadata
Metadata
Assignees
Labels
No labels