15
Views
3
Comments
Solved
Filter down graph to show all values in graph not SUM of values within timestamps
Application Type
Traditional Web

I have a data which takes in two timestamps as an input and searches for the results in the data within the two timeframes given. This is then represented in a graph as the SUM of each timestamp given.


I would like to click on one of the hourly values and it show a more filtered down graph of the results within that hour in a new page as single points rather than the sum. I have tried using DataPoint_GetClicked but it shows the Sum as the value and the hour as the label.

I am trying to show all the values within that time that is selected from the graph. I have attached an OML of my work so far.


Thanks




test123.oml

Rank: #129
Solution

Hi Yats,


there are 2 obvious things that prevent your Webscreen3 from working correct

* your aggregate doesn't have a filter yet, allways retrieving all entries in the database, not just the ones in the selected hour

* your properties of the chart have the import variables mapped as label and value, meaning they will show the selected details from Webscreen2 for every datapoint.

your mapping :

it should be :


There were much more things with your example that I didn't like, and I got a bit carried away with changing it, but hey, there has to be something in it for me as well, right ?

See attached my changed version of your oml, I have put everything on a single screen, but you can get inspiration for your example.  For one thing, I really didn't get all the logic you had on webscreen2, so I threw all that out.


Happy coding,

Dorine

test123changed.oml

Rank: #35324

Thank you very much for you help, this is exactly it.

However I need the graph to display in a new page but I cant add the ajax refresh to the Onclick function as I have more than one graph.

How would I add the new graph showing selected hour in a new page?

Also another question with the graph as  you changed the label how would I display the values in order like it was showing before and add +1 to the hour so it shows 19:00 - 20:00 as the label  ?

Rank: #129


Well,

your original oml already went to another page in the onclick, so just keep that.

Just fix the 2 things I mentioned, don't look at my version of your oml.

that should already get you a long way


But there's a lot more wrong, like you can't see data from the last hour of the day, as 24:00 is not a valid time.  That's just one example, but I'm sure you'll discover them along the way.