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

The legend does not reflect my Stroke color #1507

Closed
Xixi0506 opened this issue May 7, 2024 Discussed in #1427 · 1 comment
Closed

The legend does not reflect my Stroke color #1507

Xixi0506 opened this issue May 7, 2024 Discussed in #1427 · 1 comment
Labels
question Further information is requested

Comments

@Xixi0506
Copy link

Xixi0506 commented May 7, 2024

Discussed in #1427

Originally posted by Daimonion1980 January 19, 2024
Hello Community.

Maybe someone can give me a hint, why my stroke color is not reflected in the legend.
Please take a look at the screenshot:

image

And here are the codesnippets, I use to display the series:

ViewModel:

partial void OnInitialize()
{
    //temporäre initalisierung einer Achse, des Plots
    PlotData = new ObservableCollection<ISeries>
    {
        new LineSeries<ObservableValue>
        {
            Values = plotValue1,
            Fill = null,
            GeometrySize = 0,
            Stroke = new SolidColorPaint(SKColors.Red),
            LineSmoothness = 0.3,
            Name="Drehzahl rpm"
        }
    };
}

UserControl:

<Grid>
    <lvc:CartesianChart Grid.Row="0" Height="Auto" Series="{Binding PlotData}" 
                        ZoomMode="ZoomX" LegendPosition="Bottom" />
</Grid>

I found issue 365 but this should already be fixed in 2.0.0-rc2 ?!

Does anybody see the problem?

@beto-rodriguez beto-rodriguez added the question Further information is requested label Sep 13, 2024
@beto-rodriguez
Copy link
Owner

Hello sorry about the confusion, what is shown in the legend is the geometry, not the line, setting the GeometryStroke will make the trick:

new LineSeries<double>
{
    Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
    Fill = null,
    GeometryStroke = new SolidColorPaint(SKColors.Red),
}

image

In your case it is confusing because your geometry is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants