MPAndroidChart - Fill gradient horizontally

19 Views Asked by At

I would like to have a chart (MPAndroidChart) with

  • linechart in one color
  • and in background horizontal gradient (from left to right) zone / phase depending of x-axis. This background depends of a pattern (on X secondes) and should be repeated as long as the chart is scrolling.

Should be something like enter image description here or enter image description here with a linechart (curve) above it.

I tried different methods : with combined chart (linechart and BarChart) but in BarChart you can only do setGradientColor (but it's gradient from bottom to top and not from left to right). It's not possible to implement "fillDrawable" for barChart's set.

I also checked these : https://github.com/PhilJay/MPAndroidChart/issues/3406

https://github.com/PhilJay/MPAndroidChart/issues/485

but it's only for y-axis and not for x-axis. The answer for x-axis at the end is combined chart but impossible to add left to right gradient.

I also tried to add multiple linecharts like enter image description here but the left to right gradient is on all slots. I cannot create a different linechart for every slot (to heavy to process).

Do you have any suggestion to help me or advices ?

Thanks in advance, bye !

0

There are 0 best solutions below