js flot 0.8.3 pie chart not resizing

369 views Asked by At

I am using js flot version 0.8.3 with bootstrap 3. The resize plugin is working fine with bar chart, but not with pie chart. Would appreciate help.

I have just included the jquery, flot and resize plugins, and drew my chart like this:

var plot = $.plot($("#placeholder"), data, options);

Here is a jsfiddle of the pie chart:

https://jsfiddle.net/w999qvo9/

1

There are 1 answers

2
Raidri On

Your container div for the pie chart has fixed width and height, so it never gets resized, use relative dimensions (e.g. viewport units) and it works (see updated fiddle):

#placeholder{
    width: 95vw;
    height: 95vh;
}