yqtian-se opened a new issue, #21863:
URL: https://github.com/apache/echarts/issues/21863

   ### Version
   
   6.1.0 (also current `master` and 5.6.0)
   
   ### Link to Minimal Reproduction
   
   
https://echarts.apache.org/examples/en/editor.html?code=lVLBatwwEL37KwZDkQ2LsymlBC89lJxKS1Oa9BRymF2PbTW2tEijbLfG_96RnF229FRfLGlGT2_ee1dX8BE-f_sEHYaO4KC5BwTPx4Fgr3fP5CrIv4ZxSw6sGY459LohD9xL3WrDco6mWfbOdo68hy26TSbI-Xdtuhx8bw_LjRccAgF6eeLc7KQHCs96GMDYE2hZZS_oFiIePsCUAZhEo4bp1BSXEbyGFgdPMK_OsP-UpCgQ8bH_BWAXaCXKNNzXcP0uQmXzJsvaYHasrYERn-luH5cyhvAtE1tHHJxJSwBPTpNgPt5tf9KOK_Red6ZYigB83FMNKnmgIs_44S_tv2gjhQkG-d9H7Lj5i8qpuyFGPcRya92InKZTU1J8fqNWcmz4Xv8WhLc3F9eQUWhNizU1vL9ZgcExsvkhI42kYH5KvaLN4sZj-j2V8Vh0mLPMpuHFpQsl1OKWKkUpicKDuB9EhRQq_5qMSo61hx2K9dw7SUlKzS0aY1kExCbasSfHIh7YFoJpqBUpGihiNSZHrVWZpwhKeFKWBLFxeDBV5okfZAQbuDibVSzujMfbHh1X0vJK-JJ7xFGlUJehr9frdbn5Aw&enc=deflate
   
   ### Steps to Reproduce
   
   We show a KPI as a gauge with a style picker. "Number only" hides both the 
pointer and the progress bar; "Ring" keeps the pointer
   hidden and turns the progress bar on. Picking "Ring" after "Number only" 
throws, and no ring is drawn:
   
   ```js
   // A KPI gauge with a style picker. "Number only" hides the pointer and the 
progress bar;
   // "Ring" shows the value as a progress ring (still no pointer).
   var styles = {
     number: { pointer: { show: false }, progress: { show: false } },
     ring: { pointer: { show: false }, progress: { show: true, width: 14 } }
   };
   
   function makeOption(style) {
     return {
       series: [Object.assign({
         type: 'gauge',
         axisLine: { lineStyle: { width: 14 } },
         detail: { formatter: '{value}%', fontSize: 28 },
         data: [{ value: 68, name: 'Uptime' }]
       }, styles[style])]
     };
   }
   
   option = makeOption('number');
   
   // The user picks "Ring". This call throws
   // "Cannot read properties of undefined (reading '0')" and no ring is drawn.
   setTimeout(function () {
     myChart.setOption(makeOption('ring'));
   }, 1000);
   ```
   
   Stripped down:
   
   ```js
   option = {
     series: [
       {
         type: 'gauge',
         pointer: { show: false },
         progress: { show: false },
         data: [{ value: 40 }]
       }
     ]
   };
   
   setTimeout(function () {
     // Turn the progress bar on. Throws:
     // TypeError: Cannot read properties of undefined (reading '0')
     myChart.setOption({ series: [{ progress: { show: true } }] });
   }, 1000);
   ```
   
   <img width="810" height="300" alt="browser-canvas-master" 
src="https://github.com/user-attachments/assets/78b8c54c-2df4-4275-af91-03a82ed21cc5";
 />
   
   ### Current Behavior
   
   The `setOption` call throws `TypeError: Cannot read properties of undefined 
(reading '0')`, and the progress bar is not drawn.
   
   It works when the pointer is shown, or when the progress bar is on from the 
start.
   
   ### Expected Behavior
   
   No error; the value is shown as a ring, as when the page starts with "Ring" 
selected.
   
   ### Environment
   
   ```markdown
   - OS: macOS 26.6.2 (25G83)
   - Browser: Google Chrome 158.0.8127.36
   - Framework: none
   ```
   
   ### Any additional comments?
   
   In `GaugeView._renderPointer`, `this._progressEls` is only set inside `if 
(showProgress || showPointer)`. When the first render shows
   neither, it stays `undefined`, and the next render reads 
`oldProgressData[oldIdx]` from it in the `update` callback.


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