Pie Chart Element Usage Logic

The use of the Pie Chart element is slightly different from other chart types. Each value field must be associated with a label field to create the desired structure in the chart. As an example, the following SQL code shows how you can create the required data structure for the Pie Chart element:

SELECT 'Category A' AS category, 45 AS value
UNION ALL SELECT 'Category B', 30
UNION ALL SELECT 'Category C', 15
UNION ALL SELECT 'Category D', 10;

The above code creates a data set consisting of multiple categories and their values.