locked
Dashboard: GridView and Multiple Charts RRS feed

  • Question

  • I'm working on a Store app that consists of several charts. I've already developed the charts and have them rendering using the chart control in the various forms.

    I have been asked to bring these together in an app that allows the user to scroll left and right through each of the charts.

    Every example I have found for using a GridView data binds the content of the GridView to item templates.

    What I'm trying to get my head round is how I could please these chart controls directly in to a GridView.

    Any help would be greatly appreciated.

    Cheers,

    Roy

    Thursday, December 5, 2013 6:53 PM

Answers

  • You can use a FlipView and explicitly set the FlipViewItems to your different charts without overriding the ItemTemplate for databinding.

    Alternately you can set snap points in the ScrollViewer, which is what the FlipView does internally. Which is best depends on what behavior you want for your app. If flipping through the charts on different logical pages makes sense then a FlipView would be a good choice.

    --Rob

    Saturday, December 7, 2013 12:47 AM
    Moderator

All replies

  • I'm not sure I understand the scenario completely, so please elaborate if this doesn't make sense.

    If you have many data items and want to use the same set of charts (with different data) for each item then you can include the charts in your item templates.

    If you just want to have a single set of charts then you probably don't want a GridView. You can lay them out in a normal grid and put it in a ScrollViewer.

    If you need more details please let us know what specifically you're looking for.

    --Rob

    Thursday, December 5, 2013 8:15 PM
    Moderator
  • I think I need to use a FlipView of ScrollerView.

    Ned the chart to "snap" to the left when you swipe. Have a ScrollerView working - but not snapping.

    Trying to configure a FlipView, but not sure how to set up the ItemTemplate as the charts differ - or do I just ignore the ItemTemplate?

    Cheers,

    Roy

    Friday, December 6, 2013 1:20 PM
  • You can use a FlipView and explicitly set the FlipViewItems to your different charts without overriding the ItemTemplate for databinding.

    Alternately you can set snap points in the ScrollViewer, which is what the FlipView does internally. Which is best depends on what behavior you want for your app. If flipping through the charts on different logical pages makes sense then a FlipView would be a good choice.

    --Rob

    Saturday, December 7, 2013 12:47 AM
    Moderator