Height does not set to pannel height

When panel resized width is getting applied according to panel width but height is not resizing according panel height.

Tried using in ts =>this.chartComponent.chartResize(this.event)

In html=> ejs-Charts => style='display:block; width: 100%; height: 100%'

height_issue.png

1 Reply

DG Durga Gopalakrishnan Syncfusion Team July 28, 2021 01:06 PM UTC

Hi Shivani, 

Greetings from Syncfusion. 

We request you to specify height and width as 100% for chart and refresh the chart while resizing the panel. We have prepared sample based on your requirement. Please check with below snippet and sample. 

app.component.css 
#chartcontainer{ 
    width: 100%; 
    height: 100%; 
  } 
 
app.component.html 
<ejs-chart #chart style='display:block;' width="100%" height="100%" align='center'> 
</ejs-chart> 
 
app.component.ts 
onResizeStop(args: any) { 
    if ( args.element && args.element.querySelector('.e-panel-container .e-panel-content ejs-chart') ) { 
      const chartObj = args.element.querySelector('.e-panel-container .e-panel-content ejs-chart').ej2_instances[0]; 
      chartObj.height = '100%'; 
      chartObj.width = '100%'; 
      chartObj.refresh(); 
    } 
  } 

 
 

Kindly revert us if you have any concerns. 

Regards, 
Durga G 


Loader.
Up arrow icon