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 Elements in front of and behind the Gauge

Hi,

I'm trying to add a PNG image in front of my Circular Gauge so that the shifting gauge is visible behind the image through empty squares. The way I'm attempting to do this is by adding the PNG in my XML file and then trying to program the CircularGauge in through the Java file to go behind it. I could go into more detail with my code, however, the fact that I have to set the Gauge as my entire view is the bigger issue that I think will prevent any method of mine from working. Is there any workaround? Why has Syncfusion programmed their gauge in this fashion? I think it limits the customizability and power of the gauge. Thank you

3 Replies

NM Nijamudeen Mohamed Sulaiman Syncfusion Team August 13, 2015 08:55 AM UTC

Hi Areeb,

Thanks for your interest in Syncfusion products.

We have analyzed the provided information and we suspect that your requirement is to set the Size of CircularGauge. This can be achieved by the following two ways and its code snippets.


1. Setting the RadiusFactor to CircularScale of CircularGauge.

Code snippet:


circularScale.setRadiusFactor(0.5);  // value ranges from 0.0 to 1.0



2. Setting the size for its parent layout.

Code snippet:


LinearLayout mLinearLayout = new LinearLayout(this);
 
LinearLayout.LayoutParams mBarParams=
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
mBarParams.setMargins(
30, 30, 30, 30);
mBarParams.
height=500;
mBarParams.
width=300;

mLinearLayout.setLayoutParams(mBarParams);



We have prepared a simple sample based on this. Please find the sample below.

Sample Link: Gauge_Sizing_AndroidStudio

If the provided Sample does not meet your requirement, could you please modify the provided sample along with its reproducing procedure? It will be helpful for us to analyze on your requirement and provide you a possible solution.

Please let us know, if you have any queries.

 

Regards,
Nijamudeen M.

 
 



AR AreM August 13, 2015 05:33 PM UTC

This is great! I played around with the sample project and got the exact results I need, and this also allows plenty of flexibility. The scaling wasn't an issue, but placing separately configured gauges around the screen with overlying and underlying graphics was the goal and your project gave me the understanding to implement that. Thank you for the service!


NM Nijamudeen Mohamed Sulaiman Syncfusion Team August 14, 2015 04:20 AM UTC

Hi Areeb,


Thanks for your update.      


We are glad to know that you have met your requirement. Please let us know if you need further assistance.


Regards,

Nijamudeen M.


Loader.
Up arrow icon