nghiepdev opened a new issue, #18258:
URL: https://github.com/apache/echarts/issues/18258

   ### What problem does this feature solve?
   
   Is there a way to custom series name `cost, users, impressions, ctr` in 
tooltip?
   
   
![image](https://user-images.githubusercontent.com/4768095/218047744-503bd80c-1a6e-4356-affa-0a9d8c336bbd.png)
   
   ```js
   const options = {
     legend: {
       data: ['cost', 'users'],
       formatter(name) {
         return `custom ${name}`;
       },
     },
     series: [
       {
         name: 'cost', // keep the name, I don't want to change in here.
         data: [1, 2, 3],
       },
       {
         name: 'users',
         data: [1, 2, 3],
       },
     ],
   };
   ```
   
   ### What does the proposed API look like?
   
   ```js
   const options = {
     legend: {
       data: ['cost', 'users'],
       formatter(name) {
         return `custom ${name}`;
       },
     },
     series: [
       {
         name: 'cost', // keep the name, I don't want to change in here.
         data: [1, 2, 3],
         tooltip: {
           label: {
             formater(name) {
               return `custom ${name}`;
             },
           },
         },
       },
       {
         name: 'users',
         data: [1, 2, 3],
         tooltip: {
           label: {
             formater(name) {
               return `custom ${name}`;
             },
           },
         },
       },
     ],
   };
   
   ```


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