Skip to content

Load more data problem #549

Answered by char101
Arnau-Gelonch asked this question in Q&A
Discussion options

You must be logged in to vote

Something like this

chart.setLoadDataCallback(({type, data, callback}) => {
  if (type === 'backward') {
    const timestamp = data.timestamp;
    const {result, more} = ...; // fetch data
    if (Array.isArray(result) && result.length) {
      callback(result, more);
    } else {
      callback([], false); // callback must be called even on empty data, otherwise it will stuck
    }
  } else { // forward
    // same with backward
  }
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by liihuu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants