Skip to content

Commit

Permalink
Merge pull request #577 from beto-rodriguez/dev
Browse files Browse the repository at this point in the history
Beta.350
  • Loading branch information
beto-rodriguez authored Aug 10, 2022
2 parents 224146e + 2b6789f commit efbed07
Show file tree
Hide file tree
Showing 53 changed files with 475 additions and 835 deletions.
2 changes: 1 addition & 1 deletion docs/cartesianChart/legends.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ You can find another example at the source code of the `DefaultLegend` class

{{~ end ~}}

{{~ if uno || uno-winui ~}}
{{~ if uno || unowinui ~}}
{{~ "~/../samples/UnoSample/UnoSample.Shared/LiveChartsSamples/General/TemplatedLegends/View.xaml" | render_file_as_code ~}}

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/cartesianChart/tooltips.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ You can find a another example at the source code of the `DefaultTooltip` class

{{~ end ~}}

{{~ if uno || uno-winui ~}}
{{~ if uno || unowinui ~}}
{{~ "~/../samples/UnoSample/UnoSample.Shared/LiveChartsSamples/General/TemplatedTooltips/View.xaml" | render_file_as_code ~}}

:::tip
Expand Down
2 changes: 1 addition & 1 deletion docs/overview/1.2.install.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ And that's it, when you app starts our chart will be displayed instead of the `I

{{~ end ~}}

{{~ if uno-winui ~}}
{{~ if unowinui ~}}

Before getting started with Uno, ensure you have installed all the prerequisites, for Visual Studio you can get started
[here](https://platform.uno/docs/articles/get-started-vs.html), you can find help on how to install the mentioned workloads
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/general/customLegends/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You can find another example at the source code of the `DefaultLegend` class

{{~ end ~}}

{{~ if uno || uno-winui ~}}
{{~ if uno || unowinui ~}}
{{~ "~/../samples/UnoSample/UnoSample.Shared/LiveChartsSamples/General/TemplatedLegends/View.xaml" | render_file_as_code ~}}

:::tip
Expand Down
Binary file modified docs/samples/pies/gauge2/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

[string]$configuration = "Release"
[string]$nupkgOutputPath = "./nupkg"
[Project[]]$projects = @(
Expand Down Expand Up @@ -143,8 +142,10 @@ function Write-ColorOutput($foregroundColor)
$host.UI.RawUI.ForegroundColor = $fc
}

if (Test-Path ./nupkg) {
Get-ChildItem ./nupkg -Include *.* -File -Recurse | ForEach-Object { $_.Delete() }
if (Test-Path $nupkgOutputPath) {
Get-ChildItem $nupkgOutputPath -Include *.* -File -Recurse | ForEach-Object { $_.Delete() }
} else {
New-Item $nupkgOutputPath -ItemType "directory"
}

foreach ($p in $projects) {
Expand Down
4 changes: 2 additions & 2 deletions src/LiveChartsCore/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Eto, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Blazor, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Maui, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsBackersPackage, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d53791eaa0d98b405ca858f39169be6af36ceb7a1bca3ca76c6905fd22fddf8c5e4ef2778a5d7a77ad12f08da711fecfc44795c7923739a2acac946b3f1719a6dfc238695bc69cf5d959b3fb6bc4d18d57a97ff8ed897e6b22a6b8155401ee368d77431e74178104b4adca73520b058b9be28d4ec129beb54871778167afa5ce")]
#else
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Avalonia")]
Expand All @@ -49,5 +49,5 @@
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Eto")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Blazor")]
[assembly: InternalsVisibleTo("LiveChartsCore.SkiaSharpView.Maui")]
[assembly: InternalsVisibleTo("LiveChartsBackersPackage")]
[assembly: InternalsVisibleTo("LiveChartsCore.BackersPackage")]
#endif
20 changes: 3 additions & 17 deletions src/LiveChartsCore/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public abstract class Axis<TDrawingContext, TTextGeometry, TLineGeometry>

private double _minStep = 0;
private double _labelsRotation;
private Align _labelsAlignment = Align.Auto;
private LvcRectangle _labelsDesiredSize = new(), _nameDesiredSize = new();
private TTextGeometry? _nameGeometry;
private AxisPosition _position = AxisPosition.Start;
Expand Down Expand Up @@ -138,9 +137,6 @@ public abstract class Axis<TDrawingContext, TTextGeometry, TLineGeometry>
/// <inheritdoc cref="IPlane.LabelsRotation"/>
public double LabelsRotation { get => _labelsRotation; set { _labelsRotation = value; OnPropertyChanged(); } }

/// <inheritdoc cref="ICartesianAxis.LabelsAlignment"/>
public Align LabelsAlignment { get => _labelsAlignment; set { _labelsAlignment = value; OnPropertyChanged(); } }

/// <inheritdoc cref="IPlane.TextSize"/>
public double TextSize { get => _textSize; set { _textSize = value; OnPropertyChanged(); } }

Expand Down Expand Up @@ -351,11 +347,6 @@ public override void Measure(Chart<TDrawingContext> chart)

var measured = new HashSet<AxisVisualSeprator<TDrawingContext>>();

var actualAlignment = _labelsAlignment;
if (actualAlignment == Align.Auto) actualAlignment = _position == AxisPosition.Start ? Align.End : Align.Start;
var ao = actualAlignment == Align.Start ? -1 : (actualAlignment == Align.End ? 1 : 0);
if (_orientation == AxisOrientation.X) ao *= -1;

for (var i = start; i <= max; i += s)
{
if (i < min) continue;
Expand Down Expand Up @@ -484,17 +475,12 @@ public override void Measure(Chart<TDrawingContext> chart)
if (LabelsPaint is not null && visualSeparator.Label is not null)
LabelsPaint.AddGeometryToPaintTask(cartesianChart.Canvas, visualSeparator.Label);

if (LabelsPaint is not null && visualSeparator.Label is not null)
if (visualSeparator.Label is not null)
{
visualSeparator.Label.Text = label;
visualSeparator.Label.Padding = _padding;

var rls = visualSeparator.Label.Measure(LabelsPaint);
var aox = _orientation == AxisOrientation.Y ? _xo - rls.Width * 0.5f : 0;
var aoy = _orientation == AxisOrientation.X ? _yo - rls.Height * 0.5f : 0;

visualSeparator.Label.X = x + ao * aox;
visualSeparator.Label.Y = y + ao * aoy;
visualSeparator.Label.X = x;
visualSeparator.Label.Y = y;
if (hasRotation) visualSeparator.Label.RotateTransform = r;

visualSeparator.Label.Opacity = 1;
Expand Down
Loading

0 comments on commit efbed07

Please sign in to comment.