In this example there is a delay in the routine for adding data to the chart (to simulate a real-world situation with a large data retrieval time).

When state management is enabled, all chart data is persisted in the HTML content that is returned to the browser. Note that it is possible to control when serialization occurs, as well as control what is persisted (see the Advanced State Management sample).

Benefits of State Management

The greatest benefit of state management is in situations where a user accesses a chart with a large amount of relatively static data that takes a long time to retrieve. For example, if a chart is generated after a data query from a remote database or socket server, then the chart's performance is affected by factors external to your chart server, such as network delays, busy data server, and so on.

By using state management, the chart data and/or appearance settings are persisted and reused for subsequent charts. This reduces the requests to the database or socket server and improves the performance of your page.