Sign in to follow this  
ste2425

Align annotations under gauge chart

Recommended Posts

Hi all

 

I need to take a fusion chart that was original made to be a fixed height and width and make it dynamic to its container. That is if the container expands the chart will re-render for the new size.

 

Iv'e managed to get the actual gauge chart to do this however the annotations under it im struggling with. They need to sit below the chart and center align to its width.

 

Iv'e attached what it looked like originally and how far ive managed to get. I still need to work on getting the needle to scale also.

 

As you can see the annotations are still in a fixed position. 

 

There is allot of tags in the XML to style it but the main thing i did to get the gauge to re-size was to remove the tags: gaugeOriginX, gaugeOriginY and gaugeOuterRadius.

 

Ive seen the chartBottomMargin tag which would allow me to specify a fixed margin at the bottom for the annotations to sit in but here lies my main question.

 

Is it possible to specify a percentage of the available space for the chart and annotations. Then have FusionCharts scale everything appropriately?

 

Otherwise You could end up with a really large chart and really small text under it. If not i'm still stuck on how to make the annotations sit under the chart and center on its width.

 

Any help would be greatly appritiated. 

 

Here's the XML for the annotations:

<annotations >
    <annotationGroup  xPos='180' yPos='100' showBelowChart='1'>
        <annotation  type='text' fontColor='777777' label='Taken:' xPos='0' yPos='0' align='center' fontFace='Verdana' isBold='1'/>
        <annotation  type='text' fontColor='777777' label='Remaining:' xPos='0' yPos='20' align='center' fontFace='Verdana' isBold='1'/>
    </annotationGroup >
</annotations >

I can post the entirety of the XML if needed but it is quite ugly with lots of tags.

post-68688-0-42055600-1453898379_thumb.jpg

post-68688-0-56666000-1453898388_thumb.jpg

Edited by ste2425

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum!

 

FusionCharts Suite XT lets you control annotations dynamically using the FusionCharts API. These methods let you create, update, set the visibility of, and delete annotation groups and items at run-time.

 

For more details: http://www.fusioncharts.com/dev/advanced-chart-configurations/annotations/controlling-annotations-dynamically.html

 

For resizing , the macros will help: http://www.fusioncharts.com/dev/advanced-chart-configurations/annotations/positioning-annotations-using-macros.html

 

Try using the attribute origH, origW, refer this for the same: http://www.fusioncharts.com/dev/advanced-chart-configurations/annotations/annotations-references.html

 

Hope this helps. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this