4. Create Visualization

Now you can start creating visualizations. Visualizations include charts, graphs, maps, and other graphical elements that help users interpret data trends, patterns, and insights effectively.

UI
API

Steps:

  1. In your workspace, switch to the Analyze tab.

    This opens the Analytical Designer, which is where you create or edit your visualizations.

    The Analyze tab selected.
  2. Start by selecting the type of visualization you would like to create, in this example you will use the Line chart.

    The visualization type selection with the line chart selected.
  3. Drag the Date attribute into the Trend by bucket.

    This is what will make up the x-axis of the line chart.

    The Date attribute being dragged into the Trend by bucket of the line chart.
  4. Drag the Order unit quantity fact into the Metrics bucket.

    This is what will make up the y-axis of the line chart.

    The Order unit quantity fact being dragged into the Metrics bucket of the line chart.

    Your line chart is now rendered:

    The rendered line chart.
  5. In the Trend by bucket, change the group by granularity from from Year to Quarter.

    The Date metric's Grouped by field being changed to Quarterly.

    Your line chart is now broken down into quarter year intervals:

    The line chart broken down by quarter-year intervals.
  6. Drag the Product category attribute into the Segment by bucket.

    The Product category attribute being dragged into the Segment by bucket.

    This divides your data into individual product category segments:

    The line chart segmented by product category.
  7. Drag the Product category attribute into the Filters bucket.

    This will let you filter what data you want your visualization to display.

    The Product category attribute being dragged into the Filters bucket.
  8. Open the Product category filter, deselect Audio & Video Accessories and click Apply.

    The filter listing all product categories with Audio & Video Accessories deselected.

    Data with Audio & Video Accessories product category is now filtered out:

    The line chart after filtering out Audio & Video Accessories.
  9. Name your visualization and Save it.

    The visualization named Number of Orders with the Save button highlighted.

    You have created your first visualization!

    Of course there are many other types of customizations you can make to your visualization, you can read about them in the Create Visualizations section of the documentation.

To create a visualization, submit a POST request to /api/v1/entities/workspaces/<WORKSPACE_ID>/visualizationObjects:

curl $HOST_URL/api/v1/entities/workspaces/<WORKSPACE_ID>/visualizationObjects \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -X POST \
  -d '{
  "data": {
    "id": "myObjectId123",
    "type": "visualizationObject",
    "attributes": {
      "title": "Number of Orders API",
      "description": "",
      "content": {
        "buckets": [
          {
            "items": [
              {
                "measure": {
                  "localIdentifier": "a62c290c70424904b385b5dd5b0b5bcc",
                  "definition": {
                    "measureDefinition": {
                      "item": {
                        "identifier": {
                          "id": "order_unit_quantity",
                          "type": "fact"
                        }
                      },
                      "aggregation": "sum",
                      "filters": []
                    }
                  },
                  "title": "Sum of Order unit quantity",
                  "format": "#,##0.00"
                }
              }
            ],
            "localIdentifier": "measures"
          },
          {
            "items": [
              {
                "attribute": {
                  "localIdentifier": "a64f156989ee4eeab59370db228121be",
                  "displayForm": {
                    "identifier": {
                      "id": "customer_created_date.quarter",
                      "type": "label"
                    }
                  }
                }
              }
            ],
            "localIdentifier": "trend"
          },
          {
            "items": [
              {
                "attribute": {
                  "localIdentifier": "59bc5473489e47f4b61da45cb27f0293",
                  "displayForm": {
                    "identifier": {
                      "id": "product_category",
                      "type": "label"
                    }
                  }
                }
              }
            ],
            "localIdentifier": "segment"
          }
        ],
        "filters": [
          {
            "negativeAttributeFilter": {
              "localIdentifier": "1acfac45fb7f4bab9bb0a6b77e0f1dc3",
              "displayForm": {
                "identifier": {
                  "id": "product_category",
                  "type": "label"
                }
              },
              "notIn": {
                "values": [
                  "Audio & Video Accessories"
                ]
              }
            }
          }
        ],
        "sorts": [],
        "properties": {},
        "visualizationUrl": "local:line",
        "version": "2"
      }
    }
  }
}' | jq .