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 2019/04/13 07:25:41 UTC

[GitHub] [incubator-echarts] wulamao opened a new issue #10284: scatter3D与2D使用同一组数据,它们的数据视图显示的category不一样

wulamao opened a new issue #10284: scatter3D与2D使用同一组数据,它们的数据视图显示的category不一样
URL: https://github.com/apache/incubator-echarts/issues/10284
 
 
   ### Version
   4.2.1
   
   ### Steps to reproduce
   以下代码生成的图表,直接点击数据视图,即可看到问题。
   ```js
   var data = [
           ['Distance', 'RSSI', 'Mark'],
           [0.15, 1.967096, 'corridor'],
           [0.2, 1.92011, 'corridor'],
           [0.35, 1.826796, 'corridor'],
           [0.55, 1.5644, 'lobby'],
           [0.6, 1.47243, 'lobby'],
           [0.65, 1.263094, 'lobby'],
           [0.7, 1.118026, 'lobby'],
       ];
       var symbolSize = 3.5;
       var tips = ['corridor', 'lobby'];
       var colors = [
           '#ff4000', '#7f00ff',
           '#0040ff', '#ffbf00',
           '#00ffbf', '#40ff00',
           '#bfff00', '#ff0080',
           '#ff00ff', '#00bfff',
       ];
   
       option = {
           visualMap: [{
               top: 10,
               tooltip: {
                   trigger: 'item'
               },
               type: 'piecewise',
               dimension: 2,
               categories: tips,
               inRange: {
                   color: colors,
               },
               textStyle: {
                   color: '#000'
               }
           }],
           grid3D: {
               width: '45%',
               height: '100%',
               left: '5%',
               bottom: '15%',
           },
           xAxis3D: {
               name: 'Distance',
           },
           yAxis3D: {
               name: 'Mark',
               type: 'category',
               data: tips,
           },
           zAxis3D: {
               name: 'RSSI'
           },
           dataset: {
               dimensions: [
                   'Distance',
                   'RSSI',
                   {
                       name: 'Mark',
                       type: 'ordinal'
                   },
               ],
               source: data,
           },
           grid: [{
               width: '30%',
               left: '60%',
           }],
           xAxis: [{
               type: 'value',
               name: 'Distance',
           }],
           yAxis: [{
               type: 'value',
               name: 'RSSI',
           }],
           series: [{
                   id: 'scatter3D',
                   name: 'scatter3D',
                   type: 'scatter3D',
                   symbolSize: symbolSize,
                   encode: {
                       x: 'Distance',
                       y: 'Mark',
                       z: 'RSSI',
                       tooltip: [0, 1, 2],
                   }
               },
               {
                   id: 'scatter',
                   name: 'scatter',
                   type: 'scatter',
                   symbolSize: symbolSize,
                   encode: {
                       x: 'Distance',
                       y: 'Mark',
                       tooltip: [0, 1, 2],
                   }
               }
           ],
           toolbox: {
               feature: {
                   dataView: {},
               },
           },
       };
   
       myChart.setOption(option);
   
   ```
   
   ### What is expected?
   希望3D中的Mark维度的数据和2D中的一致
   
   ### What is actually happening?
   2D和3D图的数据视图中,[2]维数据不一致,2D中是期望的字符,而3D则是顺序的数字 0,1,2...
   
   ---
   注:2D和3D图使用了同一个dataset
   ECharts version [ECharts 版本]: ECharts GL 1.1.1,ECharts 4.2.1
   Browser version [浏览器类型和版本]: Chrome内核
   OS Version [操作系统类型和版本]: Win10专业版
   Qt 5.12 MSVC2017
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   

----------------------------------------------------------------
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: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org