xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

v-charts bug All In One

v-charts bug All In One

one point data, no symbol bug

    chartExtend () {
        const type = this.options.settings.type;
        return {
            ...UtilChart.chartExtend(type),
            grid: {
                bottom: 0,
            },
            legend: {
                show: this.options.settings.type !== 'pie',
            },
            series (v) {
                return v.map((i) => ({
                    ...i,
                    barMaxWidth: 12,
                    symbol: 'none',
                }));
            },
        };
    },

solution

    chartExtend () {
        const type = this.options.settings.type;
        return {
            ...UtilChart.chartExtend(type),
            grid: {
                bottom: 0,
            },
            legend: {
                show: this.options.settings.type !== 'pie',
            },
            series (v) {
                return v.map((i) => ({
                    ...i,
                    barMaxWidth: 12,
                    // symbol: 'none',
                    // 💩 为什么要隐藏 symbol 呀!
                }));
            },
        };
    },

demo

echarts

https://echarts.apache.org/examples/zh/editor.html?c=line-stack


option = {
  title: {
    text: 'Stacked Line'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['Email', 'Union Ads', 'Video Ads']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['Mon']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: 'Email',
      type: 'line',
      stack: 'Total',
      data: [1,]
    },
    {
      name: 'Union Ads',
      type: 'line',
      stack: 'Total',
      data: [220]
    },
    {
      name: 'Video Ads',
      type: 'line',
      stack: 'Total',
      data: ['']
    },
  ]
};

refs

https://www.cnblogs.com/xgqfrms/p/15701229.html

https://v-charts.xgqfrms.xyz/#/props-demo2



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-12-29 16:26  xgqfrms  阅读(24)  评论(1编辑  收藏  举报