You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/04/17 08:31:29 UTC

[GitHub] See-Cat opened a new issue #8175: 折线图y轴刻度的分割段数的问题

See-Cat opened a new issue #8175: 折线图y轴刻度的分割段数的问题
URL: https://github.com/apache/incubator-echarts/issues/8175
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   见图1,图2
   图1为自己写的折线图,图2为根据图1的数据修改后的官方demo,数据都一样,但是出图后的y轴刻度的分段数却不一样,想知道是什么原因造成的?
   
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:4
   + Browser version [浏览器类型和版本]:chrome
   + OS Version [操作系统类型和版本]:
   
   
   
   
   
   ### Expected behaviour [期望结果]
   期望自己写的折线图的y轴分段数能与官方demo的效果一样。
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   //图1配置
   option ={
       "color": [
           "#4aa9f3",
           "#71c531",
           "#f36f6d",
           "#fc8b40",
           "#818af8",
           "#31c9d7",
           "#f35e7a",
           "#ab7aee",
           "#14d68b",
           "#cde5ff"
       ],
       "backgroundColor": "#1d2d39",
       "tooltip": {
           "trigger": "axis",
           "padding": [
               5,
               15
           ],
           "extraCssText": "background-color: rgba(0,0,0,0.4)"
       },
       "title": {
           "left": 20,
           "top": 18,
           "textStyle": {
               "fontSize": 13,
               "fontFamily": "Microsoft Yahei, sans-serif",
               "color": "#fff"
           }
       },
       "grid": {
           "top": "15%",
           "bottom": "30%"
       },
       "xAxis": {
           "type": "category",
           "data": [
               "2018/03",
               "2018/04"
           ],
           "boundaryGap": true,
           "axisLabel": {
               "color": "#fff",
               "fontSize": 12,
               "fontFamily": "Microsoft Yahei light, Microsoft Yahei, sans-serif"
           },
           "axisTick": {
               "show": false
           },
           "axisLine": {
               "lineStyle": {
                   "color": "rgba(63,76,87,.7)"
               }
           },
           "splitLine": {
               "show": true,
               "lineStyle": {
                   "color": "rgba(63,76,87,.7)"
               }
           }
       },
       "yAxis": {
           "type": "value",
           "splitNumber": 4,
           "nameTextStyle": {
               "color": "#fff",
               "fontFamily": "Microsoft Yahei light, Microsoft Yahei, sans-serif",
               "fontSize": 12
           },
           "nameRotate": 90,
           "nameLocation": "middle",
           "nameGap": 40,
           "boundaryGap": [
               0,
               "100%"
           ],
           "axisLine": {
               "show": true,
               "lineStyle": {
                   "color": "#1d2d39"
               }
           },
           "splitLine": {
               "show": true,
               "lineStyle": {
                   "color": "rgba(63,76,87,.7)"
               }
           },
           "axisLabel": {
               "color": "#fff",
               "fontFamily": "Microsoft Yahei light, Microsoft Yahei, sans-serif",
               "fontSize": 12
           },
           "name": "服务访问次数 (单位:次数/月)"
       },
       "dataZoom": [
           {
               "type": "inside",
               "xAxisIndex": [
                   0
               ],
               "start": 0,
               "end": 100
           }
       ],
       "series": [
           {
               "type": "line",
               "data": [
                   0,
                   26
               ],
               "name": "所有服务"
           }
       ],
       "legend": {
           "selected": {},
           "left": "9%",
           "bottom": "14%",
           "orient": "horizontal",
           "itemGap": 20,
           "itemWidth": 25,
           "itemHeight": 11,
           "textStyle": {
               "color": "#fff",
               "fontSize": 12,
               "fontFamily": "Microsoft Yahei, sans-serif",
               "padding": [
                   0,
                   0,
                   0,
                   5
               ]
           },
           "inactiveColor": "#727272",
           "data": [
               "所有服务"
           ]
       }
   }
   //图2配置
   option = {
       title: {
           text: '折线图堆叠'
       },
       tooltip: {
           trigger: 'axis'
       },
       legend: {
           data:['邮件营销']
       },
       grid: {
           left: '3%',
           right: '4%',
           bottom: '3%',
           containLabel: true
       },
       toolbox: {
           feature: {
               saveAsImage: {}
           }
       },
       xAxis: {
           type: 'category',
           boundaryGap: false,
           data: ['周一','周二']
       },
       yAxis: {
           type: 'value'
       },
       series: [
           {
               name:'邮件营销',
               type:'line',
               data:[ 0, 26]
           }
       ]
   }
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   图1
   ![1](https://user-images.githubusercontent.com/20717588/38857732-8d119a16-425c-11e8-8440-405d7b26fec8.png)
   图2
   ![2](https://user-images.githubusercontent.com/20717588/38857788-aad1263e-425c-11e8-938e-6384705b0da7.png)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org