i try to plot some data from a sqlite3 database via gnuplot.
Here is some example i did:
$ gnuplot < config.gp
My config.gp
set title "Test"
set xrange["13.11.2014_07:00":"13.11.2014_23:00"]
set output "Diagramm.png"
set terminal png size 900,600
set xdata time
set timefmt "%s"
set yrange [-20:40]
set ylabel "Erste Skalierung"
set y2label "Zweite Skalierung"
set format x "%H:%M:%S"
set xlabel "Time (HH:MM:SS)
set grid
set xtics
set ytics
set y2tics 25
set y2range [0:100]
set grid
set datafile separator "|"
plot '<sqlite3 test.db "select date || ''_'' || value0, value1, value2, value3 from werte"' using 1:4 title 'Wert0' with lines axes x1y2, \
'' using 1:3 title 'Wert1' with lines axes x1y1, \
'' using 1:2 title 'Wert2' with lines axes x1y1
My test.db Database
sqlite> SELECT * from values;
ID value0 value1 date value 2 value3 value 4
1|17.2|27.2|77.2|08:00:00|13.11.2014|2014-12-07 21:29:39
2|-1.01|28.99|68.99|12:00:00|13.11.2014|2014-12-07 23:29:16
3|20.26|30.26|75.26|14:00:00|13.11.2014|2014-12-07 23:29:26
4|6.94|16.94|61.94|16:00:00|13.11.2014|2014-11-13 23:29:36
5|7,56|18,66|65,56|18:00:00|13.11.2014|2014-11-13 23:50:00
6|7,65|22,56|54,89|20:00:00|13.11.2014|2014-11-13 20:00:00
7|12,56|33,58|54,96|22:00:00|13.11.2014|2014-11-13 22:00:00
But all i get is an empty Diagramm.png with no lines.
Does anyone have an idea?
Best regards :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the select statement you have some double quotes that I believe should
not be there. And why don't you do the select as in the example you show?
Edo
e-mail sent with my mobile: excuses for typos and conciseness.
On 16 Dec 2014 20:45, "jolle-pe" jolle-pe@users.sf.net wrote:
Hello everybody,
i try to plot some data from a sqlite3 database via gnuplot.
Here is some example i did:
$ gnuplot < config.gp
My config.gp
set title "Test"
set xrange["13.11.2014_07:00":"13.11.2014_23:00"]
set output "Diagramm.png"
set terminal png size 900,600
set xdata time
set timefmt "%s"
set yrange [-20:40]
set ylabel "Erste Skalierung"
set y2label "Zweite Skalierung"
set format x "%H:%M:%S"
set xlabel "Time (HH:MM:SS)
set grid
set xtics
set ytics
set y2tics 25
set y2range [0:100]
set grid
set datafile separator "|"
plot '<sqlite3 test.db "select date || ''_'' || value0, value1, value2,
value3 from werte"' using 1:4 title 'Wert0' with lines axes x1y2, \ ''
using 1:3 title 'Wert1' with lines axes x1y1, \ '' using 1:2 title 'Wert2'
with lines axes x1y1
My test.db Database
sqlite> SELECT * from values;
ID value0 value1 date value 2 value3 value 4
1|17.2|27.2|77.2|08:00:00|13.11.2014|2014-12-07 21:29:39
2|-1.01|28.99|68.99|12:00:00|13.11.2014|2014-12-07 23:29:16
3|20.26|30.26|75.26|14:00:00|13.11.2014|2014-12-07 23:29:26
4|6.94|16.94|61.94|16:00:00|13.11.2014|2014-11-13 23:29:36
5|7,56|18,66|65,56|18:00:00|13.11.2014|2014-11-13 23:50:00
6|7,65|22,56|54,89|20:00:00|13.11.2014|2014-11-13 20:00:00
7|12,56|33,58|54,96|22:00:00|13.11.2014|2014-11-13 22:00:00
But all i get is an empty Diagramm.png with no lines.
Does anyone have an idea?
Hello everybody,
i try to plot some data from a sqlite3 database via gnuplot.
Here is some example i did:
$ gnuplot < config.gp
My config.gp
My test.db Database
But all i get is an empty Diagramm.png with no lines.
Does anyone have an idea?
Best regards :-)
In the select statement you have some double quotes that I believe should
not be there. And why don't you do the select as in the example you show?
Edo
e-mail sent with my mobile: excuses for typos and conciseness.
On 16 Dec 2014 20:45, "jolle-pe" jolle-pe@users.sf.net wrote: