Chart Analysis Preview
1. Overview
In the process of creating charts, you can perform real-time preview after each editing operation and adjust the chart based on the preview results. In the analysis preview area of the card editing page, Guandata BI supports switching chart visualization types and performing analysis preview, modification, and save operations on charts.

2. Usage Guide
2.1. Switching Visualization Types
An analysis topic dashboard usually contains various types of visualization charts to meet different analysis needs and display purposes. Guandata BI supports creating various visualization charts, including column charts, bar charts, line charts, and pie charts, etc. Each chart has its unique application scenarios and advantages.
When creating charts, you should first choose the appropriate visualization type. You can freely switch the chart's visualization type in the upper right corner area of the card editing page (for specific visualization type introduction and configuration instructions, please refer to [Chart Types](../2-Chart Types.md), [Table Types](../1-Table Types.md)).

2.2. Analysis Preview
Auto-refresh Data After Changes
When users are creating charts, they often perform a series of editing operations on the chart, such as switching visualization types, adding/deleting/modifying fields, setting chart properties, etc. After each operation, users need to refresh the chart data to preview the edited chart effect.
Guandata BI supports users to choose between system auto-refresh and manual refresh modes for chart refreshing through "Auto-refresh Data After Changes".
In the card editing interface, turn on "Auto-refresh Data After Changes", and the system will automatically refresh data every time an editing operation is performed. After turning off the switch, manual data refresh is required after editing operations.
Note: When data volume is large or calculations are complex, it is recommended to turn off this option to avoid slow performance response.

Query Statement
Query statements are instructions or commands used to retrieve specific data from databases or datasets. To help technical personnel or data analysts understand BI card calculation logic, Guandata BI supports viewing SQL statements of cards.
In the card editing interface, click the query statement icon in the icon group in the upper right corner to view the data logic of the current card.

The system will provide query statements for calculating the card data according to the dataset type.
-
Direct connection database: Query SQL of the relevant database;
-
Non-direct connection database: Spark execution script (not SQL, but has certain readability);
-
Accelerated dataset: ClickHouse query statement;

This function requires administrators to enable the "Whether to allow viewing query SQL or Spark scripts" function in "Administrator Settings - System Management - Advanced Settings" (default is off, and it is also recommended to turn off in non-essential cases).

In addition to the card editing page, users can also view query statements on the dashboard page. For details, please refer to [Card Management](../../../3-Card Management.md#view-resource-lineage).
Chart Mode/Data Mode Switching
In the process of creating cards, if you want to view the specific data contained in the chart, you can convert the card from chart mode to data mode to present it in table form.
In the card editing interface, click the table-shaped icon in the upper right corner to switch from chart mode to data mode.

Adjust Column Width
Appropriately adjusting column width can make data arrangement more neat and orderly, ensuring that each column of data is more balanced and uniform visually.
In the card editing page, directly drag the table border to adjust the table column width. Click "Reset Column Width" to restore the default column width.

However, in addition to this, table column width also supports direct adjustment in the dashboard. For details, please refer to [Card Management](../../../3-Card Management.md#header-sorting).
Chart Description
For charts with complex logic, you can add description information to annotate the analysis purpose, calculation logic, and other content information that users want to identify for the chart to facilitate subsequent maintenance.
You can add descriptions below the chart in the visualization editing interface. As shown in the figure, click "+ Description" and enter text description in the text box.

2.3. Save and Modify
Undo/Redo
When editing charts, operational errors are inevitable. Guandata BI supports undo/redo operations to help you quickly restore the chart to its previous correct state.

Save Settings
After completing chart creation, you can save the current configuration results.
In the card editing page, you can directly click "Save" or "Save As" button to save the currently editing card, or click to enter the dropdown box of the "Save" button and select "Save and Exit".
