AleeFarook commented on issue #19486:
URL: https://github.com/apache/echarts/issues/19486#issuecomment-2503450196

   I am facing this issue too, how can i show Image in tooltip ?
   
   ```
   const option = {
         xAxis: {
           type: 'category',
           name: 'Mileage (KM)',
           data: allMileage.map(mileage => `${mileage / 1000}K`), // Convert 
mileage to K units for KM
         },
         yAxis: {
           type: 'value',
           name: 'Price (AED)',
           axisLabel: {
             formatter: '{value}K',
           },
         },
         tooltip: {
           trigger: 'item',
           triggerOn: 'click',
           renderMode: 'richText',
           formatter: function (params) {
             console.log('params===', JSON.stringify(params))
             if (params.seriesName === 'Other cars' && params.data?.ad_image) {
               return ` {image| }  <div>{value| Price: ${params.value}K}</div> 
`;
             }
           },
           // textStyle: {
           rich: {
             image: {
               height: 100, // Set image height
               width: 100,  // Set image width
               align: 'center',
               backgroundColor: {
                 image: 
'https://gratisography.com/wp-content/uploads/2024/03/gratisography-vr-glasses-800x525.jpg',
  // Dynamically set the image URL
               },
             },
             value: {
               // fontSize: 14,
               // color: '#333',
               // align: 'center',
             },
           },
           // },
         },
         series: updatedSeries,
       };
   ```


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