metadata-models/docs/entities/chart.md
Charts are visual representations of data, typically found in Business Intelligence (BI) platforms and dashboarding tools. In DataHub, charts represent individual visualizations such as bar charts, pie charts, line graphs, tables, and other data displays. Charts are typically ingested from platforms like Looker, Tableau, PowerBI, Superset, Mode, and other BI tools.
Charts are identified by two pieces of information:
looker, tableau, powerbi, superset, mode, etc. This corresponds to the dashboardTool field in the chart's key aspect.look/1234, while PowerBI might use tile identifiers like tile-abc-123.An example of a chart identifier is urn:li:chart:(looker,look/1234).
For platforms with multiple instances (e.g., separate Looker deployments for different environments), the URN can include a platform instance identifier: urn:li:chart:(looker,look/1234,prod-instance).
The core metadata about a chart is stored in the chartInfo aspect. This includes:
The following code snippet shows you how to create a chart with basic information.
<details> <summary>Python SDK: Create a chart</summary>{{ inline /metadata-ingestion/examples/library/chart_create_simple.py show_path_as_comment }}
For more complex chart creation with additional metadata:
<details> <summary>Python SDK: Create a chart with full metadata</summary>{{ inline /metadata-ingestion/examples/library/chart_create_complex.py show_path_as_comment }}
Charts often have underlying queries (SQL, LookML, etc.) that define how the data is retrieved and processed. The chartQuery aspect stores this information:
This information is particularly useful for understanding data lineage and for auditing purposes.
Charts consume data from one or more datasets (or sometimes from other charts). The chartInfo aspect's inputEdges field tracks these relationships, creating Consumes relationships in the metadata graph. This enables:
{{ inline /metadata-ingestion/examples/library/chart_add_lineage.py show_path_as_comment }}
The inputFields aspect provides fine-grained tracking of which specific dataset fields (columns) are referenced by the chart. Each input field creates a consumesField relationship to a schemaField entity, enabling:
DataHub separates metadata that comes from ingestion sources (in chartInfo) from metadata that users edit in the DataHub UI (in editableChartProperties). This separation ensures that:
The editableChartProperties aspect currently supports:
Charts can have Tags or Terms attached to them. Read this blog to understand the difference between tags and terms.
Tags are added to charts using the globalTags aspect.
{{ inline /metadata-ingestion/examples/library/chart_add_tag.py show_path_as_comment }}
Glossary terms are added using the glossaryTerms aspect.
{{ inline /metadata-ingestion/examples/library/chart_add_term.py show_path_as_comment }}
Ownership is associated with a chart using the ownership aspect. Owners can be of different types such as DATAOWNER, TECHNICAL_OWNER, BUSINESS_OWNER, etc. Ownership can be inherited from source systems or added in DataHub.
{{ inline /metadata-ingestion/examples/library/chart_add_owner.py show_path_as_comment }}
Charts can track usage metrics through the chartUsageStatistics aspect (experimental). This timeseries aspect captures:
Usage statistics help identify:
Charts can be organized into Domains (business areas or data products) using the domains aspect. This helps with:
Charts typically belong to a Dashboard (their parent container). The container aspect tracks this relationship, creating a hierarchical structure:
Dashboard (Container)
├── Chart 1
├── Chart 2
└── Chart 3
This hierarchy is important for:
The embed aspect stores URLs that allow embedding the chart in external applications or viewing it in its native platform. This supports:
Charts from different platforms may have platform-specific subtypes defined in the subTypes aspect. Examples include:
Look (a saved Looker visualization)PowerBI Tile (a tile on a PowerBI report page)Chart, Report (different Mode visualization types)Subtypes help users understand the platform-specific nature of the chart.
Charts are typically ingested automatically from BI platforms using DataHub's ingestion connectors:
Each connector maps platform-specific chart metadata to DataHub's standardized chart model.
You can retrieve chart information using DataHub's REST API:
<details> <summary>Fetch chart entity snapshot</summary>curl 'http://localhost:8080/entities/urn%3Ali%3Achart%3A(looker,look%2F1234)'
The response includes all aspects of the chart, including:
You can query chart relationships to understand its connections to other entities:
<details> <summary>Find datasets consumed by a chart</summary>curl 'http://localhost:8080/relationships?direction=OUTGOING&urn=urn%3Ali%3Achart%3A(looker,look%2F1234)&types=Consumes'
This returns all datasets (and potentially other charts) that this chart consumes data from.
</details> <details> <summary>Find charts that consume a specific dataset</summary>curl 'http://localhost:8080/relationships?direction=INCOMING&urn=urn%3Ali%3Adataset%3A(urn%3Ali%3AdataPlatform%3Abigquery,project.dataset.table,PROD)&types=Consumes'
This returns all charts that depend on the specified dataset.
</details>Charts are fully supported in DataHub's GraphQL API, which provides:
The GraphQL Chart type includes all standard metadata fields plus chart-specific properties like query definitions and usage statistics.
Different BI platforms have different concepts that map to charts:
Tableau Sheets vs Dashboards: In Tableau, a "sheet" (worksheet) maps to a DataHub chart, while a "dashboard" maps to a DataHub dashboard entity. A Tableau dashboard can contain multiple sheets.
PowerBI Tiles: PowerBI has the concept of "tiles" (pinned visualizations) which are modeled as charts in DataHub. A tile can reference multiple underlying reports or datasets.
Looker Looks vs Dashboard Elements: Looker has standalone "Looks" (saved visualizations) and dashboard elements. Both are modeled as charts in DataHub.
While most charts consume data from datasets, some platforms support charts that derive from other charts. DataHub supports this through chart-to-chart Consumes relationships, enabling multi-level visualization lineage.
The chartInfo.inputs field is deprecated in favor of chartInfo.inputEdges. The inputEdges field provides richer relationship metadata including timestamps and actors for when relationships were created or modified.
Charts frequently interact with these other DataHub entities: