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/05/30 04:08:26 UTC

[GitHub] [incubator-echarts] tenadolanter commented on issue #7087: Webpack+Vue项目中如何使用dataTool

tenadolanter commented on issue #7087:
URL: https://github.com/apache/incubator-echarts/issues/7087#issuecomment-636272213


   This is a example of dataTool, it worked for me well, hope helpfull to you too !
   
   `import echarts from 'echarts'`
   `import dataTool from 'echarts/extension/dataTool'`
   
   ```
   var data = dataTool.prepareBoxplotData([
               [40000, 5000, 30000],
               [20000, 3500, 15000],
               [35000, 5000, 18000],
               [30000, 3500, 15000]
           ])
           var chartOption = {
               tooltip: {
                   trigger: 'item',
                   axisPointer: {
                       type: 'shadow'
                   }
               },
               grid: {
                   left: '10%',
                   right: '10%',
                   bottom: '15%'
               },
               xAxis: {
                   type: 'category',
                   data: ['店长', '收银', '高级美容顾问', '美容顾问'],
                   boundaryGap: true,
                   nameGap: 30,
                   splitArea: {
                       show: false
                   },
   
                   splitLine: {
                       show: false
                   }
               },
               yAxis: {
                   type: 'value',
                   name: 'Bonus',
                   splitArea: {
                       show: true
                   }
               },
               series: [
                   {
                       name: 'boxplot',
                       type: 'boxplot',
                       data: data.boxData,
                       tooltip: {
                           formatter: function (param) {
                               return [
                                   'Job: ' + param.name,
                                   'upper: ' + param.data[5],
                                   'median: ' + param.data[3],
                                   'lower: ' + param.data[1]
                               ].join('<br/>')
                           }
                       }
                   },
                   {
                       name: 'Job',
                       type: 'scatter',
                       data: [30080, 16229, 20900, 19320]
                   },
                   {
                       name: 'Job',
                       type: 'scatter',
                       data: [30080, 16229, 18800, 12500]
                   },
                   {
                       name: 'Job',
                       type: 'scatter',
                       data: [30080, 16229, 21600, 15000]
                   },
                   {
                       name: 'Job',
                       type: 'scatter',
                       data: [30080, 16229, 12420, 18200]
                   },
                   {
                       name: 'Job',
                       type: 'scatter',
                       data: [30080, 16229, 10420, 8020]
                   }
               ]
   ```


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



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