echarts [Feature] can we draw an area based on the points of a serie type "lines"

sxissh06  于 5个月前  发布在  Echarts
关注(0)|答案(1)|浏览(106)

What problem does this feature solve?

Is there a way to fill the area between each points of a serie type "lines" ?

for exemple :

example with code:
https://echarts.apache.org/examples/en/editor.html?c=geo-svg-lines&code=CQOg5gpgLgFAUAAgQJQPKoCoH0AKBBDACQQGoEByAegBMBDKWy2gZ2eksgHtKBZWgY1TUATgFcAtgFoAMgDUArJIBmAG06dhABxW0AdpIDuEAEYhmANzDkANIgRLRu_lACWnXQhgWwASgQBvOyQIfgALWmEoZhBhCDAXZigIYT5NGHI-QREJGQVlNQ1tPUMTGwCEbwAuCssEAF8fAG4ghE5NV3cEAF4AlqQuasCkYeHxWk1qjIEhMSk5RVV1LR19I2MbPuHhTlpxaqgxCE262xGkNmEXCGZqgG1NpCGzkd1diEnkTlEkjeeRqAAnpp3hQVC5dNdfn8kPwltRwfQIABlAGJCB7ChcKHQrgASV01AgAA9qgAGU7QhDozThZgJQYPM46YwQFQMylnZihTgGapKWgqNiMkZ1YX1CnQzScFQAsEQ_aHCV_OXIwEqEFPDkGFzUKCharyMUnMV0Bh3MWPC3DWEaag3BD3DnPW4ARlJ5IQABZ3QBdJVOh0AZnd1i9vv9TtuwY9ADZfVakD6raKOUnoSmzmnhnVmiNxACAMLhSJmaCodpuXQwNodXRNOyippAA

$.get(
  ROOT_PATH + '/data/asset/geo/MacOdrum-LV5-floorplan-web.svg',
  function (svg) {
    echarts.registerMap('MacOdrum-LV5-floorplan-web', { svg: svg });
    option = {
      geo: {
        map: 'MacOdrum-LV5-floorplan-web',
        roam: true
      },
      series: [
        {
          name: 'Route',
          type: 'lines',
          coordinateSystem: 'geo',
          geoIndex: 0,
          emphasis: {
            label: {
              show: false
            }
          },
          polyline: true,
          lineStyle: {
            width: 5,
          },
          data: [
            {
              coords: [
                [100, 400],
                [300, 400],
                [300, 600],
              ]
            }
          ]
        }
      ]
    };
    myChart.setOption(option);
  }
);

What does the proposed API look like?

is there a "areaBackground" or a boolean to activate it ?

sz81bmfz

sz81bmfz1#

please take a look at custom.polygon, it has color fill

相关问题