Custom Web Chart

Related to the Portal
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Sun Sep 07, 2014 9:48 pm
rimai wrote:We would need to analyze the results of the query record by record to be able to do this.
Remember that this is a SQL query.

I've had a bash at doing this in javascript. I haven't tried it with highcharts yet, but it works with a my modified version of your webcharts using d3.

See http://arch1.github.io/RA_CustomCharts/

and

https://github.com/arch1/RA_CustomCharts


The RFW plot is a good example of plotting data gaps.
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Sep 09, 2014 1:37 pm
Very nice. The only thing you're missing is the mouse-overs to see the details.
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Tue Sep 09, 2014 7:25 pm
Yes - I'll put on that on the todo list (along with plotting individual relays - maths was easier than I thought it would be).

I've made the charts scrollable in this version (still needs a bit of tidying up - but tooltips shouldn't be too hard):

http://bl.ocks.org/arch1/5c63a184ca638b291df7

(best viewed in new window)
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Tue Sep 09, 2014 8:14 pm
That is really cool. Can we overlap multiple filters? Thanks for showing the HTML in that. I was able to copy that over to my server and switch it to my ID. FYI Celsius to Fahrenheit was a pain but not too bad.
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Tue Sep 09, 2014 8:51 pm
I'm planning to add multiple filters - but it will take me a while - this is already a major stretch of my javascript/d3 capabilities.

While there are plenty of examples around ( http://bl.ocks.org/mbostock/3884955, http://www.d3noob.org/2014/07/d3js-multi-line-graph-with-automatic.html) adding extra features without breaking existing ones is proving a challenge...
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Thu Sep 11, 2014 1:26 am
lnevo wrote:Isnt the chart software javascript? Couldn't you massage the result of R and OR it in the js before you process the chart? Another way would be to have a separate js/php/ whatever vb..net i think that would break R up in a usable format.

The problem for me is I dont follow how the graphs get the data :)

But I'm sure we can get some json/xml/output to do it, or am I missing something?

Here's my first crack at plotting individual relay data from the decimal representation:

http://bl.ocks.org/arch1/9178a77aea3d5775897a

the plotting code isn't very elegant yet (it's hard-coded to main relay and expansion relay box only) - but seems to work OK (with data gaps dealt with too).
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Sep 11, 2014 3:25 am
Awesome
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Thu Sep 11, 2014 4:23 am
AlanM wrote:Right. Is it because you use highstock.js instead of highchart.js? I wouldn't think so, though. Weird.


I can't work out how highcharts deal with irregular data either. Others have lobbied so far ? unsuccessfully for changes re data gaps:
http://forum.highcharts.com/highstock-usage/irregular-timeseries-data-with-night-and-weekend-gaps-t14075/page15.html
User avatar
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am
PostPosted: Thu Sep 11, 2014 7:17 pm
lnevo wrote:Very nice. The only thing you're missing is the mouse-overs to see the details.

Tooltips added in this version (I'm sure this code could be written in a fraction of the number of lines).

http://bl.ocks.org/arch1/d220e06fc3dcc4ea6d82

Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm
PostPosted: Fri Aug 21, 2015 7:34 am
Not sure I understand how the portal charts are supposed to work. I wanted to see how the wave maker was working with regards to my tide code and both PWMA and PWMD are both showing activity - or something with regards to plots in the chart.

Yet on the tank I can clearly see only one RW spinning up and the PWM D at 65% while the PWM A is at 0. What is the web chart actually plotting or do I need to enable something else. I was trying to see if it actually slowed down at night and if the left and right side alternated and at what time. Now I'm totally lost :)

Thanks.
-scott

status/chart.aspx?id=saf1&filter=PWMA
status/chart.aspx?id=saf1&filter=PWMD
PreviousNext

Return to Portal

Who is online

Users browsing this forum: No registered users and 2 guests

cron