Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With dataZoom displaying data per second for 24 hours of the day, dataZoom cannot display thumbnails, and tooltip does not display data. #16108

Closed
legcc opened this issue Nov 25, 2021 · 1 comment
Labels
invalid This issue was not created using the issue template.

Comments

@legcc
Copy link

legcc commented Nov 25, 2021

`

    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js"></script>

    <script type="text/javascript">

var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};

var option;

const times = []
const second = 86400
const initStart = new Date(new Date().toLocaleDateString()).getTime()
const data = {
[initStart]: [initStart, 100],
[initStart + 400000]: [initStart + 400000, 120],
[initStart + 1000000]: [initStart + 1000000, 130],
[initStart + 2000000]: [initStart + 2000000, 160],
[initStart + 3000000]: [initStart + 3000000, 10],
}

let start = initStart
for (let i = 0; i < second; i++) {
if (!!data[start]) {
times.push(data[start])
} else {
times.push([start, null])
}
start += 1000
}

const colors = ['#5470C6', '#EE6666'];
option = {
color: ['#2db7f5'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line',
animation: false,
label: {
backgroundColor: '#505765',
},
},
},
xAxis: {
type: 'time',
splitNumber: 12,
minInterval: 30 * 60 * 1000,
maxInterval: 60 * 60 * 1000,
axisLabel: {
formatter: '{HH}:{mm}',
showMinLabel: true,
showMaxLabel: true,
hideOverlap: true,
},
},
dataZoom: [
{
type: 'slider',
start: 0,
end: 25,
minValueSpan: 30 * 60 * 1000,
},
],
yAxis: {
type: 'value',
name: '功率(kW)',
},
series: [
{
data: times,
type: 'line',
smooth: true,
symbol: null,
symbolSize: 0,
connectNulls: true,
markPoint: {
symbolSize: 40,
data: [
{ xAxis: initStart, yAxis: 100 },
{ xAxis: initStart + 400000, yAxis: 120 },
// { xAxis: initStart + 1000000, yAxis: 130 },
{ xAxis: initStart + 2000000, yAxis: 160 },
{ xAxis: initStart + 3000000, yAxis: 10 },
],
label: {
show: false,
},
itemStyle: {
color: '#d9001b',
borderWidth: 1,
borderColor: '#fff',
shadowColor: '#333',
shadowBlur: 5,
},
},
},
],
// style: { height: 800 },
// opts: { locale: 'FR' },
}

if (option && typeof option === 'object') {
myChart.setOption(option);
}

    </script>
</body>
`
@echarts-bot echarts-bot bot added the invalid This issue was not created using the issue template. label Nov 25, 2021
@echarts-bot
Copy link

echarts-bot bot commented Nov 25, 2021

This issue is not created using issue template so I'm going to close it. 🙊
Sorry for this, but it helps save our maintainers' time so that more developers get helped.
Feel free to create another issue using the issue template.

If you think you have already made your point clear without the template, or your problem cannot be covered by it, you may re-open this issue again.

这个 issue 未使用 issue 模板 创建,所以我将关闭此 issue。
为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
如果您愿意,请使用 issue 模板重新创建 issue。

如果您认为虽然没有使用模板,但您已经提供了复现问题的充分描述,或者您的问题无法使用模板表达,也可以重新 open 这个 issue。

@echarts-bot echarts-bot bot closed this as completed Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This issue was not created using the issue template.
Projects
None yet
Development

No branches or pull requests

1 participant