ApexCharts是否支持Y轴平移?
创始人
2024-11-10 02:30:14
0

是的,ApexCharts支持Y轴平移。您可以使用chart.updateOptions()方法动态更新图表选项。以下是一个包含Y轴平移的代码示例:

// 定义数据
const seriesData = [{
    name: 'Series 1',
    data: [45, 52, 38, 24, 33, 26, 19, 34]
  },
  {
    name: 'Series 2',
    data: [35, 41, 62, 42, 32, 41, 66, 64]
  }
];

// 定义并渲染图表
const chart = new ApexCharts(document.querySelector("#chart"), {
  series: seriesData,
  chart: {
    height: 350,
    type: 'line'
  },
  dataLabels: {
    enabled: false
  },
  title: {
    text: 'Y轴平移示例'
  },
  xaxis: {
    categories: ['01 Jan', '02 Jan', '03 Jan', '04 Jan', '05 Jan', '06 Jan', '07 Jan', '08 Jan']
  },
  yaxis: {
    title: {
      text: 'y轴标题'
    }
  },
  tooltip: {
    shared: true,
    intersect: false
  },
  responsive: [{
    breakpoint: 768,
    options: {
      chart: {
        height: 250
      }
    }
  }]
});

chart.render();

// 添加Y轴平移和动态更新
document.querySelector("#pan-y-axis").onclick = function() {
  chart.updateOptions({
    yaxis: {
      pan: {
        enabled: true,
        mode: "xy"
      }
    }
  });
};

相关内容

热门资讯

解密关于!hhpoker有没有... 解密关于!hhpoker有没有作弊挂(辅助挂)总是是有挂(真的有挂)1)hhpoker有没有作弊挂有...
推荐攻略!wpk辅助器是真的吗... 推荐攻略!wpk辅助器是真的吗(辅助挂)原来真的是有挂(确实有挂)1)wpk辅助器是真的吗辅助插件:...
教程辅助!wepoker免费透... 教程辅助!wepoker免费透视脚本(辅助挂)其实真的是有挂(有挂猫腻)wepoker免费透视脚本透...
重大来袭!hhpoker可以控... 重大来袭!hhpoker可以控制牌吗(辅助挂)竟然真的有挂(有挂教程)1、玩家可以在hhpoker可...
分享开挂内幕!hhpoker是... 分享开挂内幕!hhpoker是正品吗(辅助挂)竟然真的有挂(的确有挂)1、完成hhpoker是正品吗...
热点讨论!aapoker免费透... 热点讨论!aapoker免费透视脚本(辅助挂)一直真的是有挂(确实有挂)1、首先打开aapoker免...
我来分享!hhpoker德州牛... 我来分享!hhpoker德州牛仔视频(辅助挂)果然真的有挂(有挂技巧)1、超多福利:超高返利,海量正...
科技介绍!wepoker怎么获... 科技介绍!wepoker怎么获得好牌(辅助挂)原来真的是有挂(有挂存在)1、金币登录送、破产送、升级...
让我来分享经验!wepoker... 让我来分享经验!wepoker透视器免费(辅助挂)确实是有挂(有挂教学)1、全新机制【wepoker...
热门推荐!hhpkoer辅助器... 热门推荐!hhpkoer辅助器视频(辅助挂)果然有挂(有挂透明挂)1、热门推荐!hhpkoer辅助器...