New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: d[h].update is not a function #8355

Closed
o3o opened this Issue May 18, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@o3o

o3o commented May 18, 2018

When I call

// res is 
//[[[1508332985000, 2.983610],[1508332986000, 5.983610],[1508332987000, 8.983610],[1508332988000, 80.983610],[1508332989000, 7.983610]]]

function setSeries (id, res) {
  let c = chart[id];
  if (c && res !== null) {
    var seriesSize = Math.min(res.length, c.series.length);
    for (let i = 0; i < seriesSize; i++) {
      c.series[i].setData(res[i], false, false, true);
    }
    c.hideLoading();
    c.redraw(true);
  } else {
    console.log('setSeries: series is null');
  }
}

I have:

TypeError: d[h].update is not a function] highcharts.js:formatted:6939

Product version

6.1.0

Affected browser(s)

Firefox 60.0

Thank you

@sebastianbochan

This comment has been minimized.

Show comment
Hide comment
@sebastianbochan

sebastianbochan May 21, 2018

Contributor

Hi @o3o,
Thank you for reporting. Could you replicate your example as live demo on the jsfiddle? It will allow us to debug it and find a fix.

Unfortunately from your piece of code its impossible at this moment.

Contributor

sebastianbochan commented May 21, 2018

Hi @o3o,
Thank you for reporting. Could you replicate your example as live demo on the jsfiddle? It will allow us to debug it and find a fix.

Unfortunately from your piece of code its impossible at this moment.

@o3o

This comment has been minimized.

Show comment
Hide comment
@o3o

o3o May 21, 2018

Unfortunately from your piece of code its impossible at this moment.

You're right, but it's hard to replicate my code into jsfiddle, because it's complex (points are generated from a vibe.d application and passed by web socket)...I will try to simplify.
Thank you !

o3o commented May 21, 2018

Unfortunately from your piece of code its impossible at this moment.

You're right, but it's hard to replicate my code into jsfiddle, because it's complex (points are generated from a vibe.d application and passed by web socket)...I will try to simplify.
Thank you !

@mattjvincent

This comment has been minimized.

Show comment
Hide comment
@mattjvincent

mattjvincent Jul 7, 2018

I have a similar situation where I get the same error with Highstock 6.1.0

highstock.src.js:26315 Uncaught TypeError: oldData[pointIndex].update is not a function
    at object.<anonymous> (highstock.src.js:26315)
    at Array.forEach (<anonymous>)
    at H.each (highstock.src.js:1730)
    at object.updateData (highstock.src.js:26292)
    at object.setData (highstock.src.js:26442)
    at updatePeaks ((index):984)
    at r.fn.init.user_mouseup_callback ((index):1191)
    at r.fn.init.notify_mouse_up_implicit (jquery.nstSlider.js:957)
    at HTMLDocument.drag_end_func (jquery.nstSlider.js:857)
    at HTMLDocument.dispatch (jquery-3.2.1.min.js:3)

What I have is a scatterplot with a threshold value as a slider. If the score is above the threshold value, I update the chart with the following code:

                $.each(allScores, function (index, element) {
                        if (element[2] >= thresholdValue) {
                            newData.push({
                                x: element[0], // x
                                y: element[1], // y
                                score: element[2],
                                user: element[3]
                            });
                        }
                    }
                });
            scatterPlot.series[0].setData(newData);

When debugging, I can see that when the error occurs,

 } else if (pointOptions !== options.data[pointIndex]) {
		                    oldData[pointIndex].update(
		                        pointOptions,
		                        false,
		                        null,
		                        false
		                    );

oldData[pointIndex] is an Object with attributes clientX, i, plotX, plotY, and x,
but when the error does not occur, oldData[pointIndex] is a Point with attributes of category, color, graphic, isInside, isNull, etc.

I'm not sure if that helps or not, but my code is complex and generated on the fly server side. I am using the boost module as well.

mattjvincent commented Jul 7, 2018

I have a similar situation where I get the same error with Highstock 6.1.0

highstock.src.js:26315 Uncaught TypeError: oldData[pointIndex].update is not a function
    at object.<anonymous> (highstock.src.js:26315)
    at Array.forEach (<anonymous>)
    at H.each (highstock.src.js:1730)
    at object.updateData (highstock.src.js:26292)
    at object.setData (highstock.src.js:26442)
    at updatePeaks ((index):984)
    at r.fn.init.user_mouseup_callback ((index):1191)
    at r.fn.init.notify_mouse_up_implicit (jquery.nstSlider.js:957)
    at HTMLDocument.drag_end_func (jquery.nstSlider.js:857)
    at HTMLDocument.dispatch (jquery-3.2.1.min.js:3)

What I have is a scatterplot with a threshold value as a slider. If the score is above the threshold value, I update the chart with the following code:

                $.each(allScores, function (index, element) {
                        if (element[2] >= thresholdValue) {
                            newData.push({
                                x: element[0], // x
                                y: element[1], // y
                                score: element[2],
                                user: element[3]
                            });
                        }
                    }
                });
            scatterPlot.series[0].setData(newData);

When debugging, I can see that when the error occurs,

 } else if (pointOptions !== options.data[pointIndex]) {
		                    oldData[pointIndex].update(
		                        pointOptions,
		                        false,
		                        null,
		                        false
		                    );

oldData[pointIndex] is an Object with attributes clientX, i, plotX, plotY, and x,
but when the error does not occur, oldData[pointIndex] is a Point with attributes of category, color, graphic, isInside, isNull, etc.

I'm not sure if that helps or not, but my code is complex and generated on the fly server side. I am using the boost module as well.

@mattjvincent

This comment has been minimized.

Show comment
Hide comment
@mattjvincent

mattjvincent Jul 7, 2018

Here is a fiddle that will create the error.

Error Fiddle at http://jsfiddle.net/ebuTs/15502/

When updatePoints is set to true, the error occurs, false it will not.

        chart.series[0].setData([
                {x:129.9, y:40, user: 'joe'},
                {x:29.9, y:20, user: 'sue'},
                {x:49.9, y:30, user: 'moe'},
                {x:139.9, y:40, user: 'ned'},
                {x:19.9, y:20, user: 'ted'}
                ],
                true, // redraw
                false, // animation
                false); // updatePoints=true, error occurs

mattjvincent commented Jul 7, 2018

Here is a fiddle that will create the error.

Error Fiddle at http://jsfiddle.net/ebuTs/15502/

When updatePoints is set to true, the error occurs, false it will not.

        chart.series[0].setData([
                {x:129.9, y:40, user: 'joe'},
                {x:29.9, y:20, user: 'sue'},
                {x:49.9, y:30, user: 'moe'},
                {x:139.9, y:40, user: 'ned'},
                {x:19.9, y:20, user: 'ted'}
                ],
                true, // redraw
                false, // animation
                false); // updatePoints=true, error occurs

@sebastianbochan sebastianbochan added Bug and removed Pending reply labels Jul 9, 2018

@sebastianbochan

This comment has been minimized.

Show comment
Hide comment
@sebastianbochan

sebastianbochan Jul 9, 2018

Contributor

Hi @mattjvincent,
Thank you for the valuable demo. You are right its a bug and its related with boost module. Without that it works properly.

Contributor

sebastianbochan commented Jul 9, 2018

Hi @mattjvincent,
Thank you for the valuable demo. You are right its a bug and its related with boost module. Without that it works properly.

@hunguyen75

This comment has been minimized.

Show comment
Hide comment
@hunguyen75

hunguyen75 Aug 10, 2018

@sebastianbochan , thanks for the responses. I ran into similar issue like @mattjvincent. Any update on this bug at all?

hunguyen75 commented Aug 10, 2018

@sebastianbochan , thanks for the responses. I ran into similar issue like @mattjvincent. Any update on this bug at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment