Note that there are some explanatory texts on larger screens.

plurals
  1. POhighcharts column graph with dynamic data- column alignment off
    primarykey
    data
    text
    <p>i'm hoping that this quick description and image will ring a bell with someone who has had a similar issue and therefore a suggestion/fix.</p> <p>i have a column graph that i am adding data to dynamically (via jQuery parsing an XML file).</p> <p>for some reason, after the data is added, the alignment of the different series gets a little off. the issue fixes itself after i toggle one of the series by being visible/invisible (by clicking the series in the legend).</p> <p>when i add the data via hardcoding the numbers, just to ensure it works, it works great.</p> <p>here is the image: <img src="https://i.stack.imgur.com/vomiP.png" alt="enter image description here"></p> <p>the yellow series is the last series added to the chart, the red and purple series line up ok after toggling the visibility of one of the 5 series. </p> <p>any help would be greatly appreciated!</p> <p><strong>UPDATE with info on the data:</strong></p> <ul> <li>i have 5 series of data and 10 x-axis categories</li> <li>i am building a multidimensional array of data as i parse the XML file</li> <li>the array length is 5, with each of those 5 index's containing an array of length 10</li> <li>this is what the array looks like after it has been populated with data:</li> </ul> <p>index#: 0 value: 0,0,0,0,0,0,0,0,0,0</p> <p>index#: 1 value: 180,210,0,0,0,0,0,0,180,210</p> <p>index#: 2 value: 22,4,0,0,0,0,0,0,22,4</p> <p>index#: 3 value: 0,0,0,0,0,0,0,0,0,0</p> <p>index#: 4 value: 200,30,0,0,0,0,0,0,4,0</p> <p>i am adding the data to the chart with the following JS code:</p> <pre><code>for (var c_ary_bs = 0; c_ary_bs &lt; ary_bs_schedule_orig.length; c_ary_bs++) { chart.series[c_ary_bs].setData(ary_bs_schedule_orig[c_ary_bs]); } </code></pre> <p>hopefully that will help, thank you!</p> <p><strong>UPDATE 2, some more info</strong></p> <p>i've hard coded the data being added to the array, to help pinpoint the issue:</p> <pre><code> chart.series[0].setData([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); chart.series[1].setData([180, 210, 0, 0, 0, 0, 0, 0, 180, 210]); chart.series[2].setData([22, 4, 0, 0, 0, 0, 0, 0, 22, 4]); chart.series[3].setData([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); chart.series[4].setData([200, 30, 0, 0, 0, 0, 0, 0, 4, 0]); alert('done') </code></pre> <p>when the alert fires, the graph columns are aligned properly, after I click "ok" to dismiss the alert, the alignment issue happens, as the previous image depicts. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload