user1517108
user1517108

Reputation: 2415

Combining drag of jquery to change highcharts Height using CSS

BACKGROUND:

I have following two examples with me:

1: Change the height of a div using drag with jquery (not jqueryui). (http://jsfiddle.net/QpqX8/)c

2: Change the height of highcharts div due to window resize using CSS. Link and jsbin

SOLUTION REQUIRED:

I want to combine above two examples so that when I drag the div boundary, the highcharts height should change (but not width).

I am a novice in CSS and tried a few combinations of taking part of code from one and merging with another.... but sadly not able to make it work. If anyone can help me pick out the solution from this, it will be great. Thanks again.

Upvotes: 0

Views: 698

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Example for you: http://jsfiddle.net/QpqX8/128/

Just in your drag method add setSize() to resize chart:

drag: function (event, ui) { 
    var height = ui.offset.top; 
    $("#container").highcharts().setSize(null, height); 
}

Upvotes: 1

Related Questions