Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions MAUI/Cartesian-Charts/Annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 40 additions & 1 deletion MAUI/Cartesian-Charts/Legend.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 %}

<chart:SfCartesianChart>
<chart:SfCartesianChart.Legend>
<chart:ChartLegend Placement="Top" IsFloating="True" OffsetX="-170" OffsetY="30"/>
</chart:SfCartesianChart.Legend>
</chart:SfCartesianChart>

{% 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`.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 40 additions & 1 deletion MAUI/Circular-Charts/Legend.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 %}

<chart:SfCircularChart>
<chart:SfCircularChart.Legend>
<chart:ChartLegend Placement="Right" IsFloating="True" OffsetX="-480" OffsetY="10"/>
</chart:SfCircularChart.Legend>
</chart:SfCircularChart>

{% 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`.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 50 additions & 1 deletion MAUI/Funnel-Charts/Legend.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 %}

<chart:SfFunnelChart ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:SfFunnelChart.Legend>
<chart:ChartLegend Placement="Right"
IsFloating="True"
OffsetX="-250"
OffsetY="-100"/>
</chart:SfFunnelChart.Legend>
</chart:SfFunnelChart>

{% 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`.

Expand Down
2 changes: 1 addition & 1 deletion MAUI/Polar-Charts/Legend.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 52 additions & 1 deletion MAUI/Pyramid-Charts/Legend.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 %}

<chart:SfPyramidChart ItemsSource="{Binding Data}"
XBindingPath="Name"
YBindingPath="Value">
<chart:SfPyramidChart.Legend>
<chart:ChartLegend Placement="Right"
IsFloating="True"
OffsetX="-300"
OffsetY="80">
</chart:ChartLegend>
</chart:SfPyramidChart.Legend>
</chart:SfPyramidChart>

{% 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`.

Expand Down