echarts-bot[bot] commented on issue #18057:
URL: https://github.com/apache/echarts/issues/18057#issuecomment-1346198677

   @Valar103769 It seems you are not using English, I've helped translate the 
content automatically. To make your issue understood by more people and get 
helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] How to link object array data with pie graph?
   
   **BODY**
   
   ### Version
   
   latest
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?c=dataset-link
   
   ### Steps to Reproduce
   
   ```js
   setTimeout(function () {
     option = {
       legend: {},
       tooltip: {
         trigger: 'axis',
         showContent: false
       },
       dataset: {
         dimensions: ['hour', 'old user', 'new user', 'second new user'],
         source: [
           { hour: '2022-12-06 00', old user: '200', new user: '32', second new 
user: '136' },
           { hour: '2022-12-06 01', new user: '39', old user: '196', second new 
user: '131' },
           { hour: '2022-12-06 02', new user: '92', old user: '166', new user: 
'39' },
           { hour: '2022-12-06 03', new user: '30', old user: '170', second new 
user: '119' },
           { hour: '2022-12-06 04', new user: '102', new user: '31', old user: 
'202' },
           { hour: '2022-12-06 05', new user: '38', old user: '372', second new 
user: '148' },
           { hour: '2022-12-06 06', new user: '47', old user: '187', second new 
user: '139' },
           { hour: '2022-12-06 07', old user: '162', new user: '39', second new 
user: '102' },
           { hour: '2022-12-06 08', old user: '169', new user: '34', second new 
user: '104' },
           { hour: '2022-12-06 09', new user: '37', old user: '356', second new 
user: '134' },
           { hour: '2022-12-06 10', new user: '136', new user: '37', old user: 
'307' },
           { hour: '2022-12-06 11', new user: '100', new user: '48', old user: 
'274' },
     
         ]
       },
       xAxis: { type: 'category' },
       yAxis: { gridIndex: 0 },
       grid: { right: '50%', left: 0 },
       series: [
         {
           type: 'line',
           smooth: true,
           seriesLayoutBy: 'row',
           emphasis: { focus: 'series' }
         },
         {
           type: 'line',
           smooth: true,
           seriesLayoutBy: 'row',
           emphasis: { focus: 'series' }
         },
         {
           type: 'line',
           smooth: true,
           seriesLayoutBy: 'row',
           emphasis: { focus: 'series' }
         },
         {
           type: 'line',
           smooth: true,
           seriesLayoutBy: 'row',
           emphasis: { focus: 'series' }
         },
         {
           type: 'pie',
           id: 'pie',
           radius: '30%',
           center: ['70%', '50%'],
           emphasis: {
             focus: 'self'
           },
           label: {
             // formatter: '{b}: {@2012} ({d}%)'
           },
           encode: {
             // tooltip: ['old user', 'new user', 'second new user']
           }
         }
       ]
     };
     myChart.on('updateAxisPointer', function (event) {
       const xAxisInfo = event.axesInfo[0];
       if (xAxisInfo) {
         const dimension = xAxisInfo. value + 1;
         console.log('dimension', xAxisInfo, dimension);
         myChart.setOption({
           series: {
             id: 'pie',
             // label: {
             // formatter: '{b}: {@[' + dimension + ']} ({d}%)'
             // },
             encode: {
               itemName: 'product',
               value: '2013'
             }
           }
         });
       }
     });
     myChart. setOption(option);
   });
   
   ```
   
   
   ### Current Behavior
   
   Pie diagram configuration without object array structure
   
   ### Expected Behavior
   
   How to configure the object array structure for the encode of the pie graph?
   
   ### Environment
   
   ```markdown
   - OS:
   -Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_
   </details>


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to