Issue #24 resolved

0.8 Falling over on this chart.

Anonymous created an issue

I'm running the following: $.jqplot('curr_sparkline', [myvalues], { gridPadding: {top:0, right:0, bottom:0, left:0}, axes: { xaxis: { showTicks: false, showTickMarks: false }, yaxis: { showTicks: false, showTickMarks: false } }, title: { text: '', // title for the plot, show: false }, series: [{ lineWidth: 1, markerOptions: { show: true, // wether to show data point markers. style: 'filledCircle', // circle, diamond, square, filledCircle. // filledDiamond or filledSquare. lineWidth: .5, // width of the stroke drawing the marker. size: 2, // size (diameter, edge length, etc.) of the marker. color: '#666666', // color of marker, set to color of line by default. shadow: false // wether to draw shadow on marker or not. } }], grid: { drawGridLines: false, gridLineColor: '#fffdf6', // **Color of the grid lines. background: '#fffdf6', // CSS color spec for background color of grid. borderColor: '#999999', // CSS color spec for border around grid. borderWidth: 1, shadow: false } });

My data looks like: 1242573966, 14400 1242573966, 5000 1242573966, 0

This works fine with the 0.7.1 version, but falls over when I've bumped up to the 0.8 version.

Comments (8)

  1. Chris Leonello repo owner

    Can you upload a clean copy of the source you posted as an attachment? Seems the wiki engine has modified what you've posted, I'm sure some of it is supposed to be comments.

  2. Chris Leonello repo owner

    This seems to work for me. I copied as best I could the code you posted. I've attached the html file I used ("test17.html"). Take a look at it and let me know if I did not copy over some of the options correctly.

  3. Anonymous

    See attached for the updated test file with the array data more similar to what I'm using.

    After receiving your test file, I was able to run the test successfully, and then transfered that into my program, and voila, it falls over. What I discovered is that I've got a "unique" function that is declared in my array prototype, so the array has 9 elements when a for loop is set up the way you did it.

    If you look at line 1189 of jquery.jqplot.js, if I make the following change to the setup of the for loop:

    original:

    for (var n in ra) {
                    this.axes[ra[n]].pack({position:'absolute', top:0, right:rapad[n]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
                }
                // this.axes.y2axis.pack({position:'absolute', top:0, right:0}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
    

    modified:

    for (var n=0, len_n=ra.length; n<len_n; n+=1) {
                    this.axes[ra[n]].pack({position:'absolute', top:0, right:rapad[n]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
                }
                // this.axes.y2axis.pack({position:'absolute', top:0, right:0}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
    

    This no longer falls over as it only iterates over the array values themselves. Hrm, I'm not seeing where to attach the file, I'll go ahead and post this and then sort out that bit.

  4. Chris Leonello repo owner

    Thanks for posting the fix. I've updated the core file and attached it to this ticket. I'll push the changes to the repository later today. I changed the loop structure on that loop and a couple other loops to make them more efficient. Let me know how this works.

  5. Log in to comment