<Grid x:Name="LayoutRoot"> <esri:Map x:Name="MyMap"> <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Visible="True" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> <esri:FeatureLayer ID="MyGraphicsLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2" Mode="OnDemand" OutFields="*" OnDemandCacheSize="5" /> </esri:Map> <esri:FeatureDataGrid Grid.Row="2" x:Name="MyDataGrid" Height="180" VerticalAlignment="Bottom" Map="{Binding ElementName=MyMap}" GraphicsLayer="{Binding ElementName=MyMap, Path=Layers.[MyGraphicsLayer]}" /> <charting:Chart Name="myChart" Title="Population" Height="300" Width="400" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{StaticResource CommonBackgroundBrush}"> <charting:ColumnSeries Title="Population 1990" ItemsSource="{Binding ElementName=MyMap, Path=Layers[MyGraphicsLayer].Graphics}" DependentValuePath="Attributes[POP1990]" IndependentValuePath="Attributes[STATE_NAME]" IsSelectionEnabled="True" SelectionChanged="ColumnSeries_SelectionChanged"/> <charting:ColumnSeries Title="Population 1999" ItemsSource="{Binding ElementName=MyMap, Path=Layers[MyGraphicsLayer].Graphics}" DependentValuePath="Attributes[POP1999]" IndependentValuePath="Attributes[STATE_NAME]" SelectedItem="{Binding ElementName=MyMap, Path=Layers[MyGraphicsLayer].SelectedGraphics[0]}" /> <charting:Chart.Axes> <charting:CategoryAxis Orientation="X" SortOrder="Ascending"> <charting:CategoryAxis.AxisLabelStyle> <!-- Text Vertical --> <Style TargetType="charting:AxisLabel"> <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/> <Setter Property="RenderTransform"> <Setter.Value> <RotateTransform Angle="-90"/> </Setter.Value> </Setter> </Style> </charting:CategoryAxis.AxisLabelStyle> </charting:CategoryAxis> </charting:Chart.Axes> </charting:Chart> </Grid>
private void ColumnSeries_SelectionChanged(object sender, SelectionChangedEventArgs e) { Graphic g = (sender as ColumnSeries).SelectedItem as Graphic; if (g != null) g.Selected = true; }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.