100pah opened a new pull request #14473:
URL: https://github.com/apache/echarts/pull/14473


   
   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [x] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   ## Details
   
   
   + Make component tooltip inherit cascade correct: itemOption.tooltip -> 
componentOption.tooltip -> globalOption.tooltip
   (previous incorrect cascade: itemOption.tooltip -> globalOption.tooltip
   + Enable trigger component tooltip by 
   ```js
   chart.dispatchAction({ 
       type: 'showTip', 
       toolboxIndex: 0, 
       name: 'someTootboxItemName' 
   });
   // or 
   chart.dispatchAction({ 
       type: 'showTip', 
       legendId: 'legend_id', 
       name: 'someLegendItemName' 
   });
   ```
   
   To make (2) happen, this commit migrate `ECElement['tooltip']` to 
ECData['tooltipConfig']['option'],
   and add other info in ECData['tooltipConfig']:
   ```ts
   interface ECData {
       // ...
       tooltipConfig?: {
           // Used to find component tooltip option, which is used as
           // the parent of tooltipConfig.option for cascading.
           // If not provided, do not use component as its parent.
           // (Set manatary to make developers not to forget them).
           componentMainType: ComponentMainType;
           componentIndex: number;
           // Target item name to locate tooltip.
           name: string;
           option: ComponentItemTooltipOption<unknown>;
       };
   }
   ```
   to locate a tooltipable component element by a payload.
   
   ## Test case
   
   `test/tooltip-component.html`
   


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



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

Reply via email to