![]() |
VOOZH | about |
This page provides an example of how to use the custom chart component in your App Builder apps.
The basic workflow for creating a custom chart is as follows:
Alternatively, you can use Bits AI to get started with a custom chart:
Can you help me create a custom chart?.The following example shows how to create a histogram chart illustrating Datadog Logs grouped by service.
searchLogs0.logs, expand 0, then expand content. This shows the available properties for each log.Click + All Components and select Custom Chart to add a component called customChart0.
Click Show Chart Examples.
Select Simple Histogram and click Confirm.
The following value populates in the Vega Specification:
${{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://vega.github.io/editor/data/movies.json"
},
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"bin": true,
"field": "IMDB Rating"
},
"y": {
"aggregate": "count"
}
}
}}Replace the auto-populated Vega Specification with the following to change the data source and the value being graphed on the x-axis:
${{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": searchLogs0.outputs.logs
},
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"field": "content.service"
},
"y": {
"aggregate": "count"
}
}
}}A histogram chart with your Datadog Logs data displays.
Additional helpful documentation, links, and articles:
Do you have questions or feedback? Join the #app-builder channel on the Datadog Community Slack.
| |