Load more data problem #549
Answered
by
char101
Arnau-Gelonch
asked this question in
Q&A
-
With the new version of the setLoadDataCallback library it works differently than loadMoreData, and I don't understand how it works. Could someone show me an example of how to use the setLoadDataCallback function? |
Beta Was this translation helpful? Give feedback.
Answered by
char101
Apr 13, 2024
Replies: 1 comment
-
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
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
liihuu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this