Making a Pie Chart
A simple pie chart can be made in cards using the Chart component. Once the card context has set for the cube with data for the pie chart the following properties of the chart need to be adjusted. In this example we are using the Sales cube to show the revenue and cost of goods sold percentage of gross margin.
Required properties:
Plot Instructions: Set instructions that build up the segments of the pie, in this example the instructions are expanding the Sales Measure Gross Margin
Plot X Label: Label for each segment of the pie, in this example being the Sales Measure
ELEMENT("Sales Measures")
Series Instructions: Filled with any instruction, can be used to set the pie charts context such as its scenario or currency
Series Format: Pie
Series Title: Any text as series is not used in pie charts
Series Y Value: Link to your cube data, in this example it is linking to the Sales cube
LINK("Sales", [])
Some additional properties can be adjusted for some additional customization
Useful additional properties:
Chart Title
Chart Subtitle
Data Labels
Change to yes to show % labels for segments
Data Label Color
Plot Color Formula
Two easy ways to color a pie chart are by splitting a list of colors based on the plot index or a cascading if statement. More segments will require more colors listed in the split or multiple cascading
IF
functions to match the segment count.Example:
SPLIT("#FF4054,#323652",",",NUMBER(VARIABLE("plot-index")))
or
IF( ELEMENT("Sales Measures") = "Revenue", "#FF4054", "#323652")