Open bdonnahue opened 6 years ago
I have been debugging this a bit. I have four queries but I am still stuck.
Ok I got it working.
I probably should have noted earlier that I am using mysql. I needed to add four separate queries:
SELECT
UNIX_TIMESTAMP(date_time) as time_sec,
open as value,
'open' as metric
FROM sampledata2;
SELECT
UNIX_TIMESTAMP(date_time) as time_sec,
high as value,
'high' as metric
FROM sampledata2;
SELECT
UNIX_TIMESTAMP(date_time) as time_sec,
low as value,
'low' as metric
FROM sampledata2;
SELECT
UNIX_TIMESTAMP(date_time) as time_sec,
close as value,
'close' as metric
FROM sampledata2;
The interesting thing about the MySQL backend in this situation is that it requires the query to return columns with a particular name as described here: http://docs.grafana.org/features/datasources/mysql/
The column named "metric" is used as the metric name and used to distinguish between sets of metrics. With the way the plugin is currently written , on line 105 of calndlestick_ctrl.js the metric is being resolved as the alias. This means that only one candlestick can be displayed per graph.
@ilgizar can you think of any way around this problem?
This is how I got it to work with Mysql
I am trying to get the plugin working but the query is where i get stuck. could you add a screenshot of the Metrics tab so I can see why no datapoints are being displayed.