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 2020/02/26 02:47:59 UTC

[GitHub] [incubator-echarts] Fuerniu commented on issue #2855: ECharts3的toolbox.feature.magicType.option设置没有起作用

Fuerniu commented on issue #2855: ECharts3的toolbox.feature.magicType.option设置没有起作用
URL: https://github.com/apache/incubator-echarts/issues/2855#issuecomment-591210049
 
 
   > #### 问题简述 (One-line summary)
   > ECharts3的toolbox.feature.magicType.option好像不起作用,不知道是不是我的写法有问题?
   > 
   > 我想在 line 图的设置 xAxis: {boundaryGap: true},
   > bar图的时候设置 xAxis: {boundaryGap: false}
   > 
   > #### 版本及环境 (Version & Environment)
   > * ECharts 版本 (ECharts version):
   > * 浏览器类型和版本 (Browser version):
   > * 操作系统类型和版本 (OS Version):
   >   ECharts 3
   >   Chrome49
   >   Windows7
   > 
   > #### 重现步骤 (Steps to reproduce)
   > 1.浏览器生成line图
   > 2.点击图右上方转换为bar图
   > 
   > #### 期望结果 (Expected behaviour)
   > 不同图时boundaryGap的设置可以生效
   > 
   > #### 可能哪里有问题 (What went wrong)
   > 可能示例不详细导致我设置方式有问题,也可能ECharts3版本新出还没有人用这个功能。
   > 谢谢!
   > 
   > #### ECharts配置项 (ECharts option)
   > ```js
   > option = {
   > title: {
   >             text: '标题',
   >             textStyle: {fontSize: 16}
   >         },
   >         tooltip: {
   >             rigger: 'item',
   >             formatter: function (params) {
   >                 return params.seriesName+'<br>'+params.name+'时:  '+params.value+' s';
   >             }
   >         },
   >         legend: {
   >             data:['解析时间','建立连接时间', '下载时间']
   >         },
   >         toolbox: {
   >             feature: {
   >                 magicType: {
   >                     type: ['line', 'bar'],
   >                     option: {
   >                         line: {xAxis: {boundaryGap: true} },
   >                         bar: {xAxis: {boundaryGap: false} }
   >                     }
   >                 },
   >                 saveAsImage: {}
   >             }
   >         },
   >         grid: {
   >             top: 36,
   >             left: '3%',
   >             right: '4%',
   >             bottom: '3%',
   >             containLabel: true
   >         },
   >         xAxis: {
   >             type: 'category',
   >             boundaryGap: false,
   >             axisLabel: {formatter: '{value} (s)'},
   >             data: ["01","02","03","04","05","06","07","08","09","10","11","12"]
   >         },
   >         yAxis: {
   >             axisLabel: {
   >                 formatter:  function (value, index) {
   >                     return value+' s';
   >                 }
   >             }
   >         },
   >         color: ['#c23531', '#ca8622', '#91c7ae'],
   >         series: [{
   >             name: '解析时间',
   >             type: 'line',
   >             label: {
   >                 normal: {
   >                     formatter: function (params) {
   >                         var percent = params.value * 100;
   >                         return percent+' %';
   >                     }
   >                 }
   >             },
   >             data: [0.1, 0.1, 0.06, 0.03, 0.02, 0.01, 0.02,0.1, 0.1, 0.06, 0.03, 0.02]
   >         }, {
   >             name: '建立连接时间',
   >             type: 'line',
   >             data: [0.1, 0.21, 0.22, 0.06, 0.08, 0.01, 0.02,0.1, 0.21, 0.22, 0.06, 0.08]
   >         }, {
   >             name: '下载时间',
   >             type: 'line',
   >             data: [0.8, 0.79, 0.92, 1.11, 1.09, 0.98, 0.96,0.8, 0.69, 0.72, 0.91, 0.9]
   >         }]
   > }
   > ```
   > 
   > #### 其他信息 (Other comments)
   
   echart中toolbox的magicType属性option里面设置的样式是复写series中的样式内容,只有在series中能改变的属性才能被修改,如果不是则修改不了。

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