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.

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

    Screenshot of the visualization type selection with 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.

    Screenshot of the Date metric 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.

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

    Your line chart is now rendered:

    Screenshot of a the line chart.
  5. In the Trend by bucket, change the group by granularity from from Year to Quarter.

    Screenshot of the Date metric Grouped by field being changed to Quarterly.

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

    Screenshot of a the line chart, now broken down by quarters.
  6. Drag the Product category attribute into the Segment by bucket.

    Screenshot of the Product category attribute being dragged into the Segment by field.

    This divides your data into individual product category segments:

    Screenshot of a the line chart, now also segmented into separate product categories.
  7. Drag the Product category attribute into the Filters bucket.

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

    xxxxxx
  8. Open the Product category filter, deselect Audio & Video Accessories and click Apply.

    xxxxxx

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

    xxxxxx
  9. Name your visualization and Save it.

    xxxxxx

    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 .