Dominique,That is what I was thinking so I don't need to create a new class AttributeGroup, right?XAML FOR MY LINE GRID <userControls:CollapsiblePanel x:Name="LineGrid" IsExpanded="False" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="0,75,10,0" Width="420" Height="320" Effect="{StaticResource dropShadow}" >
<Grid Width="400" Height="300" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border Background="{StaticResource CommonPanelBorderBackgroundBrush}" BorderBrush="{StaticResource CommonBorderBrush}" BorderThickness="1" CornerRadius="6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Effect="{StaticResource miniDropShadow}" Style="{StaticResource RibbonElementBorder}" Padding="15" Margin="10" >
<chartingToolkit:Chart Title="Police DATA">
<chartingToolkit:Chart.Series>
<chartingToolkit:LineSeries IsSelectionEnabled="True" SelectionChanged="LineSeries_SelectionChanged"
Title="CAD CALL TYPE"
ItemsSource="{Binding}"
IndependentValuePath="KEY2"
DependentValuePath="Count"
/>
</chartingToolkit:Chart.Series>
</chartingToolkit:Chart>
</Border>
</Border>
<Image Source="images/CloseX.png" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="3" Stretch="None" Cursor="Hand" ToolTipService.ToolTip="Close" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown" >
<actions:ToggleCollapseAction TargetName="LineGrid" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</Grid>
</userControls:CollapsiblePanel>
CODE BEHIND WITH TWO DATACONTENT
// PIE CHART - create an enumeration of AttributeGroup from the graphics in your layer
DataContext = graphicsLayer.Graphics.GroupBy(graphic => (string)graphic.Attributes["TYPECODE"],
(typecode, graphics) => new AttributeGroup
{
Key = typecode,
Count = graphics.Count(),
Sum = graphics.Select(g => (int)g.Attributes["DOW"]).Sum(),
Graphics = graphics
}).ToArray();
//END PIE CHART
//LINE CHART
DataContext = graphicsLayer.Graphics.GroupBy(graphic => (int)graphic.Attributes["CALL"],
(call, graphics) => new AttributeGroup
{
Key2 = call,
// GISDATE = DateTime.ParseExact(gisdate.ToString(), "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture),
Count = graphics.Count(),
Sum = graphics.Select(g => (int)g.Attributes["DOW"]).Sum(),
Graphics = graphics
}).ToArray();
//END LINE CHART
But this seems to kind of break my pie chart...now my pie chart groups but the legend group names (CAD CALL TYPES) Don't display correctly instead of being names like Homicide, Robbery, or Assualt it is just 1, 2 , and/or 3.I think I need to assign the DataContext property a new value??? like if it was a type??private DataContext lineChartDataContent; ?????then use lineChartDataContent = graphicsLayer.Graphics.GroupBy(graphic => (int)graphic.Attributes["GISDATE"], (gisdate, graphics) => new AttributeGroupNot to sure can you enlighten me