Sign in to follow this  
hMayuresh

Problem In Displaying Y-Axis Namings Properly

Recommended Posts

Hi,

 

I am trying to show line graph. but when ther is data with 1 or 0 data points, values on Y-axis gets duplicated.

Means if my resulting values for Y-axis are 0 or 1, names on Y-axis gets duplicated as 0-0-1-1-2-3 like this.

Can nay one help me to resolve this?

 

 

Thanks,

Mayuresh

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Could you please send us a screenshot to look into the issue?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for your help,

here I am attaching the screen shot for more clarification.

 

Thanks,

Mayuresh

 

Hi,

 

Could you please send us a screenshot to look into the issue?

 

Awaiting for your reply.

post-10206-076708700 1298357762_thumb.png

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Could you please send us the code to look into the issue?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

Hi,

 

Please find code as mentioned below,

 

$objFusionChart = new FusionCharts('MSLine','778','250', '', 1);
    	$objFusionChart->SWFPath = '/Common/fushion/fushion_charts/';

    	# Store chart attributes in a variable
  		$strParam="bgColor=EEEEEE;
  					canvasBorderThickness=1;
  					chartLeftMargin=15;
  					chartRightMargin=25;
  					chartTopMargin=10;
  					xAxisNamePadding=10;
  					yAxisValuePadding=20;
  					xAxisValuePadding=20;
  					valuePadding=5;
  					canvasPadding=20;
  					labelPadding=10;
  					yAxisNamePadding=20;
  					borderThickness=0;
  					outCnvBaseFont=Verdana;
  					outCnvbaseFontSize=10;
				baseFont=Verdana;
				baseFontSize=9;
				baseFontColor=666666;
  					zeroPlaneColor=000000;
  					zeroPlaneThickness=3;
  					zeroPlaneAlpha=80;
  					bgAlpha=40,100;
  					numVDivLines=10;
  					showValues=0;
  					caption=;
  					xAxisName=;
  					rotateYAxisName=0;
  					yAxisNameWidth=0;
  					yAxisName=;
  					divLineIsDashed=1;
  					divLineDashedLen=2;
  					divLineDashedGap=2;
  					numberPrefix=;
  					labelDisplay=Rotate;
  					slantLabels=1;
  					formatNumberScale=0;";

  		$objFusionChart->setChartParams( $strParam );

  		$arrmixYAxisData = array(
			'02/07/2011' => 0,
			'02/08/2011' => 0,
			'02/09/2011' => 0,
			'02/10/2011' => 0,
			'02/11/2011' => 0,
			'02/12/2011' => 0,
			'02/13/2011' => 0,
			'02/14/2011' => 0,
			'02/15/2011' => 0,
			'02/16/2011' => 0,
			'02/17/2011' => 1,
			'02/18/2011' => 0,
			'02/19/2011' => 0,
			'02/20/2011' => 0,
			'02/21/2011' => 0,
			'02/22/2011' => 0,
		);

	$objFusionChart->addDataset( '' );
	foreach( $arrmixYAxisData as $strDate=>$intTraffic ) {			
		$objFusionChart->addCategory( date( 'M/d/y', strtotime( $strDate )) );
		$objFusionChart->addChartData( (int) $intTraffic, "toolText=".$strDate .', '.$intTraffic );
	}

	$objFusionChart->renderChart( true );
	exit;

 

Thanks

Mayuresh

 

Hi,

 

Could you please send us the code to look into the issue?

 

Awaiting for your reply.

Share this post


Link to post
Share on other sites

Hi,

 

Thanks a lot.

It is working fine if the data point is 1..but still displaying duplicate y-axis names/values if data point value is 0.

 

 

Thanks,

Mayuresh

 

Hi,

 

Please try the same using <decimals='1'> attribute.

 

Hope this helps.smile.gif

Edited by hMayuresh

Share this post


Link to post
Share on other sites

Hi,

 

Thanks a lot.

It is working fine if the data point is 1..but still displaying duplicate y-axis names/values if data point value is 0.

 

 

Thanks,

Mayuresh

 

 

Share this post


Link to post
Share on other sites

Hi,

 

I have the same problem with duplicated y axis labels using Bar2D, Column2D and Column3D charts. I've already tried your suggestions but the result is the same (see the attachment). However, using the stacked types with the same data, the graph displays correctly.

 

I'm loading the data using PHP Class with the addDatasetsFromDatabase method. This is the recordset I get from the DB:

 

post-15025-021133000 1304055896_thumb.jpg

 

 

Thanks in advance

 

Hi,

 

Please try the same using <numDivLines> and <showDivLinesValues> attribute inside the <chart> element.

 

For more details, please refer to the link: http://www.fusioncha...c/DivLines.html

 

Hope this helps.smile.gif

post-15025-046435300 1304055206_thumb.jpg

post-15025-046373200 1304055582_thumb.jpg

Edited by Fer

Share this post


Link to post
Share on other sites
Guest Rajroop

Hey,

 

Could you try setting the value for the 'numDivLines' to 4-5? This would result in the divisional lines of the chart to be restricted than the present number and thereby not showing any repetition of the Y-axis values.

Ex: <chart .. .. numDivLines='4' .. .. >

 

I hope this helps. :D

Share this post


Link to post
Share on other sites

Hi Rajroop,

 

I tried like you said but the problem still there.

This is the JS generated :

 

<div id="MSColumn2D8Div"> 	Chart.</div> <script type="text/javascript" > 	var chart_MSColumn2D8 = new FusionCharts("fusioncharts/Charts/FCF_MSColumn2D.swf?ChartNoDataText=No hay datos para graficar&PBarLoadingText=Por favor espere. Cargando datos...", "MSColumn2D8", "640", "480", "0", "0", "","noScale","EN"); 	chart_MSColumn2D8.setTransparent("true");	//Provide entire XML data using dataXML method	chart_MSColumn2D8.setDataXML("<graph caption='Estatus de eventos' subCaption='Por ejecutivo' xAxisName='Ejecutivos' yAxisName='Nº de eventos' showBorder='1' showNames='1' formatNumberScale='0' decimalPrecision='0' showValues='0' bgAlpha='50' canvasBgAlpha='30' numDivLines='4' showDivLinesValues='1' decimals='1'  ><categories  ><category name='Elizabeth Torres López'  /><category name='Fernando Reyes'  /><category name='Gabriela Guerra'  /><category name='Vanessa Campuzano'  /></categories><dataset  seriesName='Diseño de propuesta'  color='AFD8F8' ><set  value='0'  /><set  value='1'  /><set  value='0'  /><set  value='0'  /></dataset><dataset  seriesName='Negociación'  color='F6BD0F' ><set  value='0'  /><set  value='0'  /><set  value='1'  /><set  value='0'  /></dataset><dataset  seriesName='Presentación de propuesta'  color='8BBA00' ><set  value='1'  /><set  value='2'  /><set  value='0'  /><set  value='1'  /></dataset><dataset  seriesName='Primer acercamiento'  color='FF8E46' ><set  value='0'  /><set  value='1'  /><set  value='0'  /><set  value='0'  /></dataset></graph>");	chart_MSColumn2D8.render("MSColumn2D8Div");</script>  

 

Hey,

 

Could you try setting the value for the 'numDivLines' to 4-5? This would result in the divisional lines of the chart to be restricted than the present number and thereby not showing any repetition of the Y-axis values.

Ex: <chart .. .. numDivLines='4' .. .. >

 

I hope this helps. :D

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thank for your reply.

 

Please try the same by giving different names to charts's JavaScript variable and chart ID.

 

Hope this helps.smile.gif

Share this post


Link to post
Share on other sites

But, as I understand, those names are automatically generated by the PHP Class, isn't it?

Does the zero values has something to do with the error?

Hi,

 

Thank for your reply.

 

Please try the same by giving different names to charts's JavaScript variable and chart ID.

 

Hope this helps.smile.gif

post-15025-026890500 1304363444_thumb.jpg

post-15025-017570900 1304363574_thumb.jpg

Share this post


Link to post
Share on other sites

As you can see in the attachments on my last post, I've noticed that when the values to be graphicated are bigger (i.e. 10 instead of 1), the y axis is correctly displayed even when some zeroes are present. To test this, I altered the DB resultset to ilustrate this behavior but I can't do this with the real data niether depend on the data itself to get the right graphic or not.

Share this post


Link to post
Share on other sites

Hi,

 

You can try using decimalPrecision='2' to see that these are not duplicates but different numbers with are rounded. I am afraid, as of now, you would need to specifically set the numDivLines and yAxisMaxValue and yAxisMinValue in these cases.

Share this post


Link to post
Share on other sites

Hi,

 

I tried the decimalPrecision parameter and, as you told me, it worked fine with small numbers. Even more, there was no need to useN umDivLines, yAxisMaxValue and yAxisMinValue.

 

Thanks a lot

 

I have another question: I saw that in FusionCharts_Gen.php exists some functions to handle Gantt charts. Do they work even if it says that is for future use?. In case not, what arrangements do I need to make to make them work?

 

Kind regards

Hi,

 

You can try using decimalPrecision='2' to see that these are not duplicates but different numbers with are rounded. I am afraid, as of now, you would need to specifically set the numDivLines and yAxisMaxValue and yAxisMinValue in these cases.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thank you very much for your appreciation.

 

This is to inform you that functions for handing gantt chart in FusionCharts_Gen.php are not yet ready.

 

Our developers are working on this and will get back to you once they are ready to use.

 

Thank you very much for your continued patience and patronage.

 

Hope you have a great day!

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for your fast response.

Having in mind what you told me, I decided to give a closer look at those Gantt functions just for curiosity and they seemed to me that they should work. So I write a small test loading data from a DB and, SURPRISE, THEY DO WORK FINE !!!.

Of course, this functions are not as easy to use like, for example, "addDatasetsFromDatabase" and you have to do some tricks specially when loading from DB but the important thing is that I was able to use them untouched. I realize that part of this complexity could be due to the particular nature of the Gantt charts against the other types.

 

Any way, I will be waiting for any notice from your developers.

 

For the record, I'm using FusionCharts Free v2.2 released on Aug 2009

 

Kind regards

Hi,

 

Thank you very much for your appreciation.

 

This is to inform you that functions for handing gantt chart in FusionCharts_Gen.php are not yet ready.

 

Our developers are working on this and will get back to you once they are ready to use.

 

Thank you very much for your continued patience and patronage.

 

Hope you have a great day!

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thank you very much for your valuable feedback.

 

We will keep you updated regrading this matter.

 

Meanwhile, keep FusionCharting!biggrin.gif

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