Echarts柱状图柱形不对应刻度写

104 阅读1分钟

1734337463794.png

  grid: {
    top: "8%",
    left: "3%",
    right: '3%',
    bottom: "3%",
    containLabel: true
  },
  tooltip: {  
    trigger: 'axis',  
    formatter: function (params) {  
      // params 是一个数组,包含了每个数据点的信息  
      let res = params.map(item => {  
          return `${item.seriesName}` + '<br/>' + `${item.value}`  + '<br/>' +  `${item.value}`;  
      });  
      return res.join('<br>');  
    }  
  },
  xAxis: {
    type: 'value',
    min: 0,
    max: 1,
    interval: 0.1,
    axisTick:{ alignWithLabel:true,},
    splitLine: { show: false }, // 隐藏分割线
  },
  yAxis: {
    type: 'value',
    splitLine: { show: false }, // 隐藏分割线
    axisLine: {show: true},
    axisTick: { show: true },
  },
  series: [{
    name:'prob_segment',
      data: [
            // 示例数据,可以根据需要填充
            { value: [0.05, 10] },
            { value: [0.15, 20] },
            { value: [0.25, 30] },
            { value: [0.35, 40] },
            { value: [0.45, 50] },
            { value: [0.55, 60] },
            { value: [0.65, 70] },
            { value: [0.75, 80] },
            { value: [0.85, 90] },
            { value: [0.95, 100] }
        ],
      type: 'bar',
      barWidth: '40',
      
    }]
};