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 02:52:59 UTC

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

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


   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);


----------------------------------------------------------------
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 #14483: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

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


   This issue is not created using [issue template](https://ecomfe.github.io/echarts-issue-helper/) 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 模板](https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn) 创建,所以我将关闭此 issue。
   为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
   如果您愿意,请使用 issue 模板重新创建 issue。
   
   如果您认为虽然没有使用模板,但您已经提供了复现问题的充分描述,或者您的问题无法使用模板表达,也可以重新 open 这个 issue。


----------------------------------------------------------------
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] closed issue #14483: 折线图两条或两条以上x轴(含有不连续时间轴数据),series方式展示时间不能排序

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] closed issue #14483:
URL: https://github.com/apache/echarts/issues/14483


   


----------------------------------------------------------------
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