Binding Dropdowns and Charts

I have list of sensor data, temperature and humidity, coming from my tags and is stored in history. I want to have options, temperature and humidity, on my dropdown list and when I select temperature, I want the chart to be populated with temperature data over time and the same for humidity. How can I do it?

  1. Please tag your question as Perspective or Vision. The answer will depend on which you are using.

  2. It's not clear what you are looking for. If I read it correctly it seems that you want the chart to display either temperature or humidity. In that case I suggest the following options:

  • Use a Radio Group with two options, ( ) Temperature ( ) Humidity. It means that both options are visible to the user and the display can be switched with one click. A dropdown hides the other options and it takes two clicks to make a selection.
  • You can display both on the one chart with two Y-axes - one on the left and one on the right.
  • You could create two charts.
  • You could toggle the visibility of each plot and Y-axis based on the radio group.

Please clarify item one and give more detail or a mockup screen shot of what you want.

Thank you @Transistor for your response.

I'm using Vision.
I'm looking for an option with multiple selection. I need to select temperature, humidity or both and display the graph of the selection in the chart.

I need to select temperature, humidity or both ...

Then add a third radio button: .( ) Temperature ( ) Humidity ( ) Both.

I don't use Vision much so I'll leave the answer to someone else.

I would create three custom dataset properties on the root container to hold the desired pen(s) configuration for each of the three possibilities. Then use a case() expression function binding driven by the dropdown value (or radio button) to pick the appropriate config for the EasyChart's tagPens property.

Thank you for your response @pturmel. How do I enable multiple selection in dropdown? I might need to display more data along with temperature and humidity such as light and sound. So what is the best approach to take? Will it be better to use check box instead?

If you want multiple selection, you will need to script the assembly of the .pens or .tagPens dataset(s) to have the rows indicated by your selection method. (I would probably use a list component for that.)