7

I made a echart line graph. Now, I want to add gradient color to it, as shown below: enter image description here

In this link, it said it supports the setting as gradient color. But when I tried to do this as code given:enter image description here

It gave this error: enter image description here

What to do?

Thanks in advance.

1 Answers1

11
  areaStyle: {
          color: new graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: 'rgb(255, 158, 68)'
            },
            {
              offset: 1,
              color: 'rgb(255, 70, 131)'
            }])
        }

Echart has graphic class, which gives you access to the Gradient Property. You can fine tune it to your needs giving start and end points to the colors in array.

Beka Kalandadze
  • 510
  • 7
  • 10