Rysowanie wykresu

0

Nie wiem czemu po naciśnięciu przycisku nic się nie dzieje choć powinna się wyświetlić kolejna linia... Co przeoczyłem?

kod xaml:

<lvc:CartesianChart x:Name="lvcWykres" Background="Transparent" Margin="0,0,10,0">
    <lvc:CartesianChart.DataTooltip>
        <lvc:DefaultTooltip Background="Black" Foreground="Yellow" BulletSize="0" CornerRadius="5"/>
    </lvc:CartesianChart.DataTooltip>
    <lvc:CartesianChart.AxisX>
        <lvc:Axis Foreground="Yellow" ShowLabels="True" Labels="1,2,3,4,5">
            <lvc:Axis.Separator>
                <lvc:Separator StrokeThickness="0" Step="1"/>
            </lvc:Axis.Separator>
        </lvc:Axis>
    </lvc:CartesianChart.AxisX>
    <lvc:CartesianChart.AxisY>
        <lvc:Axis MinValue="-100" MaxValue="100" Foreground="#E8D300" ShowLabels="True">
            <lvc:Axis.Separator>
                <lvc:Separator StrokeThickness="0" Step="10"/>
            </lvc:Axis.Separator>
        </lvc:Axis>
    </lvc:CartesianChart.AxisY>
    <lvc:CartesianChart.Series>
        <lvc:LineSeries Stroke="Yellow" Title="Teskt defult" StrokeThickness="2" Values="10,20,30,40,50">
            <lvc:LineSeries.Fill>
                <SolidColorBrush Color="Transparent"/>
            </lvc:LineSeries.Fill>
        </lvc:LineSeries>
    </lvc:CartesianChart.Series>
</lvc:CartesianChart>

kod c#:

private void btnWykresOblicz_Click(object sender, RoutedEventArgs e)
{
    LineSeries linia = new LineSeries
    {
        Title = "Tesst",
        Fill = Brushes.Transparent,
        Stroke = Brushes.Yellow,
        Values = new ChartValues<double> { 10.5, 54.4 },
    };
}
0

dobra nie ważne znalazłem błąd

1

dla porządku opisz co było rozwiązaniem, wtedy będzie zysk z tego wątku na forum.

0

Zgaduję, że to było powodem:

private void btnWykresOblicz_Click(object sender, RoutedEventArgs e)
{
    LineSeries linia = new LineSeries
    {
        Title = "Tesst",
        Fill = Brushes.Transparent,
        Stroke = Brushes.Yellow,
        Values = new ChartValues<double> { 10.5, 54.4 },
    };
}

Nie widzę, aby gdziekolwiek zmieniał jakieś właściwości

1 użytkowników online, w tym zalogowanych: 0, gości: 1