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 2019/12/14 03:36:18 UTC

[GitHub] [incubator-echarts] karma2014 commented on issue #11654: x轴显示位置错乱

karma2014 commented on issue #11654: x轴显示位置错乱
URL: https://github.com/apache/incubator-echarts/issues/11654#issuecomment-565678243
 
 
   @TideDlrow My option is :
   `option = {
       xAxis: [
           {
               type: 'category',
               name:'月份',
               nameLocation:'start',
               data: ["2016-1", "2016-2", "2016-3", "2016-4", "2016-5", "2016-6", "2016-7", "2016-8", "2016-9", "2016-10", "2016-11", "2016-12"]
           },
           {
               type: 'category',
               name:'值',
               nameLocation:'start',
               axisLine: {
                   onZero: false,
               },
               data: ["2015-1", "2015-2", "2015-3", "2015-4", "2015-5", "2015-6", "2015-7", "2015-8", "2015-9", "2015-10", "2015-11", "2015-12"]
           }
       ],
       yAxis: [
           {
           type: 'value',
           xAxisIndex: 1,
           position:'left',
           min:0,
           max:10
         },{
           type: 'value',
           xAxisIndex: 0,
           show: true,
           min: 0,
           max: 10,
           position:'right'
         }
       ],
   };`
   关键是这个属性xAxis.axisLine.onZero,官方文档解释:“X 轴或者 Y 轴的轴线是否在另一个轴的 0 刻度上,只有在另一个轴为数值轴且包含 0 刻度时有效。”
   

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


With regards,
Apache Git Services

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