Issue #279 resolved

Groups > 3 Causes Alignment Issues

Rfvgyhn
created an issue

0.9.7r635

When there are more than three groups, the group labels don't align properly after the third label. Modifying the stackedCategoryAxis example to add a fourth group like this shows the problem. {{{ line1 = [20, 10, 20, 30, 40, 50, 10, 20]; line2 = [80, 90, 80, 70, 60, 50, 20, 10]; xticks = ['2010', '2040', '2010', '2040', '2010', '2040', '2010', '2040']; plot1 = $.jqplot('chart1', [line1, line2], { stackSeries: true, grid:{ drawGridlines:true, background: '#ffffff', borderWidth: 0, shadow: false }, seriesDefaults:{ renderer:$.jqplot.BarRenderer, yaxis: 'y2axis', rendererOptions: { groups: 4, barWidth: 35 } }, series:[ {color:'red'}, {color:'green'} ], axes:{ xaxis:{ renderer:$.jqplot.CategoryAxisRenderer, ticks: xticks, rendererOptions: { groupLabels:['Onshore', 'Coastal', 'Offshore', 'TestFour'] }, tickOptions:{ showGridline:false, markSize:0 } }, y2axis: { ticks:[0, 100], tickOptions:{formatString:'%d\%'} } } }); }}}

I attached a modified categoryAxisRenderer.js (not sure how to push patches) with what I believe to be the fix. In the .pack() method, I changed the group label drawing logic a bit.

Comments (6)

  1. Anonymous

    I made some changes for that issue at version 1.0b2. Please advise on how I should pull the changes.

    Thanks

  2. Log in to comment