Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InnerRadius has no effect on the position of DataLabels #1096

Closed
Belitharian opened this issue Jul 3, 2023 · 2 comments
Closed

InnerRadius has no effect on the position of DataLabels #1096

Belitharian opened this issue Jul 3, 2023 · 2 comments
Labels
bug Something isn't working visual glitch

Comments

@Belitharian
Copy link

Describe the bug
The InnerRadius attribute no longer has any effect on the position of DataLabels when DataLabelsPosition is set.

To Reproduce
Steps to reproduce the behavior:

  • Create a new WPF application ;
  • Create a new ViewModel :
public class ViewModel
{
    public ISeries[] Series { get; set; }
        = new ISeries[]
        {
            new PieSeries<double>
            {
                Values = new double[] { 2 },
                Stroke = new SolidColorPaint(SKColors.White, 2),
                Fill = new SolidColorPaint(SKColors.Aqua),
                DataLabelsPaint = new SolidColorPaint(SKColors.Black),
                InnerRadius = 160,
                DataLabelsSize = 24,
                DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
            },
            new PieSeries<double>
            {
                Values = new double[] { 6 },
                Fill = new SolidColorPaint(SKColors.GreenYellow),
                Stroke = new SolidColorPaint(SKColors.White, 2),
                DataLabelsPaint = new SolidColorPaint(SKColors.Black),
                InnerRadius = 160,
                DataLabelsSize = 24,
                DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
            },
            new PieSeries<double>
            {
                Values = new double[] { 8 },
                Stroke = new SolidColorPaint(SKColors.White, 2),
                Fill = new SolidColorPaint(SKColors.Magenta),
                DataLabelsPaint = new SolidColorPaint(SKColors.Black),
                InnerRadius = 160,
                DataLabelsSize = 24,
                DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
            }
        };
}
  • Create the UI :
<Window
    x:Class="WpfApp1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WpfApp1"
    xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
    Width="960"
    Height="540"
    Background="#FF0A0A10">

    <Window.DataContext>
        <local:ViewModel />
    </Window.DataContext>

    <Grid Margin="45">
        <lvc:PieChart x:Name="PieChart" Series="{Binding Series}" />
    </Grid>

</Window>
  • Observe the DataLabels position.

Expected behavior
The DataLabels should be in the position : middle, start, outer, end ; according to what the developer decided.
Only the Measure.PolarLabelsPosition.ChartCenter position works.

Screenshots
With InnerRadius set :
image

Without InnerRadius set :
image

Desktop (please complete the following information):

  • OS: Windows 10 Professionnel 20H2 - Build 19042.985 - Windows Feature Experience Pack 120.2212.2020.0

Additional context
LiveChartsCore & LiveChartsCore.SkiaSharpView.WPF : v. 2.0.0-beta.802

That's my first bug report, hope this helps! 👍

@network-interface-controller

I'm not quite sure if I understand that issue correctly but in general I would not expect that the labels move automatically if I change the inner radius of a pie chart. The postions of DataLabels should be handled separately. However, this might be a side-effect of the fix for #771.

@beto-rodriguez
Copy link
Owner

This is already fixed in beta.900 thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working visual glitch
Projects
None yet
Development

No branches or pull requests

3 participants