I cant seem to figure out how to work with a bubble chart.
My two problems are
1) How do I place a label on each bubble? Am I using the correct chart type?
2) Putting two series in place, the chart puts the bubbles on the same place.
I have a chart displayed with no data, and 3 buttons. One for each year.
When I click the year button, the WCF comes back and draws bubbles, but no label is displayed for each bubble.
Changing to a Line3DSeriesDefinition shows the label fine but I dont want that chart type. Scatter series maybe, but then no lable appears either.
Next problem is clicking a 2nd year button puts an new series of bubble on, but they are on top of the first series. Why are they not placed on different points as the data is different?
Here is my xmal.
-----------------
<telerik:RadChart x:Name="chtChart"
Margin="10"
Grid.Row="1"
Grid.ColumnSpan="3"
BorderThickness="1,1,1,1"
d:LayoutOverrides="Height" >
<control:RadChart.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFF8F8F8" Offset="1"/>
<GradientStop Color="#FFD2CB1A"/>
<GradientStop Color="{StaticResource ChartBgBrush}" Offset="0.392"/>
</LinearGradientBrush>
</control:RadChart.Background>
</telerik:RadChart>
-----------------
Here's my C#
------------------------------
void btnYear_Click(object sender, RoutedEventArgs e)
{
var MyService = new BrandDataServiceReference.BrandzWcfServiceClient();
MyService.GetChartDataCompleted += new EventHandler<BrandDataServiceReference.GetChartDataCompletedEventArgs>(MyService_GetChartDataCompleted);
MyService.GetChartDataAsync(Convert.ToInt32(((Button)sender).DataContext.ToString()));
}
void MyService_GetChartDataCompleted(object sender, BrandDataServiceReference.GetChartDataCompletedEventArgs e)
{
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new BubbleSeriesDefinition();
seriesMapping.LegendLabel = Convert.ToString(e.Result[0].Year);
seriesMapping.ItemMappings.Add(new ItemMapping("X_Value", DataPointMember.XValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Y_Value", DataPointMember.YValue));
// Lines below dont do anything
seriesMapping.ItemMappings.Add(new ItemMapping("Name", DataPointMember.Label));
seriesMapping.ItemMappings.Add(new ItemMapping("Name", DataPointMember.Tooltip));
// Lines above dont do anything
chtChart.ItemsSource = e.Result;
chtChart.SeriesMappings.Add(seriesMapping);
}
------------------------------