Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Fill Area Between Two Lines with Different Colors Based on Line Intersection #5195

Open
phucdanghuu opened this issue Aug 22, 2024 · 0 comments

Comments

@phucdanghuu
Copy link

Hello,

I am trying to create a line chart using DGCharts where I need to fill the area between two lines with different colors based on which line is higher at any given point on the x-axis.

Details:
I have two data sets representing two lines on the chart.
My goal is to:
Fill the area between these two lines.

I’ve tried using a custom FillFormatter and overriding the fill logic, but I’ve encountered difficulties getting the correct areas to fill between the lines.
In my current implementation, the fill area doesn’t cover the space correctly, and sometimes it fills the wrong segments.

Question:
What would be the best approach to achieve this effect in DGCharts?
Are there any examples or best practices to follow for creating such a fill effect?

The screenshot is what I'm trying to do:
Simulator Screenshot - iPhone 15 Pro - 2024-08-22 at 10 41 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant