Graphic proc_get_pieSymbol(double gps_x, double gps_y, KeyValuePair<string, int>[] _serie) { // PIE Symbol definition PieMarkerSymbol _symbol = new ESRI.ArcGIS.Samples.PieChartSymbology.PieMarkerSymbol(); // Graphic definition Graphic _graphic = new Graphic(); // Independant value definition foreach (var elt in _serie) { _symbol.Fields.Add(new ESRI.ArcGIS.Samples.PieChartSymbology.Field() { DisplayName = elt.Key, FieldName = elt.Key }); } // Attach the preview symbol to a graphic for graphic layer _graphic.Symbol = _symbol; // Definition of dependant value. Note KeyValuePair<string, objet> is necessary to define value. The key must be an sepecific "independant value" and "object" is the dependant. // In my case, object is <int> foreach (var elt in _serie) { _graphic.Attributes.Add(new KeyValuePair<string, object>(elt.Key, elt.Value)); } // definition of destination gps position on the map _graphic.Geometry = new MapPoint(gps_x, gps_y); // the pie Symbol as Graphic for Graphics Layer is right now! return _graphic; }
xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
<esri:InfoWindow x:Name="MyInfoWindow" MouseLeftButtonUp="MyInfoWindow_MouseLeftButtonUp" Map="{Binding ElementName=MyMap}" Width="500" Height="300"> <Grid> <Border> <chart:RadChart x:Name="RadChart1"> <chart:RadChart.DefaultView> <charting:ChartDefaultView> <charting:ChartDefaultView.ChartArea> <charting:ChartArea LegendName="legend" Margin="0,0,20,0"> <charting:ChartArea.AxisY> <charting:AxisY AutoRange="False" MinValue="0" MaxValue="220" Step="20" MinorTicksVisibility="Collapsed"> <charting:AxisY.AxisStyles> <charting:AxisStyles ItemLabelStyle="{StaticResource CustomYAxisItemLabelStyle}"></charting:AxisStyles> </charting:AxisY.AxisStyles> </charting:AxisY> </charting:ChartArea.AxisY> <charting:ChartArea.AxisX> <charting:AxisX> <charting:AxisX.AxisStyles> <charting:AxisStyles ItemLabelStyle="{StaticResource CustomYAxisItemLabelStyle}"></charting:AxisStyles> </charting:AxisX.AxisStyles> </charting:AxisX> </charting:ChartArea.AxisX> </charting:ChartArea> </charting:ChartDefaultView.ChartArea> <charting:ChartDefaultView.ChartLegend> <charting:ChartLegend x:Name="legend" Visibility="Collapsed" /> </charting:ChartDefaultView.ChartLegend> </charting:ChartDefaultView> </chart:RadChart.DefaultView> <chart:RadChart.SeriesMappings> <charting:SeriesMapping LegendLabel="Spectrum"> <charting:SeriesMapping.SeriesDefinition> <charting:HorizontalBarSeriesDefinition ShowItemLabels="True"> </charting:HorizontalBarSeriesDefinition> </charting:SeriesMapping.SeriesDefinition> <charting:ItemMapping DataPointMember="XCategory" FieldName="MinFrequency" /> <charting:ItemMapping DataPointMember="YValue" FieldName="BinData" /> </charting:SeriesMapping> </chart:RadChart.SeriesMappings> </chart:RadChart> </Border> </Grid> </esri:InfoWindow>
<Style x:Key="CustomYAxisItemLabelStyle" TargetType="TextBlock"> <Setter Property="TextAlignment" Value="Left" /> <Setter Property="FontSize" Value="8" /> </Style>
<esri:GraphicsLayer ID="LeakLoggers" Renderer="{StaticResource LeakLoggerRenderer}" MouseLeftButtonDown="LeakLoggers_MouseLeftButtonDown" />
private void LeakLoggers_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) { long dcomId = 0; try { dcomId = Convert.ToInt64(e.Graphic.Attributes["DcomId"]); } catch { } // Retrieve the noise spectrum for this LD Logger ObservableCollection<LoggerSpectrum> oneSpectrum; bool foundSpectrum = NoiseSpectra.TryGetValue(dcomId, out oneSpectrum); if (foundSpectrum) { MyInfoWindow.Anchor = new ESRI.ArcGIS.Client.Geometry.MapPoint(e.Graphic.Geometry.Extent.XMin, e.Graphic.Geometry.Extent.YMin); MyInfoWindow.IsOpen = true; RadChart1.ItemsSource = oneSpectrum; } }
private void MyInfoWindow_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { MyInfoWindow.IsOpen = false; }
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.