CreateChart Macro
Version 1.1
![[Image: TempGraph.png]](http://www.wuench.com/cmine/albums/userpics/TempGraph.png)
Description
This macro will create interactive/animated HTML5 line charts from a MySQL database for data logged with the datalog DB driver and display them in the CQC web server. The default config allows for tooltips, zooming, and turning on/off series dynamically. The macro literals can be edited for many more options. To see what all is available see the canvasjs.com website for more info.
Installation
Usage
Parameters
Examples
Versions
Version 1.1
![[Image: TempGraph.png]](http://www.wuench.com/cmine/albums/userpics/TempGraph.png)
Description
This macro will create interactive/animated HTML5 line charts from a MySQL database for data logged with the datalog DB driver and display them in the CQC web server. The default config allows for tooltips, zooming, and turning on/off series dynamically. The macro literals can be edited for many more options. To see what all is available see the canvasjs.com website for more info.
Installation
- Install Macro Pack
- Download CanvasJS and install the canvasjs-min.js file under /htmlroot/script
- Optionally, open the macro in the Macroworkshop and edit the default DSN, Username, and Password. This is so you don't have to pass those parameters on the URL.
Usage
Code:
http://cqcserver/cmlbin/user/CreateChart?Type=parm&dsn=CQCDB&series1=descriptor1&series2=descriptor2...
Parameters
- dsn - DSN of your MySQL DB
- user - Username of your MySQL DB
- pass - Password of your MySQL DB
- type - Graph Type (Min5,Min10,Min15,Min30,Hour,Day,Week,Month,Year)
- seriesX - Descriptor you would like to chart.
- width - Chart width in pixels or percent (i.e. 300px or 100%)
- height - Chart height in pixels or percent
- maxpoints - Maximum data points to display/scale graph to (default 50)
- title - Graph title
Examples
Code:
[b]Chart 2 Series, Period = 1 Day[/b]
http://cqcserver/cmlbin/user/CreateChart?dsn=CQCDB&type=Day&series1=IndoorTemp&series2=AtticTemp
[b]Chart 2 Series, 1 Day, Size 300x600, Title Temperatures, Datapoints 100[/b]
http://cqcserver/cmlbin/user/CreateChart?dsn=CQCDB&type=Day&series1=IndoorTemp&series2=AtticTemp&title=Temperatures&maxpoints=100&width=600px&height=300px
Versions
- Version 1.0 - Original Version (Did not function in IE or CQC Web Widget)
- Version 1.1 - Works in IE - Fixed JS Date function to be IE Compatible
Wuench
My Home Theater/Automation Website
[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
My Home Theater/Automation Website
[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]