admin管理员组文章数量:1405312
We want to show loading icon when the data loads and chart is made in highcharts.
Below is pseudo code:
// service call
// data is pushed in data set
// and that data is used in highcharts.
$('Chart_name').highcharts({
});
We want to show loading icon when the data loads and chart is made in highcharts.
Below is pseudo code:
// service call
// data is pushed in data set
// and that data is used in highcharts.
$('Chart_name').highcharts({
});
Share
Improve this question
edited Feb 3, 2017 at 7:47
ppasler
3,7296 gold badges35 silver badges54 bronze badges
asked Feb 3, 2017 at 6:59
user2820794user2820794
371 silver badge2 bronze badges
3
- 2 What is the problem then? – VPK Commented Feb 3, 2017 at 7:10
- Please explain what you have tried, what you are expecting, if you have read the handbook. – pinturic Commented Feb 3, 2017 at 7:13
- You can set background image - see the answers here, read API for other options api.highcharts./highcharts/loading - example jsfiddle/86nuH/127 – morganfree Commented Feb 3, 2017 at 11:29
1 Answer
Reset to default 5Render chart without data, then show loading screen, fetch data, hide loading screen.
Example:
// Options without data
const options = {
series: [{
data: [],
type: 'column'
}]
}
// Redner chart
const chart = Highcharts.chart('container', options)
// Simulate fetch request timeout, get data after some delay
setTimeout(() => {
const data = [1,2,3]
chart.hideLoading()
chart.series[0].setData(data)
}, 2000)
// Show loading screen
chart.showLoading()
Live example: https://jsfiddle/hLj1advd/
本文标签: Highcharts show loading icon when fetching data in javascriptStack Overflow
版权声明:本文标题:Highcharts show loading icon when fetching data in javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744331508a2600986.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论