You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Ҷ <79...@qq.com.INVALID> on 2022/08/08 10:35:41 UTC

求教日历图如何与series.encode映射

我在沙盒(https://echarts.apache.org/examples/zh/editor.html)中编写了如下options:


const datas = [
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; day:new Date(2022,8,7),
&nbsp; &nbsp; &nbsp; value: 10,
&nbsp; &nbsp; },
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; day:new Date(20022,8,8),
&nbsp; &nbsp; &nbsp; value:20,
&nbsp; &nbsp; },
&nbsp; ]
option = {
&nbsp; dataset:{
&nbsp; &nbsp; dimensions:['day','value'],
&nbsp; &nbsp; source:datas,
&nbsp; },
&nbsp; visualMap:{
&nbsp; &nbsp; type:'piecewise',
&nbsp; &nbsp; orient:'horizontal',
&nbsp; &nbsp; min:0,
&nbsp; &nbsp; max:30,
&nbsp; },
&nbsp; calendar:{
&nbsp; &nbsp; range:'2022',
&nbsp; },
&nbsp; series: [
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; type: 'heatmap',
&nbsp; &nbsp; &nbsp; coordinateSystem:'calendar',
&nbsp; &nbsp; &nbsp; encode:{
&nbsp; &nbsp; &nbsp; &nbsp; time:'day',
&nbsp; &nbsp; &nbsp; &nbsp; value:'value',
&nbsp; &nbsp; &nbsp; },
&nbsp; &nbsp; }
&nbsp; ]
};



我期望的显示方式是显示两个亮点,一个是2022年8月7号的,一个是2022年8月8号的,我在官网教程中,没有找到日历坐标系的encode配置方式,但是在源代码中找到其会读取time和value,但是我这边设置无效。



如图所示,显示的高亮完全不对。我看官方示例并没有使用dataset,也没有设置encode,而是直接设置了series.data,然后貌似默认读取了第一列和第二列?我没有找到如何处理这个问题的方法,恳请告知我如何解决。




?
791363454@qq.com



&nbsp;