0

I'm new to apache echarts and would like to know how to solve this problem.

At lower resolutions the pie chart legend overlaps the chart, is there any way to freeze the legend or an auto adjust so that this doesn't happen?

I used this example to build my chart:

https://echarts.apache.org/examples/en/editor.html?c=pie-legend

And this is my pie chart opened in low resolution

Can anyone help me with this ?

1 Answer 1

0

Did you assure that there is enough space within your div? It would be more helpful if you can provide your JS code used on the chart creation.

But assuming that you are using the same code as in this example, it can be a grid or div (or both) problem.

In the parent div, you must declare full width (100%) and make sure that you have enough space there. After that you have to set the containLabel option to true. It will allow dynamic positioning on your components.

According to documentation:

Setting to true will help when the length of axis labels is dynamic and is hard to approximate. This will avoid labels from overflowing the container or overlapping other components.

Source: https://echarts.apache.org/en/option.html#grid.containLabel

Not the answer you're looking for? Browse other questions tagged or ask your own question.