Skip to main content
Nintex Community Menu Bar
Question

Conditional re-size of chart

  • July 9, 2024
  • 3 replies
  • 15 views

Forum|alt.badge.img+2

I am relatively new to highchart API and need some assistance with re-size the chart image based on certain condition. Following is the code snippet I am using. But it is not having any impact on the size of the chart:

var chartObj = arguments[0],$ = skuid.$;
if(some condition…) {
$.extend(true, chartObj.chart[0],{
    width:100,
    height:100
});
}

This topic has been closed for replies.

3 replies

Forum|alt.badge.img+18

You may need to add ‘px’ or ‘%’… 100px.

If that doesn’t work…
 I occasionally have had trouble with the $.extend syntax (probably just my own mistakes). But I think you can just set the width and height directly:

chartObj.chart[0].width = 100px;
chartObj.chart[0].height = 100px;


Forum|alt.badge.img+6
  • Nintex Employee
  • July 9, 2024

Riju,

I think it should be chartObj.chart, not chartObj.chart[0]. Both of them are numbers (highcharts interprets them as px), so you shouldn’t need to specify “px” either. 


Forum|alt.badge.img+2

Thanks for your responses. But it still does not have any impact on the image. This is however working if I try it on a standalone highchart image. I need to spend some more time on it and check if I am missing something.