Unable to use Range or Pointer due to missing assembly or namespace

When following the Xamarin.Forms SfLinearGauge documentation, I'm trying to add Ranges or a SymbolPointer to my gauge but I keep getting a compilation error:

Type sf:LinearScale.Ranges not found in xmlns clr-namespace:Syncfusion.SfGauge.XForms;assembly=Syncfusion.SfGauge.XForms
or
Type sf:LinearScale.Pointers not found in xmlns clr-namespace:Syncfusion.SfGauge.XForms;assembly=Syncfusion.SfGauge.XForms

Here is my namespace declaration:

             xmlns:sf="clr-namespace:Syncfusion.SfGauge.XForms;assembly=Syncfusion.SfGauge.XForms"

What is wrong?  I'm using version 14.4.0.15.



2 Replies

MC Mark Curtis January 11, 2017 05:07 PM UTC

I figured it out.  Make sure you have both Scales and a Scale within the collection.  I was doing this which is wrong:

                      <sf:SfLinearGauge Grid.Column="4" Margin="10,1,0,1" HorizontalOptions="CenterAndExpand" VerticalOptions="Center" Orientation="OrientationHorizontal" FrameBackgroundColor="Black">
                        <sf:SfLinearGauge.Scales MinimumValue="0" MaximumValue="100" ScaleBarLength="70" ShowRim="true" ShowLabels="false" ScaleBarColor="White" ScaleBarSize="12">
                            <sf:LinearScale.Ranges>
                              <sf:LinearRange x:Name="lowUsed" StartValue="0" Color="Green" EndValue="33" StartWidth="8" EndWidth="8" />
                              <sf:LinearRange x:Name="medUsed" StartValue="34" Color="Yellow" EndValue="67" StartWidth="8" EndWidth="8" />
                              <sf:LinearRange x:Name="highUsed" StartValue="68" Color="Red" EndValue="100" StartWidth="8" EndWidth="8" />
                            </sf:LinearScale.Ranges>
                            <sf:LinearScale.Pointers>
                              <sf:SymbolPointer x:Name="symbolPointer" Value="{Binding memoryUsed}" Offset="0.0" Thickness="3" Color="Black"/>
                            </sf:LinearScale.Pointers>
                        </sf:SfLinearGauge.Scales>
                      </sf:SfLinearGauge>


This is what I should have done:

                      <sf:SfLinearGauge Grid.Column="4" Margin="10,1,0,1" HorizontalOptions="CenterAndExpand" VerticalOptions="Center" Orientation="OrientationHorizontal" FrameBackgroundColor="Black">
                        <sf:SfLinearGauge.Scales>
                          <sf:LinearScale MinimumValue="0" MaximumValue="100" ScaleBarLength="70" ShowRim="true" ShowLabels="false" ScaleBarColor="White" ScaleBarSize="12">
                            <sf:LinearScale.Ranges>
                              <sf:LinearRange x:Name="lowUsed" StartValue="0" Color="Green" EndValue="33" StartWidth="8" EndWidth="8" />
                              <sf:LinearRange x:Name="medUsed" StartValue="34" Color="Yellow" EndValue="67" StartWidth="8" EndWidth="8" />
                              <sf:LinearRange x:Name="highUsed" StartValue="68" Color="Red" EndValue="100" StartWidth="8" EndWidth="8" />
                            </sf:LinearScale.Ranges>
                            <sf:LinearScale.Pointers>
                              <sf:SymbolPointer x:Name="symbolPointer" Value="{Binding memoryUsed}" Offset="0.0" Thickness="3" Color="Black"/>
                            </sf:LinearScale.Pointers>
                          </sf:LinearScale>
                        </sf:SfLinearGauge.Scales>
                      </sf:SfLinearGauge>




VA Vanaja  Annasamy Syncfusion Team January 12, 2017 09:04 AM UTC

Hi Mark,

Thank you for contacting Syncfusion support. ​​​

Query:SfLinearGauge with Symbol and Range pointer

We have prepared a sample using SfLineargauge as per your requirement. Please download the same from the below available link.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/LINEAR~11527379873.ZIP 

Please let us know if you have any concern on this.

Regards,
Vanaja R.A. 


Loader.
Up arrow icon