How to Create Multi-Category Charts with Separate Legends
Question details
The user wants to learn how to create a grouped multi-category chart and configure a separate legend for the data.

- Product
- Excel PivotChart and Power BI
- Device & OS
- not provided
- Scenario
- Visualizing complex datasets where bars or data points need to be grouped by multiple categories while maintaining a distinct, separate legend to identify the series.
- Observed behavior
- To achieve the correct visual grouping, data fields must be properly assigned to the column variables (or X-axis wells) while the legend is configured independently.
Ensure your dataset is clean, with clear column headers representing your categories and values, and verify that there are no blank rows or merged cells interrupting the data range.
Use PivotCharts to Create Multi-Category Groups
Creating a PivotChart is the most effective way to group multiple categories and display a separate legend for your data in spreadsheet applications.
PivotCharts automatically group categories when multiple fields are dragged into the Axis (Categories) area. The Legend (Series) area acts independently to create your separate legend.
Select your entire dataset, navigate to the 'Insert' tab on the ribbon, and click 'PivotChart'.
Select where you want to place the PivotChart (such as a New Worksheet or Existing Worksheet) and click 'OK'.
In the PivotChart Fields pane, drag your primary and secondary category fields into the 'Axis (Categories)' area. This will group the bars on the chart.
Drag the specific field you want to use for color-coding or series identification into the 'Legend (Series)' area to create a distinct legend.
Finally, drag your numerical data field into the 'Values' area to populate the chart's bars or columns.

Configure Field Wells for Clustered Column Charts in Power BI
If you are using Power BI, you can achieve multi-category grouping by layering fields in the X-axis well and utilizing the Legend well.
Create Multi-Category PivotCharts in WPS Spreadsheet
WPS Spreadsheet offers robust PivotTable and PivotChart features that make grouping multiple data categories and customizing legends incredibly simple. It supports all standard Excel chart formats, allowing you to visualize your data professionally with intuitive drag-and-drop mechanics.
- 1. Open your data file: Launch WPS Spreadsheet and open the document containing your dataset.
- 2. Insert PivotTable: Go to the 'Insert' tab and click 'PivotTable' to generate a data summary.
- 3. Generate PivotChart: Once the PivotTable is created, select any cell inside it, go to the 'PivotTable Tools' tab, and click 'PivotChart'.
- 4. Group Fields: Drag multiple fields into the 'Axis' box for category grouping, and place your differentiating field into the 'Legend' box.
- 5. Customize Appearance: Use the 'Chart Tools' tab to refine your legend's position and the overall aesthetic of your multi-category chart.

Frequently Asked Questions
Why is my PivotChart legend showing the same fields as my axis categories?
This happens if you place the same data field in both the Axis (Categories) area and the Legend (Series) area. Ensure you drag the specific field meant for the legend out of the Axis area and strictly place it into the Legend area.
Can I create a multi-level category chart without using a PivotChart?
Yes, standard 2D Column charts can display multi-level category labels. To do this, your source data must be organized hierarchically, with the outer category column containing the primary label only once, leaving blank cells below it for the grouped sub-items.
How do I change the position of the separate legend on my chart?
Click on the chart to activate the Chart Elements menu (often indicated by a plus icon next to the chart). Hover over 'Legend', click the arrow next to it, and select your preferred position, such as Top, Bottom, Left, or Right.
Will my Excel multi-category PivotChart work perfectly in WPS Spreadsheet?
Yes, WPS Spreadsheet is fully compatible with Microsoft Excel PivotCharts. You can open, edit, and refresh your grouped charts with separate legends exactly as you would in Excel without losing any formatting.




