I am trying to decoratively create a Scatter Chart that is data bound.
I understand that your latest version support creating scatter charts with BubbleSeries. But how can I do this is XAML? The only examples in your gallery are done in code.
If I am using a Bubble Chart, how do I do this in XAML. I am using VS2010 and Blend SL4 (and your SL4 toolkit) but I am getting nothing but syntax errors:
xmlns:tc="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
<tc:RadChart
x:Name="chartObject"
ItemsSource="{Binding EventData, Mode=OneWay}"
d:LayoutOverrides="Width, Height">
<tc:RadChart.SeriesMappings>
<tc:RadChart.SeriesMappings.SeriesDefinition>
<tc:RadChart.SeriesMappings.SeriesDefinition.BubbleSize.
</tc:RadChart.SeriesMappings.SeriesDefinition>
</tc:RadChart.SeriesMappings>
</tc:RadChart>
The documentation is thin on this subject (I read through all your help API help on RadCharts) and the only help I have is this one exmaple in the gallery done in C#. Can you post something like this simple example done entirely in XAML? I also want to style the DataPoints. So a place holder for where one binds the DataPointTemplate to a <DataTemplate> would be great. (I already have enough information for how to create a DataTemplate and bind it to values from the collection).
private void FillSampleChartData()
{
SeriesMapping sm1 = new SeriesMapping();
sm1.SeriesDefinition = new BubbleSeriesDefinition();
sm1.LegendLabel = "Bubble Series 1";
sm1.CollectionIndex = 0;
ItemMapping imY1 = new ItemMapping("Y", DataPointMember.YValue);
ItemMapping imBS1 = new ItemMapping("BubbleSize", DataPointMember.BubbleSize);
sm1.ItemMappings.Add(imY1);
sm1.ItemMappings.Add(imBS1);
SeriesMapping sm2 = new SeriesMapping();
sm2.SeriesDefinition = new BubbleSeriesDefinition();
sm2.LegendLabel = "Bubble Series 2";
sm2.CollectionIndex = 1;
ItemMapping imY2 = new ItemMapping("Y", DataPointMember.YValue);
ItemMapping imBS2 = new ItemMapping("BubbleSize", DataPointMember.BubbleSize);
sm2.ItemMappings.Add(imY2);
sm2.ItemMappings.Add(imBS2);
RadChart1.SeriesMappings.Add(sm1);
RadChart1.SeriesMappings.Add(sm2);
List<List<UserDataPoint>> itemsSource = new List<List<UserDataPoint>>() { SeriesExtensions.GetUserBubbleData(), SeriesExtensions.GetUserBubbleMixedData() };
RadChart1.ItemsSource = itemsSource;
}
}
}
I understand that your latest version support creating scatter charts with BubbleSeries. But how can I do this is XAML? The only examples in your gallery are done in code.
If I am using a Bubble Chart, how do I do this in XAML. I am using VS2010 and Blend SL4 (and your SL4 toolkit) but I am getting nothing but syntax errors:
xmlns:tc="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
<tc:RadChart
x:Name="chartObject"
ItemsSource="{Binding EventData, Mode=OneWay}"
d:LayoutOverrides="Width, Height">
<tc:RadChart.SeriesMappings>
<tc:RadChart.SeriesMappings.SeriesDefinition>
<tc:RadChart.SeriesMappings.SeriesDefinition.BubbleSize.
</tc:RadChart.SeriesMappings.SeriesDefinition>
</tc:RadChart.SeriesMappings>
</tc:RadChart>
The documentation is thin on this subject (I read through all your help API help on RadCharts) and the only help I have is this one exmaple in the gallery done in C#. Can you post something like this simple example done entirely in XAML? I also want to style the DataPoints. So a place holder for where one binds the DataPointTemplate to a <DataTemplate> would be great. (I already have enough information for how to create a DataTemplate and bind it to values from the collection).
private void FillSampleChartData()
{
SeriesMapping sm1 = new SeriesMapping();
sm1.SeriesDefinition = new BubbleSeriesDefinition();
sm1.LegendLabel = "Bubble Series 1";
sm1.CollectionIndex = 0;
ItemMapping imY1 = new ItemMapping("Y", DataPointMember.YValue);
ItemMapping imBS1 = new ItemMapping("BubbleSize", DataPointMember.BubbleSize);
sm1.ItemMappings.Add(imY1);
sm1.ItemMappings.Add(imBS1);
SeriesMapping sm2 = new SeriesMapping();
sm2.SeriesDefinition = new BubbleSeriesDefinition();
sm2.LegendLabel = "Bubble Series 2";
sm2.CollectionIndex = 1;
ItemMapping imY2 = new ItemMapping("Y", DataPointMember.YValue);
ItemMapping imBS2 = new ItemMapping("BubbleSize", DataPointMember.BubbleSize);
sm2.ItemMappings.Add(imY2);
sm2.ItemMappings.Add(imBS2);
RadChart1.SeriesMappings.Add(sm1);
RadChart1.SeriesMappings.Add(sm2);
List<List<UserDataPoint>> itemsSource = new List<List<UserDataPoint>>() { SeriesExtensions.GetUserBubbleData(), SeriesExtensions.GetUserBubbleMixedData() };
RadChart1.ItemsSource = itemsSource;
}
}
}