react-native-charts-wrapper icon indicating copy to clipboard operation
react-native-charts-wrapper copied to clipboard

How to fill line chart curves below and above limit lines?

Open sallar opened this issue 4 years ago • 9 comments

Hi,

Sorry for submitting a question here, I know this is not exactly an issue, but I couldn't find what I want in the documentation or code.

I want to fill in the curves of a line chart, below and above the limit lines. For example see this image:

IMG_0034

I need to fill in the curve below the red dots (areas indicated with red arrow) with red color, and the curves between those red dots with green color (areas indicated with green arrow)

So the results would look like this. Sorry for my artistic skills :D

IMG_0035

Is there a way to do this? Thank you so much for the great work.

sallar avatar Apr 24 '20 15:04 sallar

@sallar One question, how you show the limit Lines on the Chart?

crisecheverria avatar Sep 04 '20 10:09 crisecheverria

@crisecheverria using the limitLines array

sallar avatar Sep 04 '20 10:09 sallar

@sallar Thanks for the response, where do you specify that?

Edit: Added, is on the yAxis.

crisecheverria avatar Sep 04 '20 11:09 crisecheverria

@crisecheverria sorry I was too late. yes I was about to comment that it's on xAxis and yAxis. I have value limits on yAxis and date limit on xAxis

sallar avatar Sep 04 '20 11:09 sallar

@sallar Did you manage to solve your issue? It looks like a pretty nice feature.

crisecheverria avatar Sep 04 '20 13:09 crisecheverria

@crisecheverria unfortunately not... :(

sallar avatar Sep 04 '20 13:09 sallar

I am also looking forward to have this nice feature

trivmnguyen avatar Oct 22 '20 08:10 trivmnguyen

If there is any config or something to get the fillFormatter accept an array instead of a static number (fillFormatter : { min: number }) and draw fillColor base on it. It would be perfect for this feature request. But I don't know how to. Hope for help.

hthhello avatar Oct 26 '20 05:10 hthhello

@sallar I guess it's too late but... Maybe you can try with:

config: {
  fillFormatter: {
     min: 4.5,
   },
  ....
}

albertovelazmoliner avatar Sep 15 '22 14:09 albertovelazmoliner