Implementation of the echarts realtime Graph

Source: Internet
Author: User

It has been a headache recently and how to implement the realtime graph. To sum up, we need to solve the following problems:

1. How to transmit Custom Data


2. What format should data be transmitted?


3. Can I perform partial refresh, that is, ajax requests or other methods?


4. Can I asynchronously refresh different divs on the same page? Will it be slow if there are too many divs?


5. What is the mechanism for implementing the realtime graph? Can it be customized?


Recently, we have been studying echarts to update the real-time data interface of adddata. So I did an experiment separately. The source code is as follows:


The answer to the above five questions is as follows:

Data can be stored in a database or online. as you like, JSON data can be obtained through AJAX or jquery databases and then converted into an array and transmitted to echarts. The most common format is json format. No matter ajax, jsonp, or websocket, it can be used as a way to obtain data. This is a data-level thing that will not be attached to charts. Of course, you can use ajax to obtain data and then display it, basically, ajax data is used in our actual applications ~ The chart provides the loading Method for retrieving data as a transitional display ~



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.