cancel
Showing results for 
Search instead for 
Did you mean: 

Help with iChart

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Jeremy, thanks a lot for your attention.

I still don't know how can I set this "DateColumn" parameter if not from scripting. I didn't see any such option on Workbench...

Former Member
0 Kudos

Eduardo,

Jeremy suggestion will work fine, if your DateColumn name is exactly DateTime (Case Sensitive).

Regards

Pedro

Former Member
0 Kudos

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!

Former Member
0 Kudos

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!

jcgood25
Active Contributor
0 Kudos

Did you try Global Auto Scaling instead of Global Server Scaling? You can also combine this with Zero Based Scale if needed.

Regards,

Jeremy

Former Member
0 Kudos

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!

Answers (0)