fangfcg commented on issue #10681: 如何通过设置zlevel实现局部更新?
URL: 
https://github.com/apache/incubator-echarts/issues/10681#issuecomment-502477600
 
 
   code
   
   ```javascript
   /*below is the original settings*/
   async getFuelmap () {
         var res = await 
         axios.get('http://localhost:8080/static/map.json')
         this.fuelmap = res.data.result.map(function (item) {
             return [item['j'], item['i'], item['fc'].toFixed(2)] 
           })
           var mapBox = document.getElementsByClassName('mapbox')[0]
           mapBox.style.width = '350px'
           mapBox.style.height = '350px'
           var fuelmapElement = document.getElementById('fuelmap')
           fuelmapElement.style.width = mapBox.style.width
           fuelmapElement.style.height = mapBox.style.height
           this.mapChart = echarts.init(fuelmapElement)
           var optionFuelmap = {
             title:{
               text: 'map'
             },
             tooltip: {
               position: 'top'
             },
             animation: false,
             grid: {
               height: '80%',
               y: '10%'
             },
             xAxis: {
               type: 'category',
               data: this.speedList,
               splitArea: {
                 show: true
               }
             },
             yAxis: {
               type: 'category',
               data: this.torqueList,
               splitArea: {
                 show: true
               },
             },
             visualMap: [
               {
                 min: 0,
                 max: 1,
                 calculable: true,
                 orient: 'horizontal',
                 left: 'center',
                 bottom: '15%',
                 show: false,
                 seriesIndex: [0],
               },
               {
                 left: 'right',
                 top: '10%',
                 dimension: 2,
                 min: 0,
                 max: 1,
                 calculable: false,
                 show: false,
                 precision: 0.1,
                 inRange: {
                   symbolSize: [10,20]
                 },
                 seriIndex:[1,2]
               }
             ],
             series: [
               {
                 name: 'map',
                 type: 'heatmap',
                 data: this.fuelmap,
                 label: {
                   show: false,
                   normal: {
                     show: false
                   }
                 },
                 itemStyle: {
                     emphasis: {
                       shadowBlur: 10,
                       shadowColor: 'rgba(0, 0, 0, 0.5)'
                     }
                 }
               },
               {
                 name:'before',
                 type:'scatter',
                 color:'red',
                 data:this.beforePoint,
               },
               {
                 name:'after',
                 type:'scatter',
                 color:'blue',
                 data:this.afterPoint,
               }
             ]
           }
           this.mapChart.setOption(optionFuelmap)    
       }
   
   
   /*below is the timer*/
   setInterval(() => {
           this.mapChart.setOption({
               series:[
               {
                 /*I don't want to refresh this plot*/
               },
               {
                 name: 'before',
                 data: [[torqueBeforePos, speedBeforePos,this.fuelBefore]]
               },
               {
                 name: 'after',
                 data: [[torqueAfterPos, speedAfterPos, this.fuelAfter]]
               }
               ]
             })
         }, 1000);
   
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to