Skip to content

Commit

Permalink
Merge pull request #1230 from beto-rodriguez/gestures-standard
Browse files Browse the repository at this point in the history
Gestures standard
  • Loading branch information
beto-rodriguez committed Sep 10, 2023
2 parents 38cdac4 + 50b9584 commit 071cd43
Show file tree
Hide file tree
Showing 136 changed files with 650 additions and 426 deletions.
122 changes: 122 additions & 0 deletions LiveCharts.sln
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.Behaviours",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveChartsCore.SkiaSharpView.Uno.WinUI", "src\skiasharp\LiveChartsCore.SkiaSharpView.Uno.WinUI\LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj", "{407D2FDF-11A1-44B7-91AE-D48D37C0A65E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSample.Desktop", "samples\AvaloniaSample\Platforms\AvaloniaSample.Desktop\AvaloniaSample.Desktop.csproj", "{9FE9808D-0ADD-4D30-968D-573E229781CA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{275DDC84-8855-4AE4-8C91-423030EA6368}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSample.Android", "samples\AvaloniaSample\Platforms\AvaloniaSample.Android\AvaloniaSample.Android.csproj", "{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Expand Down Expand Up @@ -2348,6 +2354,119 @@ Global
{407D2FDF-11A1-44B7-91AE-D48D37C0A65E}.Release|x64.Build.0 = Release|Any CPU
{407D2FDF-11A1-44B7-91AE-D48D37C0A65E}.Release|x86.ActiveCfg = Release|Any CPU
{407D2FDF-11A1-44B7-91AE-D48D37C0A65E}.Release|x86.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|ARM.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|ARM64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|iPhone.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|x64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|x64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|x86.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.AppStore|x86.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|ARM.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|ARM.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|ARM64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|iPhone.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|x64.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Debug|x86.Build.0 = Debug|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|Any CPU.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|ARM.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|ARM.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|ARM64.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|ARM64.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|iPhone.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|iPhone.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|x64.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|x64.Build.0 = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|x86.ActiveCfg = Release|Any CPU
{9FE9808D-0ADD-4D30-968D-573E229781CA}.Release|x86.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|ARM.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|ARM64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|iPhone.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|x64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|x64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|x86.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.AppStore|x86.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|ARM.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|ARM.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|ARM64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|iPhone.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|x64.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|x64.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|x86.ActiveCfg = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Debug|x86.Build.0 = Debug|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|Any CPU.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|ARM.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|ARM.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|ARM64.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|ARM64.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|iPhone.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|iPhone.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|x64.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|x64.Build.0 = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|x86.ActiveCfg = Release|Any CPU
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -2389,6 +2508,9 @@ Global
{28F4B811-A3DB-44A9-BB38-F072EE3E20F5} = {E8C464D7-B1F8-4331-9DCD-3A6E87503A0E}
{CEFD8CA2-64E7-4DF3-AC4D-601A88FC0F1E} = {2F6A1323-9B22-4AFC-9199-A705B72B7885}
{03BDCD7C-5428-450B-A757-531AFD36C37E} = {C9A1646F-FABA-48C3-A48B-B4A359D66105}
{9FE9808D-0ADD-4D30-968D-573E229781CA} = {275DDC84-8855-4AE4-8C91-423030EA6368}
{275DDC84-8855-4AE4-8C91-423030EA6368} = {2F6A1323-9B22-4AFC-9199-A705B72B7885}
{6D29698D-7225-4BCE-A3FF-EBB1CB08AADA} = {275DDC84-8855-4AE4-8C91-423030EA6368}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2040E57B-591B-4849-BD29-B4583C81F167}
Expand Down
Binary file added docs/_assets/tooltip-custom-template.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion docs/cartesianChart/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ Tooltips are popups that help the user to read a chart as the pointer moves.

![tooltips]({{ assets_url }}/docs/_assets/tooltips.gif)

{{~if !xamarin ~}}

## Behaviour

On **Windows** or **MacOS** you can move the pointer over the chart to display the tooltip, tooltips will be closed when the
pointer leaves the chart area.

On **Android** or **iOS** slide your finger over the chart to display the tooltip, the tooltip will be closed when the finger
goes up.

{{~ end ~}}

## TooltipPosition property

You can place a tooltip at `Top`, `Bottom`, `Left`, `Right`, `Center` or `Hidden` positions, for now
Expand Down Expand Up @@ -249,4 +261,4 @@ a custom control to render tooltips in out charts using the LiveCharts API.

{{~ render_params_file_as_code this "~/../samples/$PlatformSamplesFolder/General/TemplatedTooltips/$PlatformViewFile" ~}}

![custom tooltip]({{ assets_url }}/docs/_assets/tooltip-custom-template.png)
![custom tooltip]({{ assets_url }}/docs/_assets/tooltip-custom-template.gif)
7 changes: 7 additions & 0 deletions docs/samples/general/customTooltips/template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Customize default tooltips

The next article is a quick guide on how to customize the default tooltip,if you want to learn more you can read the full
article:

<a href="{{ website_url }}/docs/{{ platform }}/{{ version }}/CartesianChart.Tooltips" class="btn btn-light btn-lg text-primary shadow-sm mb-3">
<b>Go to the full tooltips article</b>
</a>

You can quickly change the position, the font, the text size or the background color:

## View
Expand Down
Binary file added docs/samples/lines/zoom/selection-zoom.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 62 additions & 27 deletions docs/samples/lines/zoom/template.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
{{ render this "~/shared/genericSampleJustGifHeader.md" }}

Zooming and panning is disabled by default, you can enable it by setting the `ZoomMode` property, this property is of type
[ZoomAndPanMode](https://lvcharts.com/api/{{ version }}/LiveChartsCore.Measure.ZoomAndPanMode) and the options are:
[ZoomAndPanMode](https://lvcharts.com/api/{{ version }}/LiveChartsCore.Measure.ZoomAndPanMode), this type is a flag enum
it means that you can combine the options as you need, you can learn more about zoomming and panning
[here](https://lvcharts.com/docs/{{ platform }}/{{ version }}/CartesianChart.Axes%20properties#zooming-and-panning).

- `X`: Enables zooming and panning on the X axis.
- `Y`: Enables zooming and panning on the Y axis.
- `Both`: Enables zooming and panning on both axes.
- `None`: Disables zooming and panning.
- `PanX`: Enables panning on the X axis.
- `PanY`: Enables panning on the Y axis.
- `ZoomX`: Enables zooming on the X axis.
- `ZoomY`: Enables zooming on the Y axis.

The [ZoomAndPanMode](https://lvcharts.com/api/{{ version }}/LiveChartsCore.Measure.ZoomAndPanMode) type is a flag enum,
so you can combine the options, for example, if you want to enable zooming on the X axis and panning on the Y axis you can
set the `ZoomMode` property to `ZoomAndPanMode.ZoomX | ZoomAndPanMode.PanY`.
{{~ if wpf || winforms || winui || eto ~}}

There is also the `InvertPanningPointerTrigger` flag, when this flag is present the panning will be triggered using
the right click on desktop devices and the touch-and-hold gesture on touch devices, the `zoom by section` feature will be
triggered to the left click on desktop devices and the touch-and-hold gesture on touch devices.
:::tip
Use the mouse wheel to zoom in/out, hold click and drag to move the view (panning).
:::

{{~ end ~}}

You can learn more about zooming an panning [here](https://lvcharts.com/docs/{{ platform }}/{{ version }}/CartesianChart.Axes%20properties#zooming-and-panning).

{{~ if desktop ~}}
{{~ maui || uno || avalonia ~}}

:::tip
On **Windows**, use the mouse wheel to zoom in/out, hold click and drag to move the view (panning). On **MacOS**
pinch the trackpad in/out or slide vertically a finger(s) on a magic mouse to zoom in/out, hold click and drag to move the view (panning).
On **Windows**, use the mouse wheel to zoom in/out, hold click and drag to move the view (panning).
:::

{{~ end ~}}

{{~ if mobile ~}}
:::tip
On **MacOS** slide vertically a finger(s) on a magic mouse to zoom in/out, hold click and drag to move the view (panning).
:::

:::tip
On touch devices, pinch the screen in/out to zoom, hold tap and drag to move the view (panning).
On **Android** or **iOS**, pinch the screen in/out to zoom, hold tap and drag to move the view (panning).
:::

{{~ end ~}}

## View model

```
{{ full_name | get_vm_from_docs }}
```
{{~ uno || avalonia || blazor ~}}

:::tip
On the **Browser**, use the mouse wheel to zoom in/out, hold click and drag to move the view (panning) (no touch devices yet).
:::

{{~ end ~}}

{{~ if xaml ~}}
## XAML
Expand All @@ -61,4 +56,44 @@ On touch devices, pinch the screen in/out to zoom, hold tap and drag to move the
{{ full_name | get_view_from_docs }}
```

# Zoom by selection

You can also zoom by selection, this is a feature that allows you to select an area in the chart and zoom in to that area,
when zooming is enabled, this feature is also enabled by default, you can also customize the trigger of this function, you can
find more info [here](https://lvcharts.com/docs/{{ platform }}/{{ version }}/CartesianChart.Axes%20properties#zooming-and-panning).

<div class="text-center">
<img src="{{ assets_url }}/docs/{{ unique_name }}/selection-zoom.gif" alt="sample image" />
</div>

{{~ if wpf || winforms || winui || eto ~}}

:::tip
Right click on the chart, hold and drag to select an area on the chart.
:::

{{~ end ~}}


{{~ maui || uno || avalonia ~}}

:::tip
On **Windows**, right click on the chart, hold and drag to select an area on the chart.
:::

:::tip
On **MacOS**, **Android** or **iOS** double click/tap the chart, hold the last click/tap and drag to select an area.
:::

{{~ end ~}}


{{~ uno || avalonia || blazor ~}}

:::tip
On the **Browser**, right click on the chart, hold and drag to select an area on the chart (no touch devices yet).
:::

{{~ end ~}}

{{ render this "~/shared/relatedTo.md" }}
6 changes: 5 additions & 1 deletion samples/AvaloniaSample/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace AvaloniaSample;

public class App : Application
public partial class App : Application
{
public override void Initialize()
{
Expand Down Expand Up @@ -47,6 +47,10 @@ public override void OnFrameworkInitializationCompleted()
{
desktop.MainWindow = new MainWindow();
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
singleViewPlatform.MainView = new MainView();
}

base.OnFrameworkInitializationCompleted();
}
Expand Down
Binary file added samples/AvaloniaSample/Assets/avalonia-logo.ico
Binary file not shown.
28 changes: 16 additions & 12 deletions samples/AvaloniaSample/AvaloniaSample.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<LangVersion>11.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<AvaloniaNameGeneratorIsEnabled>false</AvaloniaNameGeneratorIsEnabled>
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\livecharts.png" />
<AvaloniaXaml Remove="Platforms\**" />
<Compile Remove="Platforms\**" />
<EmbeddedResource Remove="Platforms\**" />
<None Remove="Platforms\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.0" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.0" />
<PackageReference Include="Avalonia" Version="11.0.0" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\skiasharp\LiveChartsCore.SkiaSharp.Avalonia\LiveChartsCore.SkiaSharpView.Avalonia.csproj" />
<ProjectReference Include="..\ViewModelsSamples\ViewModelsSamples.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\livecharts.png" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AvaloniaSample.Axes.ColorsAndPosition;

public class View : UserControl
public partial class View : UserControl
{
public View()
{
Expand Down
2 changes: 1 addition & 1 deletion samples/AvaloniaSample/Axes/Crosshairs/View.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AvaloniaSample.Axes.Crosshairs;

public class View : UserControl
public partial class View : UserControl
{
public View()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AvaloniaSample.Axes.CustomSeparatorsInterval;

public class View : UserControl
public partial class View : UserControl
{
public View()
{
Expand Down
2 changes: 1 addition & 1 deletion samples/AvaloniaSample/Axes/DateTimeScaled/View.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AvaloniaSample.Axes.DateTimeScaled;

public class View : UserControl
public partial class View : UserControl
{
public View()
{
Expand Down

0 comments on commit 071cd43

Please sign in to comment.