Skip to content

Making a Scatter Plot

A simple scatter plot chart can be made in cards using the Chart component. Once the card context has set for the cube with data for the waterfall chart, the following properties of the chart need to be adjusted. In this example, we are using the Sales cube to show the revenue for different locations depending on the amount (units) of products associated with a particular location and product.

Required properties:

  • Plot Direction: For a scatter plot, this should be set to "Both".

  • Series Instructions: Set instructions that define the main identification points for the scatter plot points. In this example, we are looking at the location and the product, so these two dimensions are added separately.

  • Series Format: Plot

  • Series Title: Set this to any text, as the Series Legend is not needed for this chart. (To enable Legend, set Legend Position to any value other than 'None")

  • Series X Value: Link to the determining X-Axis value. In this example, we are linking to the sales cube and pointing to revenue. LINK("Sales",["Revenue"])

  • Series X Value: Link to the determining Y-Axis value. In this example, we are linking to the sales cube and pointing to units. LINK("Sales",["Units"])

Useful additional properties:

  • Chart Title

  • Chart Subtitle

  • Tooltip Label: Determines what text is displayed when a scatter plot point is hovered over. In this example it is set to ELEMENT("Location") & " - " & ELEMENT("Product") in order to show the Location and Product of the point.

  • Set Context: The context of the card (or furthermore, a whole dashboard) can be changed when a scatter plot point is clicked. Example formula to change the Location on click: "Location="&ELEMENT("Location")

  • Set Variables: A variable can be updated when a scatter plot point is clicked. One way this can be utilised is to highlight specific plot points based on a common feature. In this example, the variable is set like so "highlight-loc="&ELEMENT("Location"), then used in the Plot Colour Formula to highlight.

  • Plot Color Formula: 2 easy ways to color a chart are by splitting a list of colors based on the plot index or a cascading if statement.

    Example: SPLIT("#FF4054,#323652",",",NUMBER(VARIABLE("plot-index"))) or IF( ELEMENT("Sales Measures") = "Revenue", "#FF4054", "#323652") or Using the variable from the "Set Variables" section to highlight on click

    vb
    IF(
        CONTAINS(VARIABLE("highlight-loc"),ELEMENT("Location"))=1
    ,
        "#D10005"
    ,
        "#82BCE1"
    )