Go Down

Topic: How to use SQLite and Highcharts ? (Read 2942 times) previous topic - next topic

_Alain_

Hi

I have a SQLite Database which stores date, temperature, humidity and voltagelevel of an outdoorsensor.
I would like to use Highcharts for data visualization.
I have been searching in the internet for basic tutorials how to migrate the SQLite data to Highcharts but I did not find anything usefull.
I know that I have to parse the data with JSON but I need very detailed instruction how to do that to understand it (I am a beginner).

Does anybody know some detailed, basic instructions how to do that ?
An examplecode would be the most useful.

I am very thankful for every hint.

Kind regards
Alain

LeoTimmermans

Hello Alain,

I don't know how to use Highcharts. But under topic 385216.0 is a completely worked out example
with sqlite3 - html(jquery) - php5 - google charts.

Maybe it is of a little help to you ?

Best wishes
Leo

jessemonroy650

@_Alain_
Yun has charts built in. Some people have used it. It is part of the original Openwrt system. It was originally intended for monitoring the CPU and the remaining part of the system, but it is for general use. Login into your web panel and poke around. I don't use it, so I don't recall where it is at.
Jesse

ShapeShifter



arjan_hes

Basically
  • use a php-file to get data from the sqlite3 database and echo it in json format
  • build a website with (a second) php (file)
  • in the coding, use javascript/jquery to rerun the php (php runs server side and only once the page is generated by the server, js makes it re-run and gets those values to alow dynamic webpages)
  • use the js values to update highcharts


Highcharts examples are found on their website. There are also a few topics on stackoverflow. Google is a great friend ;)

Small tip: do not call any of the php-files something with data.php or datasensor.php as the word 'data' messes the Yun up and it can't cope (spent two evenings trying to find out what I was doing wrong, turned out to be the filename)

ShapeShifter

Small tip: do not call any of the php-files something with data.php or datasensor.php as the word 'data' messes the Yun up and it can't cope (spent two evenings trying to find out what I was doing wrong, turned out to be the filename)
Interesting... I wonder why that's the case? URLs that start with /data/ have special meaning to the web server, as a means to remotely access Beidge variables - perhaps that has something to do with it? Other "special" initial tokens are /arduino/, /sd/ and /mailbox/. I wonder if any of those also trigger your problem?

arjan_hes

I wonder if any of those also trigger your problem?
Must admit I never tested that. By accident I discovered the 'data'-name-flaw. I coded everything correct but it still didn't work... After renaming it to the Dutch equivalent of data.php (being gegevens.php) to create a test-file it worked straight away without me changing anything.

Go Up