Possible to make chart height dynamic?

The height of the chart area seems fixed, so adding legends often results in charts getting squashed. E.g., below is the donut chart in the demo with and without a legend. Is there a way to tell the chart area to grow vertically rather than shrinking the chart?

3 Replies

SK Sriram Kiran Senthilkumar Syncfusion Team December 7, 2020 11:07 AM UTC

Hi Richard, 
  
Greetings from Syncfusion. We have analyzed your scenario with the provided information at our end and we would like to share some information regarding the rendering behavior of the chart with legends enabled. Currently, when you try to render the chart with its legends enabled, 70 percent of the container space will be taken by the chart and 30 percent of the container space will be taken by its legend for rendering. This is the default behavior when you have not set any certain values for height and width properties of the Legend. So, if you want to customize the height of the chart with legend enabled then you can use the height and width properties of the Legend to set custom height and width and also to mention that, if you have more legends in the chart that can’t be accommodated in the provided custom height and width, then you can set the overflowMode property of the Legend to LegendItemOverfloeMode.scroll or LegendItemOverflowMode.wrap according to your requirement. 
 
Also, we have created a simple circular chart sample and attached below in which we have used the width, height and overflowMode of the Legend to customize the size of the legend in the chart container. 
  
Please check with the above sample and get in touch with us if you require further assistance on this. 
 
For further reference on the legend and its properties, please check the user guide below. 
API references of height and widht proeprties of the Legend
  
Regards, 
Sriram Kiran 



RC Richard Coutts December 7, 2020 05:49 PM UTC

Ah. I should have guessed to experiment with the container's height. Thanks!!


SK Sriram Kiran Senthilkumar Syncfusion Team December 8, 2020 10:23 AM UTC

Hi Richard, 
  
Most welcome. Kindly revert us if you have any queries. We are always happy in assisting you. 
  
Regards, 
Sriram Kiran 


Loader.
Up arrow icon