cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jchicky
Advocate I
Advocate I

Dynamic charts with variables?

I created a bar chart with a table function in the Items property. For the values, I am using several variables that should update as a user manipulates certain parameters with a slider control. However, this is not working as I expected. If I add a label and set the Text property to one of the variables in the table function, the label updates as expected, but the table function does not seem to work the same way. Am I missing something? I would like the variables in the table function values to update as the user manipulates the slider so that the chart updates in real-time.
1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

Tables (with the Table function) should work with variables and controls. For example, in this example below:

ForumPost001.png

The Items property of the pie chart is set to the following expression:

Table(
    {Name:"First", Value:Slider1.Value},
    {Name:"Second", Value:Slider2.Value},
    {Name:"Third", Value:slider3Value}
)

And the OnChange property of the third slider (Slider3) is set to

UpdateContext({ slider3Value: Slider3.Value })

As the user updates the three sliders, the pie chart is updated to reflect the new values.

 

Can you provide more details of what you're seeing?

View solution in original post

1 REPLY 1
CarlosFigueira
Power Apps
Power Apps

Tables (with the Table function) should work with variables and controls. For example, in this example below:

ForumPost001.png

The Items property of the pie chart is set to the following expression:

Table(
    {Name:"First", Value:Slider1.Value},
    {Name:"Second", Value:Slider2.Value},
    {Name:"Third", Value:slider3Value}
)

And the OnChange property of the third slider (Slider3) is set to

UpdateContext({ slider3Value: Slider3.Value })

As the user updates the three sliders, the pie chart is updated to reflect the new values.

 

Can you provide more details of what you're seeing?

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,446)