Class BubbleSeries
Bubble series displays a set of circular symbols of varying size. It is represented by closely packed circles, whose areas are proportional to the quantities.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.UWP.dll
Syntax
public class BubbleSeries : XyDataSeries, ICloneable, ISupportAxes2D, ISupportAxes, ISegmentSelectable
Remarks
BubbleSeries requires an additional data binding parameter Size in addition to X,Y parameters. The size of each bubble depends on the size value given in the data point.MinimumRadius and MaximumRadius properties can be used to control the minimum and maximum radius of the symbols.
Examples
<syncfusion:BubbleSeries ItemsSource="{Binding Data}" XBindingPath="Year" YBindingPath="Value" Size="Size">
</syncfusion:BubbleSeries>
BubbleSeries series1 = new BubbleSeries();
series1.ItemsSource = viewmodel.Data;
series1.XBindingPath = "Year";
series1.YBindingPath = "Value";
series1.Size="Size";
chart.Series.Add(series1);
Constructors
BubbleSeries()
Called when instance created for BubbleSeries
Declaration
public BubbleSeries()
Fields
CustomTemplateProperty
The DependencyProperty for CustomTemplate property.
Declaration
public static readonly DependencyProperty CustomTemplateProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
MaximumRadiusProperty
The DependencyProperty for MaximumRadius property.
Declaration
public static readonly DependencyProperty MaximumRadiusProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
MinimumRadiusProperty
The DependencyProperty for MinimumRadius property.
Declaration
public static readonly DependencyProperty MinimumRadiusProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SegmentSelectionBrushProperty
The DependencyProperty for SegmentSelectionBrush property.
Declaration
public static readonly DependencyProperty SegmentSelectionBrushProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SelectedIndexProperty
The DependencyProperty for SelectedIndex property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ShowZeroBubblesProperty
The DependencyProperty of ShowZeroBubbles property
Declaration
public static readonly DependencyProperty ShowZeroBubblesProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SizeProperty
The DependencyProperty for Size property.
Declaration
public static readonly DependencyProperty SizeProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
Properties
CustomTemplate
Gets or sets the custom template for this series.
Declaration
public DataTemplate CustomTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate | Windows.UI.Xaml.DataTemplate |
Examples
This example, we are using ScatterSeries.
<syncfusion:ScatterSeries ItemsSource="{Binding Demands}" XBindingPath="Demand" YBindingPath="Year2010"
ScatterHeight="40" ScatterWidth="40">
<syncfusion:ScatterSeries.CustomTemplate>
<DataTemplate>
<Canvas>
<Path Data="M20.125,32l0.5,12.375L10.3125,12.375L10.3125,0.5L29.9375,0.5L29.9375,12.375L39.75,12.375Z"
Stretch="Fill" Fill="{Binding Interior}" Height="{Binding ScatterHeight}" Width="{Binding ScatterWidth}"
Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}"/>
</Canvas>
</DataTemplate>
</syncfusion:ScatterSeries.CustomTemplate>
</syncfusion:ScatterSeries>
MaximumRadius
Gets or sets a value that specifies the maximum size for each bubble segment. This is a bindable property.
Declaration
public double MaximumRadius { get; set; }
Property Value
Type |
---|
System.Double |
MinimumRadius
Gets or sets the maximum size for each bubble.
Declaration
public double MinimumRadius { get; set; }
Property Value
Type |
---|
System.Double |
SegmentSelectionBrush
Gets or sets the interior (brush) for the selected segment(s).
Declaration
public Brush SegmentSelectionBrush { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.Media.Brush | The Windows.UI.Xaml.Media.Brush value. |
Examples
series.SegmentSelectionBrush = new SolidColorBrush(Colors.Red);
SelectedIndex
Gets or sets the index of the selected segment.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
|
ShowZeroBubbles
Gets or sets a value that indicates whether to show the bubble segment when apply size value to 0. This is a bindable property.
Declaration
public bool ShowZeroBubbles { get; set; }
Property Value
Type |
---|
System.Boolean |
Size
Gets or sets the property binding path that specifies the bubble series size. This is a bindable property.
Declaration
public string Size { get; set; }
Property Value
Type |
---|
System.String |
Methods
CloneSeries(DependencyObject)
Returns the instance of BubbleSeries series.
Declaration
protected override DependencyObject CloneSeries(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.DependencyObject | obj | object |
Returns
Type |
---|
Windows.UI.Xaml.DependencyObject |
Overrides
CreateSegment()
Creates an instance of series segment.
Declaration
protected override ChartSegment CreateSegment()
Returns
Type | Description |
---|---|
ChartSegment | Returns the instance of corresponding series segment. |
Overrides
Remarks
This customization is not supported for fast type series and technical indicators.
Examples
This sample shows how to call the CreateSegment() method to customize the line series segments.
public class LineSeriesExt : LineSeries
{
protected override ChartSegment CreateSegment()
{
return new LineSegmentExt();
}
}
public class LineSegmentExt : LineSegment
{
public override UIElement CreateVisual(Size size)
{
// Write your customization code here.
}
public override void Update(IChartTransformer transformer)
{
// Write your customization code here.
}
}
CreateSegments()
Creates the Segments of BubbleSeries.
Declaration
public override void CreateSegments()
Overrides
GeneratePoints()
Method used to generate points for bubble series.
Declaration
protected override void GeneratePoints()
Overrides
OnDataSourceChanged(IEnumerable, IEnumerable)
Called when ItemsSource property changed.
Declaration
protected override void OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable | oldValue | |
System.Collections.IEnumerable | newValue |