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

RowSeries will not show rightly if the value of MinLimit is greater than 0 #1140

Closed
yangmijun opened this issue Jul 27, 2023 · 3 comments
Closed
Labels
bug Something isn't working priority 0 needs to be fixed asap.

Comments

@yangmijun
Copy link

WPF, .net 5.0 with version 2.0.0-beta.860.
One CartesianChart with one RowSeries with a few values ( between 80 ~120), the chart is OK if the value of MinLimit is auto or 0, but if I set it to 20, or 50 e.g., the RowSeries will become a single line.

org

image

image

@beto-rodriguez beto-rodriguez added the bug Something isn't working label Jul 28, 2023
@beto-rodriguez
Copy link
Owner

this time is kow fixed in the latest release, thanks for the report.

@yangmijun
Copy link
Author

yangmijun commented Jul 31, 2023

@beto-rodriguez Thank you very much. I just test the 2.0.0-beta.900, but I still got wrong result.
image

Maybe I did somthing wrong in the code.
This is the whole "MainWindow.xaml.cs" file:

using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Painting;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using SkiaSharp;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView.VisualElements;
using LiveChartsCore.Measure;
using RowSeriesTest.Annotations;

namespace RowSeriesTest
{
///


/// Interaction logic for MainWindow.xaml
///

public partial class MainWindow : Window, INotifyPropertyChanged
{
private List _seriesValues = new();

    public Axis[] YAxes { get; set; } =
    {
        new()
        {
            Labels = new[] { "Value1", "Value2", "Value3", "Value4", "Value5", "Value6", "Value7" },
            ForceStepToMin = true,
            MinStep = 1,
            LabelsPaint =
                new SolidColorPaint
                {
                    Color = SKColors.Black,
                },
        }
    };

    public Axis[] XAxes { get; set; } =
    {
        new()
        {
            //MinLimit = 0,  
            MinLimit = 20,  //will got wrong result
            //MaxLimit = 130,
            LabelsPaint =
                new SolidColorPaint
                {
                    Color = SKColors.Black,
                },
        },
    };

    private ISeries[] _rowSeries;

    public ISeries[] RowSeries
    {
        get => _rowSeries;
        set
        {
            _rowSeries = value;
            OnPropertyChanged();
        }
    }

    public LabelVisual ChartTitle { get; set; }
        = new()
        {
            Text = "Chart With RowSeries",
            TextSize = 20,
            Paint = new SolidColorPaint
            {
                Color = SKColors.Black,
            },
        };


    public MainWindow()
    {
        InitializeComponent();
        DataContext = this;

        RowSeries = Create_RowSeries();

        _seriesValues.AddRange(new[]
        {
            119.5,
            97.2,
            94,
            99.5,
            108,
            117,
            106
        });
    }

    private ISeries[] Create_RowSeries()
    {
        var ser1 = new RowSeries<double>
        {
            Values = _seriesValues,
            Fill = new SolidColorPaint(new SKColor(227, 127, 121)),
            DataLabelsPaint = new SolidColorPaint(SKColors.White),
            DataLabelsSize = 14,
            DataLabelsPosition = DataLabelsPosition.Middle,
            DataLabelsFormatter = point => point.Coordinate.PrimaryValue.ToString("F2"),
        };

        return new ISeries[] { ser1 };
    }

    public event PropertyChangedEventHandler? PropertyChanged;

    [NotifyPropertyChangedInvocator]
    protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

}

@beto-rodriguez
Copy link
Owner

Let me give this a second check, I'll re-open to check this out.

@beto-rodriguez beto-rodriguez reopened this Aug 1, 2023
@beto-rodriguez beto-rodriguez added the priority 0 needs to be fixed asap. label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority 0 needs to be fixed asap.
Projects
None yet
Development

No branches or pull requests

2 participants