1. Chris Leonello
  2. jqplot
Issue #530 new

Problem in setBarWidth for BarRenderer

Arthur Lutz
created an issue

When using BarRenderer with a colored bars I seem to be getting a wrong bar width for which I haven't found a solution by modifying the options. See first screenshot (Screenshot57) for the result I'm getting.

The only solution I found was to change the formula by uncommenting https://bitbucket.org/cleonello/jqplot/src/058e50b37d16/src/plugins/jqplot.barRenderer.js#cl-257 . What is this commented formula ? The second screenshot shows the result with that change (looks more like what I expected) in Screenshot-58.png.

Is this a bug or am I missing something ? I've attached the piece of javascript if it can help to debug.

Comments (4)

  1. andywarren86

    I am having the same issue.

    Looking at the code the columns are too large because the formula doesn't divide by the number of data points (nvals) but instead it divides by nbins, which appears to be half the number of ticks?

    As Arthur pointed out there is a better formula which has been commented out that does take nvals into account.

  2. Log in to comment