We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Adding gauge to canvas on RT and Phone

Ideally I want to set the background colour of the face, i.e. the bit inside the main scale. 
I've not figured a way of doing this so I've resorted to putting an ellipse in behind it. On the page I'm using as a test this works fine and it's all sitting inside a Grid. 

However I'm using the gauge as a Style, which has dependency properties backing some of the values, which is referenced via a DataTemplate as part of a an ItemsControl control. Sounds convoluted, but I've been led to believe this is the best way for what I'm trying to do. But as soon as I display the gauge then the relationship is lost  between the location of the ellipse and the location of the gauge.

So I tried putting the gauge and ellipse inside a canvas, so it would keep this relationship, but as soon as I do that the I get an error in the XAML designer: TypeLoadException: Could not find Windows Runtime type 'Windows.UI.Xaml.Controls.RelativeSource'.

Can the control not sit in a Canvas? or ViewBox?

Even on a new, blank app, as soon as I do this it errors out. Is there a way around this?

Thanks...



3 Replies

VR Vigneshkumar Ramasamy Syncfusion Team April 30, 2015 07:30 AM UTC

Hi Mike

We are able to reproduce the mentioned issue” error occurs when adding the SfCircularGauge inside the canvas panel” and we have logged an issue report on this and the fixfor this issue will included in our Service Pack 2 Volume 1, 2015 release. And also the issue can be resolved in sample level by setting Width and Height to the SfCircularGauge as in the below code snippet.

Code Snippet:

<Canvas Width="500" Height="500">

<syncfusion:SfCircularGauge Width="500" Height="500" ></syncfusion:SfCircularGauge>


<Ellipse Width="100" Height="100" Canvas.Top="200" Canvas.Left="200" Fill="Yellow"></Ellipse>

</Canvas>


Please let us know if you have any concerns.
Regards
Vigneshkumar R.


MC Mike Cowing May 1, 2015 12:36 PM UTC

Thanks. I'll try the workaround when I'm back in the UK.

Cheers, Mike...


VR Vigneshkumar Ramasamy Syncfusion Team May 4, 2015 10:42 AM UTC

Hi Mike,

Thanks for the update. Please let us know if you require further assistance on this.

Regards

Vigneshkumar R.


Loader.
Up arrow icon