Sign in to follow this  
marcfromm

X Axis Labels

Recommended Posts

I followed an online tutorial for fusion carts and php. Everything works my data for a postgresql database displays correctly. I am now trying to format the x axis labels to be vertical. I found that labelDisplay=ROTATE is used to do this. When I include this there is no change to my x axis labels. In the $strParam line "labelDisplay=ROTATE" seems to be ignored, whether it is there or not the chart is displayed but the x-axis labels remain horizontal. How can I make my x-axis labels vertical? Thanks.

 

 

$strParam="caption=Workstudy Students;subCaption=By spriden_origin;xAxisName=spriden_origin;yAxisName=Students;labelDisplay=ROTATE;decimalPrecision=0; formatNumberScale=0";
$FC->setChartParams($strParam);

// Connect to the Database
$conn = pg_connect("host=localhost port=#### user=######## dbname=###");

$strQuery = "SELECT spriden_origin, count(spriden_origin) as total FROM sw_items GROUP BY spriden_origin ORDER BY spriden_origin";
$result = pg_query($conn, $strQuery);
$numrows = pg_num_rows($result);
echo "Records:" . $numrows . "<br />";

while($row = pg_fetch_object($result)){
   $count = $row->total;
   $spriden_origin = $row->spriden_origin;
   echo $spriden_origin . " : " . $count . " | ";
   $FC->addChartData($count,"name=" . $spriden_origin);
   } 

$FC->renderChart();

Share this post


Link to post
Share on other sites
Guest Sumedh

Greetings. :)

 

I am afraid, I could not replicate the same.

 

Please find attached screenshot for your reference with this reply.

 

Can you please, send us the relevant XML file of your issue?

 

It will be helpful for us, to look into it.

post-24802-0-19467500-1328697824_thumb.jpg

Share this post


Link to post
Share on other sites

Greetings. :)

 

I am afraid, I could not replicate the same.

 

Please find attached screenshot for your reference with this reply.

 

Can you please, send us the relevant XML file of your issue?

 

It will be helpful for us, to look into it.

If by XML you mean the view source of the php page as seen in the browser.

<!-- START Script Block for Chart Column3D1 --> 

<div id="Column3D1Div">
Chart.
</div>
<script type="text/javascript" > 
var chart_Column3D1 = new FusionCharts("../FusionCharts/FCF_Column3D.swf", "Column3D1", "1200", "300", "0", "0", "","noScale","EN"); 
//Provide entire XML data using dataXML method
chart_Column3D1.setDataXML("<graph caption='Workstudy Students' subCaption='By spriden_origin' xAxisName='spriden_origin' yAxisName='Students' labelDisplay='ROTATE' decimalPrecision='0'  formatNumberScale='0'  ><set  value='1' name='ADMWEB'  color='AFD8F8'  /><set  value='17436' name='ADNT'  color='F6BD0F'  /><set  value='5' name='ALCONV'  color='8BBA00'  /><set  value='6' name='ALNT'  color='FF8E46'  /><set  value='37' name='APAIDEN'  color='008E8E'  /><set  value='3' name='FOAIDEN'  color='D64646'  /><set  value='35' name='FTMVEND'  color='8E468E'  /><set  value='41' name='PPAIDEN'  color='588526'  /><set  value='3' name='RCRTP00'  color='B3AA00'  /><set  value='10' name='RCRTP01'  color='008ED6'  /><set  value='13' name='RCRTP02'  color='9D080D'  /><set  value='22' name='RCRTP03'  color='A186BE'  /><set  value='40' name='RCRTP04'  color='CC6600'  /><set  value='48' name='RCRTP05'  color='FDC689'  /><set  value='57' name='RCRTP06'  color='ABA000'  /><set  value='55' name='RCRTP07'  color='F26D7D'  /><set  value='107' name='RCRTP08'  color='FFF200'  /><set  value='149' name='RCRTP09'  color='0054A6'  /><set  value='330' name='RCRTP10'  color='F7941C'  /><set  value='497' name='RCRTP11'  color='CC3300'  /><set  value='3682' name='RCRTP12'  color='006600'  /><set  value='19' name='SAAQUIK'  color='663300'  /><set  value='75' name='SORTAPE'  color='6DCFF6'  /><set  value='973' name='SPAIDEN'  color='AFD8F8'  /><set  value='75' name='SRAQUIK'  color='F6BD0F'  /><set  value='155' name='STUCONV'  color='8BBA00'  /><set  value='0' name=''  color='FF8E46'  /></graph>");
chart_Column3D1.render("Column3D1Div");
</script>

<!-- END Script Block for Chart Column3D1 -->

The acutal php page code is as shown in the start of my post in the code block.

 

Thanks

Share this post


Link to post
Share on other sites

The only other thing I can provide to find a sollution to not being abale to rotate the x-axis labels is can it be because I am using "FusionCharts_Gen.php" as an include and not "FusionCharts.php" ?

 

I hope there can be a solution, since as shown in my attacehd image above having 27 different items to graph creates a mess on the x-axis labels.

 

Thanks

 

 

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Thank you for the post.

 

Can you please let us know the version of FusionCharts that you are currently using ?

 

It seems like you are using FusionCharts Free version.

 

If yes, can you please try using 'rotateNames' attribute of the chart and set it to 1 ?

 

Please find attached screenshot of the chart rendered using the above settings.

 

Hope this helps !

 

Happy FusionCharting :D

post-23884-0-04674800-1328759399_thumb.png

Share this post


Link to post
Share on other sites

Can you please let us know the version of FusionCharts that you are currently using ?

FusionCharts Free v2.2

Released: Aug 2009

 

please try using 'rotateNames' attribute of the chart and set it to 1

 

Yes this worked. All my searching and topics only mentioned the labelDisplay attribute.

 

Thanks

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Thank you for the response.

 

We are glad to know that the solution worked.

 

Happy FusionCharting :D

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