-
What Grafana version and what operating system are you using?
Windows Version 11.6.0 -
What are you trying to achieve?
Showing what and when an Alarm was active in a time Frame
-
How are you trying to achieve it?
i have a stat pane
-
What happened?
The Text of the y-Axis is to large -
What did you expect to happen?
Text should be truncated
-
Can you copy/paste the configuration(s) that you are having problems with?
{
“id”: 8,
“type”: “state-timeline”,
“title”: “Alarme Vials”,
“gridPos”: {
“x”: 0,
“y”: 8,
“h”: 15,
“w”: 12
},
“fieldConfig”: {
“defaults”: {
“custom”: {
“lineWidth”: 0,
“fillOpacity”: 70,
“spanNulls”: false,
“insertNulls”: false,
“hideFrom”: {
“tooltip”: false,
“viz”: false,
“legend”: false
}
},
“color”: {
“mode”: “thresholds”
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “transparent”,
“value”: null
},
{
“color”: “#EAB839”,
“value”: 1
},
{
“color”: “#6ED0E0”,
“value”: 2
},
{
“color”: “#EF843C”,
“value”: 3
},
{
“color”: “#E24D42”,
“value”: 4
}
]
}
},
“overrides”:
},
“pluginVersion”: “11.5.2”,
“targets”: [
{
“dataset”: “ClassBCD_Monitoring”,
“datasource”: {
“type”: “mssql”,
“uid”: “begziou7aky68c”
},
“editorMode”: “code”,
“format”: “table”,
“rawQuery”: true,
“rawSql”: “DECLARE @columns nvarchar(max) = ‘’;\r\n\r\nDECLARE @sql nvarchar(max) = ‘’;\r\nWITH CTE AS (SELECT \r\n\r\n DISTINCT [M_No]\r\n \r\n\r\n FROM [dbo].[VisAM-MEL]\r\n\r\n WHERE $__timeFilter([time])\r\n\r\n AND [M_No] IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,131,209\r\n\r\n ,121,233,237,236,240,273,274,275,276,279,280,329,385,210,217,218,233,236,237,240,132,133,134,141,142,151,152,155,156,169,170,233,237,242,248,251,254,255,265\r\n\r\n ,274,275,329,129,123,124,125,126,130,135,136,143,144,149,150,155,156,171,172,173,174,175,176,187\r\n\r\n ,188,189,190,191,192,193.194,195,196,197,198,199,200,201,202,203,204,215,216,223,224,225,226\r\n\r\n ,227,228,229,230,231,236,240,242,247,252,253,256,258,259,260,261,262,263,264,266,267,268,273,274,275,276,279,280,281,282,387,329)\r\n\r\n UNION \r\n\r\nSELECT \r\n\r\n DISTINCT [M_No]\r\n \r\n\r\n FROM [dbo].[Meldesystem_Temp]\r\n\r\n WHERE $__timeFilter([time])\r\n\r\n AND [M_No] IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,131,209\r\n\r\n ,121,233,237,236,240,273,274,275,276,279,280,329,385,210,217,218,233,236,237,240,132,133,134,141,142,151,152,155,156,169,170,233,237,242,248,251,254,255,265\r\n\r\n ,274,275,329,129,123,124,125,126,130,135,136,143,144,149,150,155,156,171,172,173,174,175,176,187\r\n\r\n ,188,189,190,191,192,193.194,195,196,197,198,199,200,201,202,203,204,215,216,223,224,225,226\r\n\r\n ,227,228,229,230,231,236,240,242,247,252,253,256,258,259,260,261,262,263,264,266,267,268,273,274,275,276,279,280,281,282,387,329))\r\n\r\n \r\n SELECT @columns = STRING_AGG(CAST( ‘CASE WHEN [M_No] = ‘+ LTRIM([M_No]) +’ THEN ‘+ LTRIM([M_No]) +’ ELSE 0 END ’ + QUOTENAME(‘MNo ’ + LTRIM([M_No])) AS VARCHAR(MAX)), ‘, ‘) FROM CTE;\r\n\r\n \r\n\r\n SET @sql = ‘WITH CTE AS (SELECT [Time]\r\n\r\n ,[Status]\r\n\r\n ,[M_No]\r\n\r\n ,[Text]\r\n\r\n FROM [dbo].[VisAM-MEL]\r\n\r\n WHERE Time BETWEEN ‘’${__from:date}’’ AND ‘’${__to:date}’’\r\n\r\n AND [M_No] IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,131,209\r\n\r\n ,121,233,237,236,240,273,274,275,276,279,280,329,385,210,217,218,233,236,237,240,132,133,134,141,142,151,152,155,156,169,170,233,237,242,248,251,254,255,265\r\n\r\n ,274,275,329,129,123,124,125,126,130,135,136,143,144,149,150,155,156,171,172,173,174,175,176,187\r\n\r\n ,188,189,190,191,192,193.194,195,196,197,198,199,200,201,202,203,204,215,216,223,224,225,226\r\n\r\n ,227,228,229,230,231,236,240,242,247,252,253,256,258,259,260,261,262,263,264,266,267,268,273,274,275,276,279,280,281,282,387,329)\r\n\r\n UNION ALL\r\n\r\nSELECT [Time]\r\n\r\n ,[Status]\r\n\r\n ,[M_No]\r\n\r\n ,[Text] \r\n\r\n FROM [dbo].[Meldesystem_Temp]\r\n\r\n WHERE Time BETWEEN ‘’${__from:date}’’ AND ‘’${__to:date}‘’\r\n\r\n AND [M_No] IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,131,209\r\n\r\n ,121,233,237,236,240,273,274,275,276,279,280,329,385,210,217,218,233,236,237,240,132,133,134,141,142,151,152,155,156,169,170,233,237,242,248,251,254,255,265\r\n\r\n ,274,275,329,129,123,124,125,126,130,135,136,143,144,149,150,155,156,171,172,173,174,175,176,187\r\n\r\n ,188,189,190,191,192,193.194,195,196,197,198,199,200,201,202,203,204,215,216,223,224,225,226\r\n\r\n ,227,228,229,230,231,236,240,242,247,252,253,256,258,259,260,261,262,263,264,266,267,268,273,274,275,276,279,280,281,282,387,329))\r\n SELECT [Time],’ + @columns + ’ FROM CTE \r\n\r\n WHERE time BETWEEN ‘’${__from:date}‘’ AND ‘’${__to:date}‘’ ORDER BY [Time],[M_No], CASE WHEN [Status] = ‘’-N’’ THEN 1 ELSE 2 END’\r\n\r\n\r\n\r\n–PRINT @sql – Check the generated SQL\r\nEXEC sp_executesql @sql;\r\n”,
“refId”: “A”,
“sql”: {
“columns”: [
{
“parameters”: ,
“type”: “function”
}
],
“groupBy”: [
{
“property”: {
“type”: “string”
},
“type”: “groupBy”
}
],
“limit”: 50
}
}
],
“datasource”: {
“type”: “mssql”,
“uid”: “begziou7aky68c”
},
“options”: {
“mergeValues”: true,
“showValue”: “never”,
“alignValue”: “left”,
“rowHeight”: 0.9,
“legend”: {
“showLegend”: true,
“displayMode”: “list”,
“placement”: “bottom”
},
“tooltip”: {
“mode”: “single”,
“sort”: “none”,
“hideZeros”: false
}
}
} -
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
no -
Did you follow any online instructions? If so, what is the URL?
-
no