Select to view content in your preferred language

Bar Charts

901
1
02-22-2011 11:08 AM
JayKappy
Frequent Contributor
Looking to create a Bar Chart adn having a few issues...I have looked at multipl examples and cant seem to bind to a data source

I think that I am having an issues with the ItemsSource
Right now I have the data returning to a listbox and that works fine....just need to convet it to a bar chart....

Thanks

<Grid >
     <chartingToolkit:Chart Name="Charting" Title="Bar Chart">
          <chartingToolkit:Chart.Series>
                 <chartingToolkit:PieSeries ItemsSource="{Binding Results2, Source={StaticResource Officer}}" IndependentValueBinding="{Binding Officer}" DependentValueBinding="{Binding IncidentNums}"/>
                 </chartingToolkit:Chart.Series>
          </chartingToolkit:Chart>
</Grid>
        Dim results2 = From g In featureSet
                       Order By CStr(g.Attributes("Officer")) Ascending
                        Group g By GroupKey = CStr(g.Attributes("Officer")) Into r = Group
                        Select New With {Key .Officer = GroupKey, Key .IncidentNums = r.Sum(Function(i) Convert.ToInt32(i.Attributes("IncidentNum")) / 10)}


        Me.Results2.ItemsSource = Results2
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
This seems like a Silverlight question too. You can post these type of questions at Microsoft forums since you are using their Toolkit. You may also want to check out this page https://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html
0 Kudos