Configuring Additional Visualizations
1. Creating Geomap Panels
| Property | Value | Description |
|---|---|---|
| panel.type | geomap |
Sets the panel type to Geomap |
| datasource | string |
Name or UID of the data source providing geospatial data |
| mapType | osm, carto, stamen |
Map provider to use for rendering the map |
| center | { lat: number, lon: number } |
Initial center coordinates of the map |
| zoom | number |
Initial zoom level (0-18) |
| layer | string |
Layer type (e.g., markers, heatmap) |
Example: Basic Geomap Panel Configuration
{
"type": "geomap",
"datasource": "GeoJSON-DataSource",
"mapType": "osm",
"center": {
"lat": 40.7128,
"lon": -74.0060
},
"zoom": 12,
"layer": "markers"
}
Note: Geomap panels require a data source that supports geospatial queries or JSON with lat/lon fields.
2. Configuring State Timeline
| Property | Values | Description |
|---|---|---|
| stateTimeline | true | false |
Enables or disables the state timeline visualization. |
| timeRange | last 1h | last 6h | last 24h |
Configures the time range for timeline data. |
| colorPalette | default | custom |
Defines the color scheme for timeline states. |
Example: Enabling State Timeline
{
"stateTimeline": true,
"timeRange": "last 24h",
"colorPalette": "default"
}
Note: The state timeline requires a data source with timestamped state events.
Warning: Enabling this visualization may impact performance on large datasets.
3. Using Status History
| Property | Description | Values | Notes |
|---|---|---|---|
| statusHistory | Enables or disables status history tracking | true / false |
Default: false |
| maxHistoryItems | Maximum number of history items to store | Integer | Default: 100 |
Note: Status history is useful for tracking the evolution of alert states over time.
4. Creating Candlestick Charts
| Property | Description | Example |
|---|---|---|
| panel.type | Specifies the visualization type. For candlestick charts, set to candlestick. |
candlestick |
| fieldConfig | Configuration for how fields are displayed in the chart. | |
Example: Candlestick Chart Configuration
{
"id": "candlestick-chart",
"type": "candlestick",
"title": "Stock Price Candlestick Chart",
"fieldConfig": {
"defaults": {
"custom": {
"showOpen": true,
"showHigh": true,
"showLow": true,
"showClose": true
}
},
"overrides": []
},
"targets": [
{
"expr": "rate(http_requests_total[5m])",
"legendFormat": "{{job}}",
"interval": ""
}
]
}
Note: Candlestick charts require OHLC (Open, High, Low, Close) data points. Ensure your data source provides these values for accurate visualization.
5. Configuring Histogram Panels
| Property | Values | Description |
|---|---|---|
| panel.type | histogram |
Sets the panel type to histogram visualization |
| target | string |
The data source query to visualize as a histogram |
| bucketSize | number |
Defines the size of each bucket in the histogram |
| showLegend | true | false |
Controls whether to display the legend for histogram series |
Example: Histogram Panel Configuration
{
"type": "histogram",
"target": "rate(metric_name[5m])",
"bucketSize": 10,
"showLegend": true
}
Note: Histogram panels require time-series data with numeric values to render buckets effectively.
Warning: Setting
bucketSize too small may result in performance issues with large datasets.
6. Using Node Graph Panels
| Property | Value | Description |
|---|---|---|
| panelType | nodeGraph |
Specifies the panel type as Node Graph |
| datasource | string |
The data source to use for node graph data |
| nodeHighlight | boolean |
Highlights nodes on hover or selection |
| edgeType | string |
Defines how edges are rendered (e.g., directed, undirected) |
Example: Node Graph Panel Configuration
{
"panelType": "nodeGraph",
"datasource": "Prometheus",
"nodeHighlight": true,
"edgeType": "directed"
}
Note: Node Graph panels require a data source that supports graph-like data structures such as Prometheus or InfluxDB.
7. Creating Trace View Panels
| Property | Value | Description |
|---|---|---|
| panel.type | trace |
Sets the panel type to display trace data |
| datasource | Jaeger or Tempo |
Specifies the data source for trace data |
| query | traceId |
Query string to filter trace data by ID or other criteria |
Example: Trace View Panel Configuration
{
"panels": [
{
"id": 1,
"type": "trace",
"datasource": "Jaeger",
"targets": [
{
"query": "traceId=1234567890abcdef"
}
]
}
]
}
Note: Trace view panels require a compatible tracing backend like Jaeger or Tempo to display data.
Warning: Ensure that the tracing backend is properly configured and accessible from Grafana for trace data to render correctly.
8. Using Canvas Panels
Canvas panels in Grafana provide a flexible way to create custom visualizations using HTML5 Canvas. They allow developers to render complex graphics and animations directly within Grafana dashboards.
| Property | Description | Values |
|---|---|---|
| panelType | Specifies the type of panel to render | canvas |
| canvasScript | JavaScript code that runs on the canvas element | string |
| dataFormat | How data is passed to the canvas script | json, csv |
Example: Basic Canvas Panel Configuration
{
"panelType": "canvas",
"canvasScript": "function draw(ctx, data) { ctx.fillStyle = '#FF0000'; ctx.fillRect(0, 0, 100, 100); }",
"dataFormat": "json"
}
Note: Canvas panels require JavaScript execution capabilities and should be used carefully in environments with strict security policies.
9. Configuring News Panels
| Property | Value | Description |
|---|---|---|
| panel.type | news |
Sets the panel type to News |
| feedUrl | https://news.ycombinator.com/rss |
URL of the RSS feed to display |
| maxItems | 10 |
Maximum number of news items to display |
| showImage | true |
Whether to show images from the feed |
| showContent | false |
Whether to show full content or just titles |
Example: Adding a News Panel
{
"panels": [
{
"type": "news",
"feedUrl": "https://feeds.bbci.co.uk/news/rss.xml",
"maxItems": 5,
"showImage": true,
"showContent": false
}
]
}
Note: The News panel requires an RSS feed URL. Ensure the feed is accessible and properly formatted.
10. Using Text Panels
| Property | Value | Description |
|---|---|---|
| content | <h1>Welcome to Grafana</h1><p>This is a sample text panel.</p> |
HTML content to display in the panel |
| mode | html | markdown |
Rendering mode for the content |
| fontSize | 12px | 14px | 16px |
Font size for the panel text |
Example: Basic Text Panel Configuration
{
"content": "<h1>Welcome to Grafana</h1><p>This is a sample text panel.</p>",
"mode": "html",
"fontSize": "14px"
}
Note: Text panels are useful for adding explanations, documentation, or custom HTML content to dashboards.