Hi, dear Grafana community!
-
What Grafana version and what operating system are you using?
I’m using Grafana Version 9.3.1 (commit: 89b365f8b1, branch: HEAD) installed in Windows 10 WSL:
5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux -
What are you trying to achieve?
I’m trying to use candlestick panel in “Both” mode with simultaneous OHLC and Volume bars. -
How are you trying to achieve it?
I’m using query to ClickHouse DB directly selecting DateTime and OHLC+Volume fields. -
What happened?
OHLC and Volume are shown on the panel, but both of them have a very low scale (both graphs occupy about 1/5 lower part of the working filed, the rest upper part of the field is empty) and have the same zero level and intersect with each others. Possibly, there is an error in calculating upper bound of the Y-axis in “Both” mode. In separate “Candles” and “Volume” modes scale is correct.
-
What did you expect to happen?
I expected to see a much higher usage of Y-axis in “Both” mode of candlestick panel. -
Can you copy/paste the configuration(s) that you are having problems with?
{
"id": 2,
"gridPos": {
"h": 13,
"w": 12,
"x": 0,
"y": 0
},
"type": "candlestick",
"title": "Panel Title",
"transformations": [],
"datasource": {
"uid": "xE1jQZc4k",
"type": "vertamedia-clickhouse-datasource"
},
"maxDataPoints": 500,
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"lineWidth": 1,
"fillOpacity": 49,
"gradientMode": "none",
"spanNulls": false,
"showPoints": "auto",
"pointSize": 4,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "series",
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "line"
},
"lineStyle": {
"fill": "solid"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"options": {
"mode": "candles+volume",
"candleStyle": "candles",
"colorStrategy": "open-close",
"colors": {
"up": "green",
"down": "red"
},
"includeAllFields": false,
"legend": {
"showLegend": false,
"displayMode": "list",
"placement": "bottom",
"calcs": []
},
"fields": {
"close": "pclose",
"high": "pmax",
"low": "pmin",
"open": "popen",
"volume": "volume"
}
},
"targets": [
{
"database": "default",
"datasource": {
"type": "vertamedia-clickhouse-datasource",
"uid": "xE1jQZc4k"
},
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "time_stamp",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": false,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"hide": false,
"interval": "",
"intervalFactor": 1,
"query": "SELECT\n time_stamp,\n popen,\n pclose,\n pmin,\n pmax,\n volume\nFROM rates_test\n\nWHERE asset = 'Dash'\n AND $timeFilter\n\nORDER BY time_stamp\n",
"rawQuery": "SELECT\n time_stamp,\n popen,\n pclose,\n pmin,\n pmax,\n volume\nFROM rates_test\n\nWHERE asset = 'Dash'\n AND time_stamp >= toDateTime(1609404857) AND time_stamp <= toDateTime(1614838381)\n\nORDER BY time_stamp",
"refId": "A",
"round": "0s",
"skip_comments": true,
"table": "rates_test",
"tableLoading": false
}
],
"interval": null
}