3 Answers, 1 is accepted
Hello Stefano,
RadChartView provides a couple of specific series descriptor implementations that support most scatter and categorical series. However, not all series are covered with them. This includes the ScatterBubbleSeries. You can see a table showing the relation between the series and the descriptors, in the Dynamic Number of Series article.
In this situation, you can use the base ChartSeriesDescriptor that allows you to use any type of series. To make it work, you can simply define the Style of the series that should be created, and in the Style set its value binding properties.
<telerik:ChartSeriesDescriptor ItemsSourcePath="MyDataPointsCollection">
<telerik:ChartSeriesDescriptor.Style>
<Style TargetType="telerik:ScatterBubbleSeries">
<Setter Property="XValueBinding" Value="XValue"/>
<Setter Property="YValueBinding" Value="YValue"/>
<Setter Property="BubbleSizeBinding" Value="BubbleSize"/>
</Style>
</telerik:ChartSeriesDescriptor.Style>
</telerik:ChartSeriesDescriptor>
Alternatively, you can implement a custom descriptor and override its CreateInstanceCore method.
public class ScatterBubbleSeriesDescriptor : ChartSeriesDescriptor
{
public string XValueBinding { get; set; }
public string YValueBinding { get; set; }
public string BubbleSizeBinding { get; set; }
protected override ChartSeries CreateInstanceCore(object context)
{
var series = new ScatterBubbleSeries();
series.XValueBinding = new PropertyNameDataPointBinding(this.XValueBinding);
series.YValueBinding = new PropertyNameDataPointBinding(this.YValueBinding);
series.BubbleSizeBinding = new PropertyNameDataPointBinding(this.BubbleSizeBinding);
return series;
}
}
Can you please try this and let me know how it goes?
Regards,
Martin Ivanov
Progress Telerik
Hello Stefano,
It is nice to hear that the suggestion works.
Regards,
Martin Ivanov
Progress Telerik