张雄 3 years ago
parent 99e9b053cf
commit 34d7d5c9db

@ -50,10 +50,19 @@ export default {
} }
this.$emit("getData", o); this.$emit("getData", o);
} }
}) if(params.componentType === 'markPoint') {
let o = {
key: params.data.name,
value: params.value,
mark: params.componentType
}
this.$emit("getData", o);
}
});
// this.myChart.off("click"); // this.myChart.off("click");
// //
this.myChart.getZr().on("click", (params) => {
this.myChart.getZr().on("dblclick", (params) => {
//param.name x,param.data y //param.name x,param.data y
let pointInPixel = [params.offsetX, params.offsetY]; let pointInPixel = [params.offsetX, params.offsetY];
if ( if (
@ -75,8 +84,9 @@ export default {
if(ex && ex.componentSubType === 'line') { if(ex && ex.componentSubType === 'line') {
this.$emit("getData", obj); this.$emit("getData", obj);
} }
} };
}); });
// //
this.myChart.getZr().on("mousemove", () => { this.myChart.getZr().on("mousemove", () => {
this.myChart.getZr().setCursorStyle("pointer"); this.myChart.getZr().setCursorStyle("pointer");

@ -37,6 +37,7 @@ export default {
sBrand: "奥迪", sBrand: "奥迪",
}, },
opt: {}, opt: {},
markPointUrl: ''
}; };
}, },
created() { created() {
@ -59,13 +60,15 @@ export default {
let value = ele.Data; let value = ele.Data;
dx.push(time); dx.push(time);
ds.push(value); ds.push(value);
if(ele.hotTop[0]) {
this.markPointUrl = ele.hotTop[0].url;
}
let obj = { let obj = {
label: time, label: time,
hotTop: ele.hotTop hotTop: ele.hotTop
} }
hotTopArr.push(obj) hotTopArr.push(obj)
}); });
console.log(hotTopArr)
this.opt = createOpt(dx, ds, hotTopArr); this.opt = createOpt(dx, ds, hotTopArr);
this.load = false; this.load = false;
}); });
@ -101,15 +104,18 @@ export default {
}, },
}); });
}, },
// clickEchars(data) {
clickEchars(data = []) {
if(!this.btnPrm('btn_brand_datalist')) { if(!this.btnPrm('btn_brand_datalist')) {
return return
} }
if(data.mark == 'markPoint'){
window.open(this.markPointUrl);
console.log(this.markPointUrl);
return;
}
let qudao = []; let qudao = [];
let startTime = ""; let startTime = "";
let endTime = moment(new Date()).format("YYYY-MM-DD HH:mm:ss"); let endTime = moment(new Date()).format("YYYY-MM-DD HH:mm:ss");
console.log(data)
data.forEach((ele) => { data.forEach((ele) => {
let seriesName = ele.seriesName; let seriesName = ele.seriesName;
startTime = ele.name; startTime = ele.name;

@ -38,7 +38,15 @@ function createData(ds = []) {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [arr1[j].value] data: [arr1[j].value],
markPoint: {
data: [
{
type: 'max', name: 'Max',symbol:'pin',
label: '!'
}
],
}
} }
arr.push(obj) arr.push(obj)
} else { } else {

Loading…
Cancel
Save