|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<!--
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-10-08 19:12:07
|
|
|
|
|
* @LastEditTime: 2021-11-12 11:53:26
|
|
|
|
|
* @LastEditTime: 2021-12-29 17:29:10
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edi
|
|
|
|
|
* @FilePath: /data-show/src/components/v-echars/index.vue
|
|
|
|
@ -34,6 +34,7 @@ export default {
|
|
|
|
|
this.myChart.clear();
|
|
|
|
|
this.myChart.setOption(val);
|
|
|
|
|
}
|
|
|
|
|
this.myChart.off('click'); //解绑点击事件
|
|
|
|
|
this.myChart.on('click', (params) => {
|
|
|
|
|
if(params.componentSubType === 'bar') {
|
|
|
|
|
let obj = {
|
|
|
|
@ -41,7 +42,7 @@ export default {
|
|
|
|
|
value: params.data
|
|
|
|
|
}
|
|
|
|
|
this.$emit("getData", obj);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if(params.componentSubType === 'sankey') {
|
|
|
|
|
let o = {
|
|
|
|
|
key: params.data.name || params.data.source,
|
|
|
|
@ -58,14 +59,14 @@ export default {
|
|
|
|
|
if (
|
|
|
|
|
this.myChart.containPixel("grid", pointInPixel)
|
|
|
|
|
) {
|
|
|
|
|
let pointInGrid = this.myChart.convertFromPixel(
|
|
|
|
|
{
|
|
|
|
|
seriesIndex: 0,
|
|
|
|
|
},
|
|
|
|
|
pointInPixel
|
|
|
|
|
);
|
|
|
|
|
let xIndex = pointInGrid[0]; //索引
|
|
|
|
|
let handleIndex = Number(xIndex);
|
|
|
|
|
// let pointInGrid = this.myChart.convertFromPixel(
|
|
|
|
|
// {
|
|
|
|
|
// seriesIndex: 0,
|
|
|
|
|
// },
|
|
|
|
|
// pointInPixel
|
|
|
|
|
// );
|
|
|
|
|
// let xIndex = pointInGrid[0]; //索引
|
|
|
|
|
// let handleIndex = Number(xIndex);
|
|
|
|
|
// let seriesObj = this.myChart.getOption(); //图表object对象
|
|
|
|
|
let obj =
|
|
|
|
|
this.myChart._componentsViews[1]
|
|
|
|
|