diff --git a/MAUI/Cartesian-Charts/Annotation.md b/MAUI/Cartesian-Charts/Annotation.md index a975389d43..bc75652523 100644 --- a/MAUI/Cartesian-Charts/Annotation.md +++ b/MAUI/Cartesian-Charts/Annotation.md @@ -615,4 +615,48 @@ this.Content = chart; {% endhighlight %} +{% endtabs %} + +## Event + +**AnnotationTapped** + +The [`AnnotationTapped`]() event occurs when an annotation is tapped. The [`AnnotationTappedEventArgs`]() provides the following details: + +* [`annotation`]() – the annotation instance that was tapped. +* [`x`]() – the X coordinate of the touch or mouse click position. +* [`y`]() – the Y coordinate of the touch or mouse click position. + +## Public methods + +The following override methods allow you to handle touch interactions on annotations: + +* [`OnTouchDown`]() – triggered when touch starts (down) on the annotation. +* [`OnTouchMove`]() – triggered when moving (dragging) the finger or mouse across the annotation. +* [`OnTouchUp`]() – triggered when touch ends (up) by lifting the finger or releasing the mouse from the annotation. + +{% tabs %} + +{% highlight c# %} + +public class LineAnnotationExt : LineAnnotation +{ + protected override void OnTouchDown(float pointX, float pointY) + { + base.OnTouchDown(pointX, pointY); + } + + protected override void OnTouchMove(float pointX, float pointY) + { + base.OnTouchMove(pointX, pointY); + } + + protected override void OnTouchUp(float pointX, float pointY) + { + base.OnTouchUp(pointX, pointY); + } +} + +{% endhighlight %} + {% endtabs %} \ No newline at end of file diff --git a/MAUI/Cartesian-Charts/Legend-images/floating_legend.png b/MAUI/Cartesian-Charts/Legend-images/floating_legend.png new file mode 100644 index 0000000000..9930963659 Binary files /dev/null and b/MAUI/Cartesian-Charts/Legend-images/floating_legend.png differ diff --git a/MAUI/Cartesian-Charts/Legend.md b/MAUI/Cartesian-Charts/Legend.md index a9a162be1d..8732637179 100644 --- a/MAUI/Cartesian-Charts/Legend.md +++ b/MAUI/Cartesian-Charts/Legend.md @@ -1,6 +1,6 @@ --- layout: post -title: Legend in .NET MAUI Chart control | Syncfusion +title: Legend in .NET MAUI Cartesian Chart control | Syncfusion description: This section explains about how to initialize legend and its customization in Syncfusion® .NET MAUI Chart (SfCartesianChart) control. platform: maui control: SfCartesianChart @@ -233,6 +233,45 @@ this.Content = chart; {% endtabs %} +## Floating legend + +The floating legend feature allows you to position the legend inside the chart area based on its defined placement. When [IsFloating]() is set to true, the legend will start from the specified [Placement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_Placement) (such as Top, Bottom, Left, or Right) and then move according to the offset values, enabling precise control over the legend’s location. + +* [OffsetX](): Specifies the horizontal distance from the defined placement position. +* [OffsetY](): Specifies the vertical distance from the defined placement position. + +{% tabs %} + +{% highlight xaml %} + + + + + + + +{% endhighlight %} + +{% highlight c# %} + +SfCartesianChart chart = new SfCartesianChart(); +. . . +chart.Legend = new ChartLegend() +{ + Placement = LegendPlacement.Top + IsFloating = true + OffsetX = -170; + OffsetY = 30; +}; + +this.Content = chart; + +{% endhighlight %} + +{% endtabs %} + +![Floating Legend support in MAUI Cartesian Chart](Legend-images/floating_legend.png) + ## Toggle the series visibility The visibility of series can be controlled by tapping the legend item using the [ToggleSeriesVisibility](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_ToggleSeriesVisibility) property. The default value of ToggleSeriesVisibility is `false`. diff --git a/MAUI/Circular-Charts/Legend-images/floating_legend.png b/MAUI/Circular-Charts/Legend-images/floating_legend.png new file mode 100644 index 0000000000..c0366b19f5 Binary files /dev/null and b/MAUI/Circular-Charts/Legend-images/floating_legend.png differ diff --git a/MAUI/Circular-Charts/Legend.md b/MAUI/Circular-Charts/Legend.md index 9c2762eba9..96be2aa1c0 100644 --- a/MAUI/Circular-Charts/Legend.md +++ b/MAUI/Circular-Charts/Legend.md @@ -8,7 +8,7 @@ documentation: ug keywords: .net maui circular chart, chart legend, legend-wrap, legend view, legend layout, chart legend items, legend alignment. --- -# Legend in .NET MAUI Chart (SfCircularChart) +# Legend in .NET MAUI Circular Chart (SfCircularChart) The [Legend](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartBase.html#Syncfusion_Maui_Charts_ChartBase_Legend) provides a list of data points, helping to identify the corresponding data points in the chart. Here's a detailed guide on how to define and customize the legend in the circular chart. ## Defining the legend @@ -227,6 +227,45 @@ this.Content = chart; {% endtabs %} +## Floating legend + +The floating legend feature allows you to position the legend inside the chart area based on its defined placement. When [IsFloating]() is set to true, the legend will start from the specified [Placement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_Placement) (such as Top, Bottom, Left, or Right) and then move according to the offset values, enabling precise control over the legend’s location. + +* [OffsetX](): Specifies the horizontal distance from the defined placement position. +* [OffsetY](): Specifies the vertical distance from the defined placement position. + +{% tabs %} + +{% highlight xaml %} + + + + + + + +{% endhighlight %} + +{% highlight c# %} + +SfCircularChart chart = new SfCircularChart(); + +chart.Legend = new ChartLegend() +{ + Placement = LegendPlacement.Top + IsFloating = true + OffsetX = -170; + OffsetY = 30; +}; +. . . +this.Content = chart; + +{% endhighlight %} + +{% endtabs %} + +![Floating Legend support in MAUI Circular Chart](Legend-images/floating_legend.png) + ## Toggle the series visibility The visibility of circular series data points can be controlled by tapping the legend item using the [ToggleSeriesVisibility](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_ToggleSeriesVisibility) property. The default value of ToggleSeriesVisibility is `false`. diff --git a/MAUI/Funnel-Charts/Legend-images/floating_legend.png b/MAUI/Funnel-Charts/Legend-images/floating_legend.png new file mode 100644 index 0000000000..12a7393b82 Binary files /dev/null and b/MAUI/Funnel-Charts/Legend-images/floating_legend.png differ diff --git a/MAUI/Funnel-Charts/Legend.md b/MAUI/Funnel-Charts/Legend.md index ec9213571a..fee7a94891 100644 --- a/MAUI/Funnel-Charts/Legend.md +++ b/MAUI/Funnel-Charts/Legend.md @@ -1,6 +1,6 @@ --- layout: post -title: Legend in .NET MAUI Chart control | Syncfusion +title: Legend in .NET MAUI Funnel Chart control | Syncfusion description: This section explains about how to initialize legend and its customization in Syncfusion® .NET MAUI Chart (SfFunnelChart) control. platform: maui control: SfFunnelChart @@ -209,6 +209,55 @@ this.Content = chart; {% endtabs %} +## Floating legend + +The floating legend feature allows you to position the legend inside the chart area based on its defined placement. When [IsFloating]() is set to true, the legend will start from the specified [Placement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_Placement) (such as Top, Bottom, Left, or Right) and then move according to the offset values, enabling precise control over the legend’s location. + +* [OffsetX](): Specifies the horizontal distance from the defined placement position. +* [OffsetY](): Specifies the vertical distance from the defined placement position. + +{% tabs %} + +{% highlight xaml %} + + + + + + + +{% endhighlight %} + +{% highlight c# %} + +SfFunnelChart chart = new SfFunnelChart() +{ + XBindingPath = "XValue", + YBindingPath = "YValue", + ItemsSource = new ViewModel().Data, +}; + +chart.Legend = new ChartLegend() +{ + Placement = LegendPlacement.Top + IsFloating = true + OffsetX = -170; + OffsetY = 30; +}; + +this.Content = chart; + +{% endhighlight %} + +{% endtabs %} + +![Floating Legend support in MAUI Funnel Chart](Legend-images/floating_legend.png) + ## Toggle the series visibility The visibility of segments in the funnel chart can be controlled by tapping the legend item using the [ToggleSeriesVisibility](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_ToggleSeriesVisibility) property. The default value of ToggleSeriesVisibility is `false`. diff --git a/MAUI/Polar-Charts/Legend.md b/MAUI/Polar-Charts/Legend.md index 33fadc873c..c87fb443d2 100644 --- a/MAUI/Polar-Charts/Legend.md +++ b/MAUI/Polar-Charts/Legend.md @@ -1,6 +1,6 @@ --- layout: post -title: Legend in .NET MAUI Chart control | Syncfusion +title: Legend in .NET MAUI Polar Chart control | Syncfusion description: This section explains about how to initialize legend and its customization in Syncfusion® .NET MAUI Chart (SfPolarChart) control. platform: maui control: SfPolarChart diff --git a/MAUI/Pyramid-Charts/Legend-images/floating_legend.png b/MAUI/Pyramid-Charts/Legend-images/floating_legend.png new file mode 100644 index 0000000000..9293cdbdf2 Binary files /dev/null and b/MAUI/Pyramid-Charts/Legend-images/floating_legend.png differ diff --git a/MAUI/Pyramid-Charts/Legend.md b/MAUI/Pyramid-Charts/Legend.md index 3c02dd43a5..3c1ab94661 100644 --- a/MAUI/Pyramid-Charts/Legend.md +++ b/MAUI/Pyramid-Charts/Legend.md @@ -1,6 +1,6 @@ --- layout: post -title: Legend in .NET MAUI Chart control | Syncfusion +title: Legend in .NET MAUI Pyramid Chart control | Syncfusion description: This section explains about how to initialize legend and its customization in Syncfusion® .NET MAUI Chart (SfPyramidChart) control. platform: maui control: SfPyramidChart @@ -213,6 +213,57 @@ this.Content = chart; {% endtabs %} +## Floating legend + +The floating legend feature allows you to position the legend inside the chart area based on its defined placement. When [IsFloating]() is set to true, the legend will start from the specified [Placement](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_Placement) (such as Top, Bottom, Left, or Right) and then move according to the offset values, enabling precise control over the legend’s location. + +* [OffsetX](): Specifies the horizontal distance from the defined placement position. +* [OffsetY](): Specifies the vertical distance from the defined placement position. + +{% tabs %} + +{% highlight xaml %} + + + + + + + + +{% endhighlight %} + +{% highlight c# %} + +SfPyramidChart chart = new SfPyramidChart() +{ + XBindingPath = "Name", + YBindingPath = "Value", + ItemsSource = new ViewModel().Data, + +}; + +chart.Legend = new ChartLegend() +{ + Placement = LegendPlacement.Top + IsFloating = true + OffsetX = -170; + OffsetY = 30; +}; + +this.Content = chart; + +{% endhighlight %} + +{% endtabs %} + +![Floating Legend support in MAUI Pyramid Chart](Legend-images/floating_legend.png) + ## Toggle the series visibility The visibility of segments in the pyramid chart can be controlled by tapping the legend item using the [ToggleSeriesVisibility](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#Syncfusion_Maui_Charts_ChartLegend_ToggleSeriesVisibility) property. The default value of ToggleSeriesVisibility is `false`.