cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to implement a bar graph in TouchGFX as shown below

BGuth.1
Senior

Hi,

Is it possible to implement a dynamic bar graph in TouchGFX as shown in picture. If yes, please point me to help/tutorial/example.

0693W00000APsXJQA1.png

1 ACCEPTED SOLUTION

Accepted Solutions
  1. For the colors it is something you can set in the "Elements" settings as well: click on the "histogram" element, it will scroll down and show the settings like the color, bar width, ...
  2. I can't remember exactly how easy it is to have multiple colors within one graph (it is possible) so what I usually do is just use multiple graph widgets and put them on top of each other ��
  3. Yes, you just need to setup the value range in the "Data Points" settings to -1000 to 1000

EDIT: I just realized your graph went from 1000 - 0 - 1000 kWh and not -1000. This is still possible that way you just have to adapt your Y axis label to display 1000 instead of -1000

/Romain

View solution in original post

4 REPLIES 4
Romain DIELEMAN
ST Employee

Hi,

The widget "Dynamic Graph" supports different format like the Histogram format. To do so go to the "Elements" settings in the dynamic graph widget configuration tab, press the "Add Element" button and select "Histogram".

/Romain

Hi @Romain DIELEMAN​ ,

Thank you for pointing to "Elements" setting. I see that histogram is possible. I have these follow up questions.

  1. Is it possible to use different colors for the histogram bars ( as shown in my picture). I want a set of bars to have one color, a different set of bars with different color etc.
  2. Is it possible use multiple colors for a single histogram bar at a time (as shown in my picture)? i.e. A portion of the bar with one color, a different portion of the same bar with a different color etc.
  3. Is it possible to show some bars top to bottom instead of bottom to top (as show in my picture with orange bars)?

Thanks in advance for your reply.

  1. For the colors it is something you can set in the "Elements" settings as well: click on the "histogram" element, it will scroll down and show the settings like the color, bar width, ...
  2. I can't remember exactly how easy it is to have multiple colors within one graph (it is possible) so what I usually do is just use multiple graph widgets and put them on top of each other ��
  3. Yes, you just need to setup the value range in the "Data Points" settings to -1000 to 1000

EDIT: I just realized your graph went from 1000 - 0 - 1000 kWh and not -1000. This is still possible that way you just have to adapt your Y axis label to display 1000 instead of -1000

/Romain

Thank you. That helps.