Mailing List Archive

graph.usertag
Hello,
I am trying to use the graph.usertag on the RTFM site - looking at the documentation I have come up with the following syntax:
[graph type="lines" title="Temperature" x_label="Time" y_label="degrees c" query=""]
However, I do not really folow what the query should be. The documentation says:
query - SQL query returning data to populate the graph with. The first column
returned is the code or label of the dataset, the second column is the x-axis
label and the 3rd column is the y-axis point.
Does that mean that each row needs the dataset name - eg:
temp 10:00 20.0
temp 10:01 20.0
temp 10:02 19.9
etc
Given that the tag dates from 2007, is this still the best way to produce dynamic charts or has anyone used something else/

TIA

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: graph.usertag [ In reply to ]
On 08/18/2014 04:00 PM, dev2@adeux.net wrote:
> Hello,
> I am trying to use the graph.usertag on the RTFM site - looking at the documentation I have come up with the following syntax:
> [graph type="lines" title="Temperature" x_label="Time" y_label="degrees c" query=""]
> However, I do not really folow what the query should be. The documentation says:
> query - SQL query returning data to populate the graph with. The first column
> returned is the code or label of the dataset, the second column is the x-axis
> label and the 3rd column is the y-axis point.
> Does that mean that each row needs the dataset name - eg:
> temp 10:00 20.0
> temp 10:01 20.0
> temp 10:02 19.9
> etc
> Given that the tag dates from 2007, is this still the best way to produce dynamic charts or has anyone used something else/
>
> TIA
>

I cannot help you with this tag, never used it.

In a Dancer project we used Chart::Clicker and we really liked it.
Certainly better than the kind of dusty GD stuff.

Regards
Racke


--
Perl and Dancer Development

Visit our Perl::Dancer conference 2014:

http://act.perl.dance/

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: graph.usertag [ In reply to ]
Quoting dev2@adeux.net (dev2@adeux.net):
> Hello,
> I am trying to use the graph.usertag on the RTFM site - looking at the documentation I have come up with the following syntax:
> [graph type="lines" title="Temperature" x_label="Time" y_label="degrees c" query=""]
> However, I do not really folow what the query should be. The documentation says:
> query - SQL query returning data to populate the graph with. The first column
> returned is the code or label of the dataset, the second column is the x-axis
> label and the 3rd column is the y-axis point.
> Does that mean that each row needs the dataset name - eg:
> temp 10:00 20.0
> temp 10:01 20.0
> temp 10:02 19.9

If it did, then you could just do something like: SELECT 'temp', row1,
row2 FROM ...

--
Josh Lavin
Perusion -- Expert Interchange Consulting http://www.perusion.com/
... ask me about job opportunities ...

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: graph.usertag [ In reply to ]
On 08/19/2014 03:04 AM, Josh Lavin wrote:
> Quoting dev2@adeux.net (dev2@adeux.net):
>> I am trying to use the graph.usertag on the RTFM site

It's been ages since I've even looked at that tag, let alone when I
wrote it way back then. As Stefan already pointed out there are better
ways to do it now than with GD, but that said...

My first suggestion is that you just start playing around with it on an
Interchange page, see what it spits out with different options.

>> - looking at
>> the documentation I have come up with the following syntax:

>> [graph type="lines" title="Temperature" x_label="Time"
>> y_label="degrees c" query=""]

>> However, I do not really folow what the query should be. The
>> documentation says:

>> query - SQL query returning data to populate the graph with. The
>> first column returned is the code or label of the dataset, the
>> second column is the x-axis label and the 3rd column is the y-axis
>> point.

>> Does that mean that each row needs the dataset name - eg:
>> temp 10:00 20.0
>> temp 10:01 20.0
>> temp 10:02 19.9
>
> If it did, then you could just do something like: SELECT 'temp',
> row1, row2 FROM ...

Exactly. The point of allowing multiple data sets is that you could
have multiple overlaying line graphs with data for different cities, for
example, so you might have a data set for "Los Angeles", one for "New
York", one for "Cincinnati", etc, and you would get a different colored
line overlapping on the graph for each. There is a similar idea behind
bar graphs, etc. If you just have one dataset then you only need to
return the one dataset from your query and just give each the same name
as Josh pointed out above.

Incidentally, I don't recall if the version posted on RTFM is the most
current or not. If not you can grab it from:
https://github.com/pajamian/stuff/blob/master/interchange/graph.usertag


Peter

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users