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 2022/12/31 05:45:35 UTC

[GitHub] [echarts] yueduz opened a new issue, #18127: [Bug] 时间轴不能应用 markArea

yueduz opened a new issue, #18127:
URL: https://github.com/apache/echarts/issues/18127

   ### Version
   
   5.4.1
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?c=line-sections
   
   ### Steps to Reproduce
   
   ```
   function randomData() {
     now = new Date(+now + oneDay);
     value = value + Math.random() * 21 - 10;
     return {
       name: now.toString(),
       value: [
         [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'),
         Math.round(value)
       ]
     };
   }
   let data = [];
   let now = new Date(1997, 9, 3);
   let oneDay = 24 * 3600 * 1000;
   let value = Math.random() * 1000;
   for (var i = 0; i < 1000; i++) {
     data.push(randomData());
   }
   option = {
     title: {
       text: 'Dynamic Data & Time Axis'
     },
     tooltip: {
       trigger: 'axis',
       formatter: function (params) {
         params = params[0];
         var date = new Date(params.name);
         return (
           date.getDate() +
           '/' +
           (date.getMonth() + 1) +
           '/' +
           date.getFullYear() +
           ' : ' +
           params.value[1]
         );
       },
       axisPointer: {
         animation: false
       }
     },
     xAxis: {
       type: 'time',
       splitLine: {
         show: false
       }
     },
     yAxis: {
       type: 'value',
       boundaryGap: [0, '100%'],
       splitLine: {
         show: false
       }
     },
     series: [
       {
         name: 'Fake Data',
         type: 'line',
         showSymbol: false,
         data: data,
         markArea:{
           itemStyle: {
               color: 'rgba(255, 173, 177, 0.4)'
           },
           data: [
               [
                 {
                     yAxis: new Date(1999, 9, 3)
                 },
                 {
                     yAxis: new Date(2000, 12, 4)
                 }
               ]
           ]
       }
       }
     ]
   };
   setInterval(function () {
     for (var i = 0; i < 5; i++) {
       data.shift();
       data.push(randomData());
     }
     myChart.setOption({
       series: [
         {
           data: data
         }
       ]
     });
   }, 1000);
   ```
   使用上面的代码替换[此链接](https://echarts.apache.org/examples/zh/editor.html?c=line-sections)中的代码
   代码中,我配置了  markArea,但是没有显现效果。
   
   ### Current Behavior
   
   时间轴不能应用 markArea
   
   ### Expected Behavior
   
   在时间轴上显示区间 markArea
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

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 #18127: [Bug] 时间轴不能应用 markArea

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

   @yueduz It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] Timeline cannot apply markArea
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] yueduz commented on issue #18127: [Bug] 时间轴不能应用 markArea

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

   > 在你给出的示例中,X 轴为时间轴,但为何 `markArea` 却在尝试设置 `yAxis` Y 轴?是否应该是 `xAxis`?
   
   是我错了


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] plainheart commented on issue #18127: [Bug] 时间轴不能应用 markArea

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

   在你给出的示例中,X 轴为时间轴,但为何 `markArea` 却在尝试设置 `yAxis` Y 轴?是否应该是 `xAxis`?


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] yueduz closed issue #18127: [Bug] 时间轴不能应用 markArea

Posted by GitBox <gi...@apache.org>.
yueduz closed issue #18127: [Bug] 时间轴不能应用 markArea
URL: https://github.com/apache/echarts/issues/18127


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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