Skip to content

The Strokes in the LineSeries are inconsistent #2064

@ping9719

Description

@ping9719

LiveChartsCore.SkiaSharpView.Avalonia The Strokes in the LineSeries are inconsistent

AMAML

<lvc:CartesianChart Grid.Row="1" LegendPosition="Top" Series="{Binding Series}" XAxes="{Binding XAxes}" YAxes="{Binding YAxes}" Background="WhiteSmoke"/>

C#

        public ISeries[] Series { get; set; } = new ISeries[]
        {
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Blue),Name = "qty", Values = null  },
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Green),Name = "ok", Values = null  },
            new LineSeries<int> { Stroke=new SolidColorPaint(SKColors.Red),Name = "ng", Values = null  },
        };

        public Axis[] XAxes { get; set; } = new Axis[]
        {
            new Axis{ Name = "data",MinStep=1, Labels=new string[]{ }}
        };

        public Axis[] YAxes { get; set; } = new Axis[]
        {
            new Axis{ Name = "",MinLimit=0}
        };

C# Button

                XAxes[0].Labels = dbdata.Select(o => o.day.ToString()).ToArray();
                Series[0].Values = dbdata.Select(o => o.count).ToArray();
                Series[1].Values = dbdata.Select(o => o.okCount).ToArray();
                Series[2].Values = dbdata.Select(o => o.notCount).ToArray();

preview

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions