9.9 重评预约评标室,地图轮播tooltip
This commit is contained in:
@ -178,6 +178,25 @@ const GraphChart = (props: { type: string, chartData: any[] }) => {
|
||||
};
|
||||
var dataValue = dealWithData();
|
||||
var data1 = dataValue.splice(0, 3);
|
||||
var index = 0;
|
||||
const autoTooltip = () => {
|
||||
const dataLength = data1.length;
|
||||
setTimeout(() => {
|
||||
myChart.dispatchAction({
|
||||
type: 'showTip',
|
||||
seriesIndex: 2,
|
||||
dataIndex: index,
|
||||
position: (point: number[], params: any, dom: any, rect: any, size: { contentSize: number[] }) => {
|
||||
return [point[0] + 20, point[1] - size.contentSize[1] + 45];
|
||||
},
|
||||
});
|
||||
index++;
|
||||
if (index >= dataLength) {
|
||||
index = 0;
|
||||
}
|
||||
autoTooltip();
|
||||
}, 10000);
|
||||
}
|
||||
const pieOption: EChartsOption = {
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
@ -376,6 +395,7 @@ const GraphChart = (props: { type: string, chartData: any[] }) => {
|
||||
const resize = () => {
|
||||
myChart && myChart.resize();
|
||||
};
|
||||
type == "map" && autoTooltip();//地图自动轮播tooltip
|
||||
window.addEventListener("resize", debounce(() => resize(), 100));
|
||||
return () => {
|
||||
window.removeEventListener("resize", debounce(() => resize(), 100));
|
||||
|
Reference in New Issue
Block a user