xxBingoBongoxx commented on issue #9267:
URL: https://github.com/apache/echarts/issues/9267#issuecomment-851429745


   > You can achieve this goal by using "formatter" and "rich".
   > 
   > You can achieve something like that by using a formatter and rich:
   > 
   > ```
   > var richIcons = {
   >     nodeAa: {
   >         height: '120',
   >         backgroundColor: {
   >             image: './data/asset/img/weather/sunny_128.png'
   >         }
   >     },
   >     nodeAb: {
   >         height: 120,
   >         backgroundColor: {
   >             image: './data/asset/img/weather/cloudy_128.png'
   >         }
   >     },
   >     nodeBa1: {
   >         height: 260,
   >         backgroundColor: {
   >             image: './data/asset/img/weather/showers_128.png'
   >         }
   >     }
   > };
   > 
   > option = {
   >     series: [{
   >         type: 'treemap',
   >         label: {
   >           normal: {
   >                 formatter: function (params) {
   >                     return '{' + params.name + '|}';
   >                 },
   >                 rich: richIcons,
   >             },
   >         },
   >         data: [{
   >             name: 'nodeA',            // First tree
   >             value: 10,
   >             children: [{
   >                 name: 'nodeAa',       // First leaf of first tree
   >                 value: 4
   >             }, {
   >                 name: 'nodeAb',       // Second leaf of first tree
   >                 value: 6
   >             }]
   >         }, {
   >             name: 'nodeB',            // Second tree
   >             value: 17,
   >             children: [{
   >                 name: 'nodeBa',       // Son of first tree
   >                 value: 20,
   >                 children: [{
   >                     name: 'nodeBa1',  // Granson of first tree
   >                     value: 20,
   >                 }]
   >             }]
   >         }]
   >     }]
   > };
   > ```
   
   It doesn't work


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