You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/03/16 03:08:21 UTC

[GitHub] [echarts] Assur opened a new issue #14484: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

Assur opened a new issue #14484:
URL: https://github.com/apache/echarts/issues/14484


   ### Version
   5.0.0
   
   ### Steps to reproduce
   echarts版本是5.0.0,我是用series方式显示时间轴的,但是series方式展示时间不能排序,时间小的反而在后面展示了(即,2020-10-9 00:00:00展示在2020-10-9 00:00:02的后面了),我想要让两个折线按照时间来排序如何做?即2020-10-9 00:00:00展示在2020-10-9 00:00:02的前面这种时间升序格式
   
   
   `var dataTemperature =
   [
   ['2020-10-9 00:00:00', 11], ['2020-10-9 15:00:01', 29], ['2020-10-9 15:00:08', 6]
   ];
   var dataTemperatureB =
   [
   ['2020-10-9 00:00:02', 14], ['2020-10-9 15:00:04', 35], ['2020-10-9 15:00:12', 8]
   ];
   
           var myChart = echarts.init(document.getElementById('trendChart'));
           var option = {
               tooltip: {
                   trigger: 'axis',
                   position: function (pt) {
                       return [pt[0], '10%'];
                   }
               },
               backgroundColor: '#ececf2',
               //title: {
               //    left: 'center',
               //    text: '大数据量面积图',
               //},
               toolbox: {
                   feature: {
                       dataZoom: {
                           yAxisIndex: 'none'
                       },
                       restore: {},
                       saveAsImage: {}
                   }
               },
               legend: {
                   data: ['温度'],
                   x: 'left'
               },
               xAxis: {
                   // 根据x轴数据决定type类型
                   type: 'time',
                   boundaryGap: false
                   // 注: x轴不指定data,自动会从series取
                   //data: []
               },
               yAxis: {
                   type: 'value',
                   boundaryGap: [0, '10%']
               },
               dataZoom: [{
                   type: 'inside',
                   start: 0,
                   end: 10
               }, {
                   start: 0,
                   end: 10,
                   handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                   handleSize: '80%',
                   handleStyle: {
                       color: '#fff',
                       shadowBlur: 3,
                       shadowColor: 'rgba(0, 0, 0, 0.6)',
                       shadowOffsetX: 2,
                       shadowOffsetY: 2
                   }
               }],
               series: [
                   {
                       name: 'A相电流',
                       type: 'line',
                       smooth: true,
                       //symbol: 'none',
                       //sampling: 'average',
                       //itemStyle: {
                       //    color: 'rgb(300,100,100)'
                       //},
                       data: dataTemperature,
                       connectNulls: false
                   },
                   {
                       name: 'B相电流',
                       type: 'line',
                       smooth: true,
                       //symbol: 'none',
                       //sampling: 'average',
                       //itemStyle: {
                       //    color: 'rgb(300,100,100)'
                       //},
                       data: dataTemperatureB,
                       connectNulls: false
                   }
               ]
           };
   
           myChart.setOption(option);`
   
   ### What is expected?
   我想要让两个折线按照时间来排序如何做?即2020-10-9 00:00:00展示在2020-10-9 00:00:02的前面这种时间升序格式
   
   ### What is actually happening?
   series方式展示时间不能排序,时间小的反而在后面展示了(即,2020-10-9 00:00:00展示在2020-10-9 00:00:02的后面了),这是错误的
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] tianjianwei1990 commented on issue #14484: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

Posted by GitBox <gi...@apache.org>.
tianjianwei1990 commented on issue #14484:
URL: https://github.com/apache/echarts/issues/14484#issuecomment-810980989


   this problem exists in last version too   ! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Assur commented on issue #14484: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

Posted by GitBox <gi...@apache.org>.
Assur commented on issue #14484:
URL: https://github.com/apache/echarts/issues/14484#issuecomment-801560529


   怎么没人解决吗?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #14484: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14484:
URL: https://github.com/apache/echarts/issues/14484#issuecomment-799908926






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org