Letractively / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Graph grows in size #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi I have created a application wich uses jquery. my page auto update every
2 secsonds to get new information from server. I get new value to plot flot
graph. It works fine with all other browser except IE7. where for each
refresh call, my graph size changes. it grows gradually until it becomes
huge in width and height. 
any workaround or fx for this problem.

Original issue reported on code.google.com by nikhilsh...@gmail.com on 4 Jun 2009 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
function call
-------------------------------------------------------------
 var percentCmpVal = $("#percentReduction").text();                          
$("#barCurrentsession").drawPercentBar(percentCmpVal );
---------------------------------------------------------------

actual function
----------------------------------------------------------------
(function($) {
$.fn.drawPercentBar = function(pct, options) {
var settings = $.extend({
    refColor: '#1589FF',
    dataColor: '#1569C7'
}, options || {});
    var refBar = [[0, 0], [100, 1]];
    var dataBar = [[0, 0], [pct, 1]];
    $.plot($(this),
        [{ data: refBar, color: settings.refColor },
         { data: dataBar, color: settings.dataColor}],
        {
            bars: { horizontal: true, align: "center", show: true },
            lines: { show: false },
            points: { show: false },
            yaxis: { ticks: 0 },
            grid: { clickable: true, hoverable: true },
            xaxis: {
                tickFormatter: function formatter(val, axis) {
                    return (val + "%");
                }
            }
        }
    );
};
})(jQuery);

Original comment by nikhilsh...@gmail.com on 4 Jun 2009 at 7:39

GoogleCodeExporter commented 9 years ago
Hm, maybe something is sticking out. IE sometimes treats heights as minimum 
heights
and simply expands the box. 

I don't have time to do a lot of debugging right now, but have you tried 
removing the
placeholder from the DOM and inserting it again? If you put it inside a 
container,
then something like this

$("#placeholder").remove();
$("#somecontainer").append('<div id="placeholder"
style="width:600px;height:300px"></div>')
// now do the plot
$.plot($("#placeholder"), ...)

Or you could simple empty it and reset the dimensions

$("#placeholder").html().width(600).height(300)

Original comment by olau%iol...@gtempaccount.com on 5 Jun 2009 at 5:25

GoogleCodeExporter commented 9 years ago
Wow.. tht was impressive.. it fixed that issue..! 
awesome..!

thxs. :-)

Original comment by nikhilsh...@gmail.com on 5 Jun 2009 at 7:23

GoogleCodeExporter commented 9 years ago
OK, I'll close the bug then.

Original comment by olau%iol...@gtempaccount.com on 19 Jun 2009 at 10:03

GoogleCodeExporter commented 9 years ago
Issue 170 has been merged into this issue.

Original comment by olau%iol...@gtempaccount.com on 19 Jun 2009 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 2:52