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?
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](https://github.com/user-attachments/assets/c6ce8055-8121-4965-98c5-00f00622dca4)