echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Get the height and width of the rectangle when using series->type:treemap->label:formatter function

Open dannishushu opened this issue 1 year ago • 4 comments

What problem does this feature solve?

import * as echarts from 'echarts' chart = proxy.$echarts.init(document.getElementById('myEcharts'),

2: treemap

3: chart.setOption->label->formatter:params

Can't get the height and width of the rectangle when using series->type:treemap->label:formatter function

What does the proposed API look like?

Get the height and width of the rectangle when using series->type:treemap->label:formatter function

dannishushu avatar Apr 16 '24 06:04 dannishushu

I'm afraid you can't have this information. What kind of effect do you want to make?

Ovilia avatar Apr 18 '24 07:04 Ovilia

I'm afraid you can't have this information. What kind of effect do you want to make?

@Ovilia thank you for your reply.

In label:formatter function, I want to figure out how many text rows to show out by the width and height of the rectangle.

and I fount that the order of label:formatter is ahead of labelLayout function(labelLayout can get the width and height of the rectangle).

dannishushu avatar Apr 18 '24 09:04 dannishushu

I’m sorry, but unfortunately, that’s not possible with Apache ECharts.

Ovilia avatar Apr 19 '24 06:04 Ovilia

I’m sorry, but unfortunately, that’s not possible with Apache ECharts.

@Ovilia OK,I see.

May I ask the reason why developer who use Treemap cannot control the number of lines in the label:formatter? or any other way you recommend so we can get that effect?

and we see it's easy to return the width&height data by looking at the source code.

dannishushu avatar Apr 19 '24 08:04 dannishushu