Creating a Chart Legend

Add a new chart legend to a traditional chart definition.

Implementation:

  1. Open a Chart question's Properties and click Configure to open the Chart Definition interface.
  2. Switch to the Legends panel.
  3. Click Add to open the Chart Legend dialog.
  4. Enter a unique Legend Name. This can be used to reference the legend elsewhere, including with the WithChartItems function.
  5. Choose the Legend Type to use. Table will render the legend in a grid with two columns, Column will use a single column, and Row will render it as a single row.
  6. (Table only) Use the Table Type drop-down menu to choose if the legend table should be Tall or Wide.
  7. (Optional) Tick the Automatically Size Legend Text check box if the text in the legend should automatically shrink as more items are added to it.
  8. (Optional) Tick the Legend Items Are Equally Spaced check box to automatically give each item in the legend the same physical space as the longest item.
  9. (Optional) Switch to the Appearance tab and use the options here to modify the legend's visual style.
  10. (Optional) Switch to the Title tab to add a title that appears above the legend, and modify its appearance.
  11. (Optional) Switch to the Cell Columns panel. Here, you can add and manage cell columns in the legend.
  12. (Optional) Switch to the Position panel.
  13. (Optional) Untick Enable Auto Position if you want to specify the specify the size and position of the legend yourself. This will enable the remaining options in the panel.
  14. (Optional) Use the X Position and Y Position sliders to set the horizontal and vertical position of the legend within the chart area. These are percentage values from 0 to 100.
  15. (Optional) Use the Height and Width fields to set the size of the legend in pixels.
  16. (Optional) Switch to the Docking panel. This contains options for docking the legend to a particular chart area in the definition. The legend will still display data from the series it is associated with, but will appear next to the specified area.
  17. (Optional) Tick the Dock to Chart Area check box to activate the remaining options in the panel.
  18. (Optional) Switch to the Interactivity panel, where you can add interactive elements to the legend.
  19. Click Save to create the new legend.