流程图图不会改变颜色

问题描述 投票:0回答:1

我正在尝试更改eCharts图的颜色,但更改不适用。

这是我的代码:

this.option.series.push({
  name: 'Real',
  type: 'line',
  symbol: 'triangle',
    symbolSize: 10,
    label: {
            normal: {
                show: true,
                position: 'left'
            }
        },
    lineStyle: {
        color: 'transparent',
        width: 2,
        type: 'line'
    },
    itemStyle: {
        color: 'green'
    },
  markLine: {
    data: [
      {
        name: 'Limite',
        yAxis: 500,
        lineStyle:
        {
          color: 'red'
        }
      },
    ]
  },
  data: realData
});

[当我在eCharts片段中尝试此代码时(在官方文档here中),它可以工作,但在我的作品中不起作用。

我正在使用Angular v8和echarts 3.8.5

javascript angular typescript echarts
1个回答
0
投票

您要更改线条的颜色还是项目的颜色?

您可以检查此示例https://gallery.echartsjs.com/editor.html?c=xXbP45bsC

和这里是一个意甲的配置

    {
        name: '注册总量',
        type: 'line',
        // smooth: true, //是否平滑
        showAllSymbol: true,
        // symbol: 'image://./static/images/guang-circle.png',
        symbol: 'circle',
        symbolSize: 25,
        lineStyle: {
            normal: {
                color: "#00ca95",
                shadowColor: 'rgba(0, 0, 0, .3)',
                shadowBlur: 0,
                shadowOffsetY: 5,
                shadowOffsetX: 5,
            },
        },
        label: {
            show: true,
            position: 'top',
            textStyle: {
                color: '#00ca95',
            }
        },

        itemStyle: {
            color: "#00ca95",
            borderColor: "#fff",
            borderWidth: 3,
            shadowColor: 'rgba(0, 0, 0, .3)',
            shadowBlur: 0,
            shadowOffsetY: 2,
            shadowOffsetX: 2,
        },
        tooltip: {
            show: false
        },
        areaStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(0,202,149,0.3)'
                    },
                    {
                        offset: 1,
                        color: 'rgba(0,202,149,0)'
                    }
                ], false),
                shadowColor: 'rgba(0,202,149, 0.9)',
                shadowBlur: 20
            }
        },
        data: [281.55, 398.35, 214.02, 179.55, 289.57, 356.14, ],
    }

问候

© www.soinside.com 2019 - 2024. All rights reserved.