cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mstrapko
Level: Powered On

Please Help: Control LineChart Series with ComboBox.

Hello,

 

Im trying to make simple app that will show LineChart with ability to select Series (Rozv.x ) to be shown from Combo Box.

data can be stored in the underlayng table anyway, just to make it work.

 

I tryed everything but I always encounter a problem that in ShowColumns column names needs to be string in " " not variable returned by the ComboBox Smiley Sad

 

Sample data:

 

Date ( X axe )Rozv.1Rozv.2Rozv.3Rozv.4
110262
220489
33061016
44081223
550101430
660121637
770141844
880162051
990182258
10100202465
11110222672
12120242879
13130263086
14140283293
151503034100

 

Thank you very much.

 

3 REPLIES 3
jamiewr
Level 8

Re: Please Help: Control LineChart Series with ComboBox.

Try using a Switch function.  

 

For example, if the dropdown's options were:

ColumnA

ColumnB

ColumnC

 

Use the Switch like so:

 

Switch(

Dropdown.Selected.Value,

"ColumnA",

ShowColumns(SourceName,"ColumnA"),

"ColumnB",

ShowColumns(SourceName,"ColumnB"),

"ColumnC",

ShowColumns(SourceName,"ColumnC")

)

 

PS - Have you tried Power BI?  Might be a better option for data visualization.

 

Community Support Team
Community Support Team

Re: Please Help: Control LineChart Series with ComboBox.

Hi @mstrapko,

Could you please share a bit more about your scenario?

Further, could you please show more details about the ShowColumns formula within your app?

I have made a test on my side, if you want to select Series (Rozv.x ) to be shown within your Line Chart control from Combo Box, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mstrapko
Level: Powered On

Re: Please Help: Control LineChart Series with ComboBox.

Hello, I spent 3 days trying everything and it works somehow Smiley Happy Here is my solution ( sorry right now I dont have much time to clean it up and prepare nice example just for you. And Im not a fulltime programmer so take it easy Smiley Happy 1) excel sheet as data source named Table1 ( attached ) 2) Combo box Named Profily with Data: Table1, OnChange : ClearCollect(TEST1, ShowColumns(Table1, "Column1")) 3) CompositeLineChart Items: "AddColumns(TEST1, "Rozvadzac01", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac01", Column1 ) = "1", LookUp(Table1, Column1 = TEST1[@Column1], h1)), "Rozvadzac02", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac02", Column1 ) = "2", LookUp(Table1, Column1 = TEST1[@Column1], h2)), "Rozvadzac03", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac03", Column1 ) = "3", LookUp(Table1, Column1 = TEST1[@Column1], h3)), "Rozvadzac04", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac04", Column1 ) = "4", LookUp(Table1, Column1 = TEST1[@Column1], h4)), "Rozvadzac05", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac05", Column1 ) = "5", LookUp(Table1, Column1 = TEST1[@Column1], h5)), "Rozvadzac06", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac06", Column1 ) = "6", LookUp(Table1, Column1 = TEST1[@Column1], h6)), "Rozvadzac07", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac07", Column1 ) = "7", LookUp(Table1, Column1 = TEST1[@Column1], h7)), "Rozvadzac08", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac08", Column1 ) = "8", LookUp(Table1, Column1 = TEST1[@Column1], h8)), "Rozvadzac09", If(LookUp( Profily.SelectedItems, poradie = "Rozvadzac09", Column1 ) = "9", LookUp(Table1, Column1 = TEST1[@Column1], h9)) ) " , Labels: Column1, Series1: Rozvadzac01, Series2:Rozvadzac02, Series2:Rozvadzac03... , Legend: Profily.SelectedItems . There is probably a purest way to achive this but Im not skilled enought to find it. I wish that "SeriesN" properties of LineChart was acessible by function and also more capable ForAll function that can do more than only Patch and Collect for example: ClearCollect and modify variable etc. Anyway thank you for support I was really suprised that you care Smiley Happy With Best regards, Milan.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 247 members 3,883 guests
Please welcome our newest community members: