yianni-ververis / SenseUI-BarChart

A more elegant and mobile friendly bar chart.
5 stars 0 forks source link

It is not issue but it can add for the next version. #4

Open jorgesanchez33 opened 7 years ago

jorgesanchez33 commented 7 years ago

This graph library is great, I used once and it works perfect. However, for some reasons, the extension shows scrollbar even if there is space for the graph. We were testing in an ipad. We tried to adjust many properties but i doesnt work.

Finally, after i checked the code, i found that the height for SVG sometimes is bigger than height of extension, and this produces the scrollbar,

I just hacked the code and added this: var svgHeight = (vars.bar.grouped && !vars.stacked)?vars.canvasHeight*(vars.qcx-1):vars.canvasHeight ;

    if (vars.height <= svgHeight){
        svgHeight = vars.height - ((vars.bar.padding*2)+3);
    }

    var svg = d3.select('#' + vars.id + ' .content')
        .append('svg')
        .attr({'width':vars.width,'height':svgHeight});

and it works.

I am not sure if this can be a common problem for other users but it worked in my case and i just wanted to share with everybody.