apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.71k stars 19.62k forks source link

heatmap item wrongly rendered to strip when axis type is 'time' #12450

Closed LongLiveSocialism closed 2 years ago

LongLiveSocialism commented 4 years ago

Version

4.6.0

Steps to reproduce

  1. open heatmap official examples : https://echarts.apache.org/examples/zh/editor.html?c=heatmap-large
  2. set xAxis type to time
  3. set corresponding data to timestamp such as follows: origin: data.push([i, j, noise.perlin2(i / 40, j / 20) + 0.5]); timestamp version: data.push([new Date(i*1000), j, noise.perlin2(i / 40, j / 20) + 0.5]);

Then heatmap is wrongly rendered to strip when timestamps are not continuous timestamp numbers.

What is expected?

The heatmap item should be correctly rendered to proper rect to fill the picture

What is actually happening?

Then heatmap item is wrongly rendered to strip when timestamps are not continuous timestamp numbers.


I found it when I need to draw a heatmap with one time axis

echarts-bot[bot] commented 4 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

quillblue commented 4 years ago

@LongLiveSocialism It seems that currently heatmap will not support contiounus axis such as 'time', since intermediate value could not be determined without additional information. (for example, with value in 8:00 and in 9:00 provided we can not determine value in 8:30). If using value in one moment could represent value in a period of time in your case, you can set axis type as 'category' and use axis label to represent time like example in https://www.echartsjs.com/examples/en/editor.html?c=heatmap-cartesian

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 2 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

lafrech commented 2 years ago

If using value in one moment could represent value in a period of time in your case, you can set axis type as 'category' and use axis label to represent time like example in https://www.echartsjs.com/examples/en/editor.html?c=heatmap-cartesian

Obviously, the shortcoming of this workaround is that you don't get the nice features of time axis, like the clever subsampling of the axis. For instance, when displaying days for 1 whole year, a time axis would display month names while a categorical axis will display seemingly random dates picked along the axis.