This question is almost a duplicate of Setting the colour of a LiveCharts Series that has custom labels using XAML Binding
I just want to do the exact thing described there, but on the LiveCharts2 version. The problem I'm facing is that I get
Unable to resolve type LineSeries from namespace using:LiveChartsCore.SkiaSharpView.Avalonia
when i do
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:LineSeries Values="{Binding ABValues}" DataLabels="True" FontSize="14" StrokeDashArray="1,1" Fill="{Binding ABColor}" LabelPoint="{Binding ABLabelPoint}"/>
I tried changing the namespace:
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
xmlns:lvc2="using:LiveChartsCore.SkiaSharpView"
xmlns:lvc3="using:LiveChartsCore.Defaults"
and calling LineSeries by using
<lvc2:LineSeries x:TypeArguments="lvc3:ObservableValue" Values="{Binding MyValues}">
beacause the structure of the package seems different. I get
Unable to find suitable setter or adder for property Values of type LiveChartsCore:LiveChartsCore.Series`4 for argument Avalonia.Markup.Xaml:Avalonia.Markup.Xaml.MarkupExtensions.CompiledBindingExtension, available setter parameter lists are:
System.Collections.Generic.IEnumerable`1<LiveChartsCore.Defaults.ObservableValue>
LiveChartsCore.Defaults.ObservableValue
Im sure that im binding to the right type (MyValues is an IEnumerable made from ObservableValues), but i cannot make this work.
How im i supposed to select a color for the plot on the view? now, i do it on the ViewModel, but i cannot apply styles.