on 07-14-2008 7:48 PM
This time I have a really stupid question.
I have a SQL query that returns 2 columns per row: a value and a timestamp.
I'd like to plot this data on an iChart.
What should I do?
I've already managed to make the timestamp appear on the X axis (by mapping it as a "Value Column" at the Data Mapping tab and by setting it as an "X-axis Value Column" at the X-Axis tab).
But how do I tell xMII about my Y-axis value?
I'm sorry to post this kind of question, but I've already lost an entire day on it and still couldn't make it work.
Thanks in advance!
Is your SQL query time based? Search the forum for DateColumn or
[SD] [ED]
to see previous inquiries like this.
Since your SQLQuery looks like a prototypical TagQuery result (DateTime,Value) you shouldn't have to do any extra mapping if it recognizes the date field in your template.
The YAxis will be Server Scaled by default, but you probably want to use Auto Scaling and a good way to learn how this aspect works is to use the Chart's built-in right click menu for chart properties. Once you figure out what you need then you can make the necessary settings in your display template.
Regards,
Jeremy
Edited by: Jeremy Good on Jul 14, 2008 3:48 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, it still doesn't work.
Let me tell the steps I've done.
- My query is as follows:
select DateTime, to_number(count(DateTime))
from (select to_timestamp(to_char(PARADA.DT_PARADA, 'dd/mm/yyyy'), 'dd/mm/yyyy') as DateTime from parada)
group by DateTime
order by DateTime
What I'm doing is grouping my data per day.
- I've created a Line iChart and took these steps:
- On X-Axis tab, I've set "X-Axis Value Columns" as DateTime
- Everything else has the default values
- My chart shows the right values on the x axis, but all 1 on the y axis.
Now, where should I tell xMII about the values I'm trying to plot?
Thanks!
Finally!!!!!!!!!
- I've changed my query to:
select DateTime, to_number(count(DateTime)) as total
from (select to_timestamp(to_char(PARADA.DT_PARADA, 'dd/mm/yyyy'), 'dd/mm/yyyy') as DateTime from parada)
group by DateTime
order by DateTime
There is, I've set an alias to my calculated field.
- I've mapped "total" as a Value Column on the Data Mapping tab
- I've set "Global Min. Ranges" and "Global Max. Ranges" to reasonable values and "Use Global Ranges" on Server Scalling tab. I guess this was the big thing to do.
And now it works!
Thanks you all for your help!
Jeremy,
On the Server Scalling tab, I've unset "Use Global Ranges" and "Use Global Server Scalling" and set "Use Global Auto. Scalling" and, as a result, my chart didn't use the values I have specified for "Global Min. Range" and "Global Max. Range", as I expected.
It did scale automatically.
Thanks a lot!
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.