I’m trying to force a height and width (180 and 300) on charts inside a shortcode that creates a related chart in a small div next to an article, but i’m not being able to do it.
This is the highcharts php i found for width:

       $chartObj->setWidth( WDTTools::defineDefaultValue( $constructedChartData, 'width', 0 ) );





       if( !empty( $renderData['render_data']['options']['width'] ) ){
       $this->setWidth( $renderData['render_data']['options']['width'] );





          public function setWidth( $width ){
          $this->_width = $width;
   }

If i do getWidth() i get the correct width for the graph but i’m not really sure how i can manipulate that value since all the questions and fiddles i see for highcharts are in javascript.

Read more here: Set width and height for highcharts


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: