Dear Syncfusion,
I am affected by new problems using SFLinearGauge and SFChart both related to binding data.
SFLinearGauge
I managed to bind value showed on SFCircularGauge to my ViweModel (still some problems with rendering - mentioned in different topic). Unfortunately the same approach does not work with Linear version of Gauge.
My View (ContentPage) is auto-wired to my ViewModel using Prism. All bindings used in e.g. Labels works without any problems. When I bind in my LinearGauge the value is always 0.
When I set Value manually in XAML it displays correctly. Also coping binding from Gauges Value to Labels Text shows correct value. The variable is of double type. I tried both BarPointer and SymbolPointer.
My XAML:
<gauge:SfLinearGauge HeightRequest="60" Orientation="OrientationHorizontal" BackgroundColor="White">
<gauge:SfLinearGauge.Scales>
<gauge:LinearScale MinimumValue="0" MaximumValue="550" Interval="50" LabelColor="Gray" LabelOffset="0.2" ScaleBarSize="10" ScalePosition="Forward" ScaleBarColor="Transparent" FrameOffset="0.1">
<gauge:LinearScale.Ranges>
</gauge:LinearScale.Ranges>
<gauge:LinearScale.Pointers>
<gauge:SymbolPointer Value="{Binding MyValue}" Color="#0091DC" />
<!--<gauge:BarPointer Thickness="15" Value="{Binding MyValue}" Color="#0091DC" />-->
</gauge:LinearScale.Pointers>
</gauge:SfLinearGauge.Scales>
And in ViewModel it is declared like Prism recommends:
set { SetProperty(ref _myValue, value); }
Is there any difference between Linear and Circular Gauge?
SFChart
I created simple PieChart and populated it with my Custom data (of course all using MVVM approach) (all based on great samples: https://help.syncfusion.com/xamarin/sfchart/overview)
In my constructor of ViewModel I populate data:
PieData = new ObservableCollection<PieChartLabel>();
PieData.Add(new PieChartLabel("Valid", 10));
PieData.Add(new PieChartLabel("Invalid", 20));
PieData.Add(new PieChartLabel("Standstill", 30));
And it shows this data as supposed to. The problem is that the App is going to be a live data app and data showed on Pie chart will change.
Unfortunately changing directly one element:
PieData[index].Value = newData.Value;
Or changing whole collestion:
pieData[index].Value = newData.Value;
is not working. I can only see first data set in contructor of my VM
I will appreciate all the help.
Best regards,
Grzegorz