views:

59

answers:

2

I'm working on a reporting app which displays incoming data as pie by default. We'd like to offer the user the ability to switch to bar, or column, or area, or any of the other charts with the click of a button. Since we already have the data in the app, it should be fairly simple no? Does anyone have an idea of how I might approach this?

andy

A: 

You can approach this a couple different ways. If it was me I would either set up a view stack with each of the chart types you want the user to switch to and they you can simply change the viewstack selectedIndex. Alternatively, you can have just a single chart holder container. Then just make function to dynamically generate each chart (Example). Then all you need to do is remove the existing and add the new chart.

Shua
A: 

I accomplish this by creating a state for each specific chart type. Then just change between states based on user input. You can use one data provider for each chart or create specific data providers for each.

Jeff Pinkston