imaNNeo / imaNNeo/fl_chart

Ability to set different colors for parts of the line from a line chart

Open
#1,603 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Line Chart
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

I want to be able to set different colors for different sections of a line from a line chart. For example, I want to have a red line from spots 1 to 10, a blue line from spots 10 to 40 etc.

Right now I can only set one single color or a gradient for the entire line. Is there a more low-level way of achieving what I need?

How I see this working is having a colors param that is the same length as the spots list and contains a color for each spot.

![Screenshot 2024-03-09 at 11 29 02](https://github.com/imaNNeo/fl_chart/assets/18688/12fd3e9e-357b-44b4-a925-50d52531d905)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the line-chart API and the existing single-color or gradient configuration. Trace how spots are rendered into line sections and define how per-spot colors should affect the requested ranges. Done means distinct sections can use distinct colors while existing single-color and gradient behavior continues to work, with coverage for the requested ranges.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
data-visualization
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.