作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何通过单击工具提示访问顶点图表的数据值?
我不想要索引。我需要值(value)。我如何访问该值?
<script>
var options = {
chart: {
type: 'line',
events: {
dataPointSelection: function (event, chartContext, config) {
console.log(config);
var ix = config.dataPointIndex;
alert(ix);
}
}
},
series: [{
name: 'TEST',
data: [[1324508400000, 34], [1324594800000, 54], [1325604800000, 39] , [1326236400000, 43]]
}],
xaxis: {
},
tooltip: {
intersect: true,
shared: false
},
markers: {
size: 6,
}
}
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
</script>
最佳答案
这对我有用:
dataPointSelection: (event, chartContext, config) => {
console.log(config.w.config.series[config.dataPointIndex])
console.log(config.w.config.labels[config.dataPointIndex])
}
关于apexcharts - 如何访问 Apexchart 的 dataPointSelection 函数的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57486591/
如何通过单击工具提示访问顶点图表的数据值? 我不想要索引。我需要值(value)。我如何访问该值? var options = { chart: { type: 'line'
我有一个与 this question 和 this answer 相关的问题,但它们并没有完全解决我的问题。我正在使用 vue 和 apexcharts,我想从事件中返回一个值或更新一个变量。是否可
我是一名优秀的程序员,十分优秀!