on 04-27-2009 3:02 PM
Hi,
I want to make a chart where the user can choose which data he wants to see. I have 3 options where somebody can choose from. But how can I combine 2 tag queries in one chart.
I already got 2 options, but there not the best one.
Option 1:
Make 1 tag query with all 3 lines and change the color from the pens to white when they don't want to see a line. (but then you get white spaces in your other lines)
Option 2:
Make 7 tag queries for each option (1&2&3;1&2;1&3;2&3;1;2;3). Drawback here is that I have to create so many tags... If I ever want to display 4 lines than I have a big problem.
I would be great if I could create 3 tag queries for each line and then combine them and put them in one graph
Does someone has any idea how to solve this?
Thank you!!
Jan
How dynamic are the tag / line combinations? If the user is only presented with a choice of lines, then do you know exactly which tags to use when they choose a line(s)? If so then some simple arrays for each line and using document.APPLET.getQueryObject().setTagName(x,strName); should be easy enough. It would still be only a single tag query with Server and Mode, but the tags would be driven from the client choices.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here something else you can do, it sort of emulates the "Tag Group" feature that is popular in most SCADA applications. With an XML file (or can use a database for this) you can define a groups of tags with whatever parameters you wish ie, color, line width line style, upper and lower pen limits etc. Then to render them on the page you can us a query (either XML query or SQL query depending on how you wish to store your tag information) From here you use some straightforward javascript to assign the tag information to the chart.
For fun, you can even have the user build their own tag groups and save them (again either as XML or in a database) Since your applet properties are both read and write, if you leave the chart applet user configurable, you could actually suck out the parameters of a chart they configured and save it as a "tag group" There all sorts of possibilities with this.
The "setTagName" and tag group approaches are optimal when all of the tags/datapoints are coming from the same data source. However, MII can also display data from multiple data sources on the same chart (or other applet) quite easily. Use BLS along with the Union (or, in some cases, Joiner) action to create a consolidated dataset that can be returned to the applet for display.
You should invest your time on BLS and XPath expressions to make your logics.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jan_Vanderstappen,
You can have a chart with one of the queries as default. Then base on user inputs, you can use Javascript to change the query object assigned to that applet at runtime.
BR,
SB.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
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.