首页 > 其他 > 详细

echart Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.

时间:2019-12-18 15:48:59      阅读:262      评论:0      收藏:0      [点我收藏+]
      var setoption = {
        title: {},
        legend: {
          show: this.legendshow,
          data: [this.legend]
        },
        color: [‘#ff960f‘],
        toolbox: {
          show: this.showtoolbox,
          feature: {
            dataZoom: {},
            magicType: { type: ["line", "bar"] },
            restore: {},
            saveAsImage: {}
          }
        },
        xAxis: {
          data: this.$props.data.xdata,
          boundaryGap: boundarygap,
          axisTick: {
            show: false //隐藏Y轴刻度
          },
          axisLine: {
            show: false //隐藏Y轴线段
          },
          axisLabel: {
            textStyle: {
              color: "#2c3e50"
            }
          }
        },
        grid: {
          left: 10,
          right: 10,
          bottom: this.bottom,
          top: this.top,
          containLabel: true
        },

        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "line"
          }
        },
        yAxis: {
          type: "value",
          axisLabel: {
            formatter: "{value} ",
            margin: 20,
            textStyle: {
              color: "#2c3e50"
            }
          },
          axisTick: {
            show: false //隐藏Y轴刻度
          },
          axisLine: {
            show: false //隐藏Y轴线段
          },
          max: parseInt(max*1.4).toFixed(0) <=1?1:parseInt(max*1.4).toFixed(0)
        },
        series: this.seriesinit(max)
      };

  是yAxis的max小于1的时候导致报错   如图改成

parseInt(max*1.4).toFixed(0) <=1?1:parseInt(max*1.4).toFixed(0)

echart Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.

原文:https://www.cnblogs.com/hzsu/p/12059963.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!