TimDG

Strange Issue With Candlestick Charts (Scaling Of Y Axis)

Recommended Posts

Hi,

 

I'm trying out the FusionCharts and PowerCharts graph libraries and I've noticed some odd occurences with the candle stick charts. It appears as if the Y-axis isn't always long enough to show all data.

 

Chart 1:

{"chart":{"exportShowMenuItem":"0","exportFormats":"PDF=Export as PDF","caption":"Some more data","exportAction":"download","exportEnabled":1,"exportHandler":"/export.do","exportAtClient":"0","html5ExportHandler":"/export.do"},"categories":[{"category":[{"x":"1","label":"1"},{"x":"2","label":"2"},{"x":"3","label":"3"},{"x":"4","label":"4"},{"x":"5","label":"5"}]}],"dataset":[{"data":[{"open":"23.18","close":"24.02","high":"26.44","low":"22.8","x":"1"},{"open":"23.14","close":"23.54","high":"23.68","low":"22.7","x":"2"},{"open":"22.29","close":"21.46","high":"22.67","low":"20.9","x":"3"},{"open":"26.17","close":"25.88","high":"27.47","low":"23.9","x":"4"},{"open":"20.5","close":"21.2","high":"21.48","low":"20.5","x":"5"}]}]}

Result: abb7YjTI.png?st=gkX2oWBxh2PwRBFV2yLMww&e=1344351509

 

 

Chart 2:

{"chart":{"exportShowMenuItem":"0","exportFormats":"PDF=Export as PDF","caption":"Some more data","exportAction":"download","exportEnabled":1,"exportHandler":"/export.do","exportAtClient":"0","html5ExportHandler":"/export.do"},"categories":[{"category":[{"x":"1","label":"1"},{"x":"2","label":"2"},{"x":"3","label":"3"},{"x":"4","label":"4"},{"x":"5","label":"5"}]}],"dataset":[{"data":[{"open":"22.63","close":"22.15","high":"23.78","low":"21.8","x":"1"},{"open":"23.26","close":"23.47","high":"24.06","low":"23.2","x":"2"},{"open":"23.94","close":"24.8","high":"26.54","low":"23.3","x":"3"},{"open":"23.6","close":"25.01","high":"26.97","low":"22.7","x":"4"},{"open":"25.66","close":"26.31","high":"26.63","low":"24.6","x":"5"}]}]}

 

Result: acv6d7yM.png?st=QM6OxenW5Ep-eXRIoIKogg&e=1344351651

 

Chart 3:

 

{"chart":{"exportShowMenuItem":"0","exportFormats":"PDF=Export as PDF","caption":"Some more data","exportAction":"download","exportEnabled":1,"exportHandler":"/export.do","exportAtClient":"0","html5ExportHandler":"/export.do"},"categories":[{"category":[{"x":"1","label":"1"},{"x":"2","label":"2"},{"x":"3","label":"3"},{"x":"4","label":"4"},{"x":"5","label":"5"}]}],"dataset":[{"data":[{"open":"25.06","close":"25.58","high":"26.69","low":"24.7","x":"1"},{"open":"25.3","close":"26.14","high":"26.92","low":"25.0","x":"2"},{"open":"25.11","close":"25.85","high":"28.31","low":"24.5","x":"3"},{"open":"25.13","close":"24.52","high":"28.21","low":"23.6","x":"4"},{"open":"24.2","close":"25.67","high":"28.23","low":"23.8","x":"5"}]}]}

 

Result: abx8Qvfj.png?st=c4P9sKG9XwXow8Q3tLtDow&e=1344351691

 

I'm using a complete javascript implementation and the jquery plugin to load the charts.

 

I currently allow the user to select 4 charts to be displayed on a single page with random contents. This is the code I use to load the graphs:

 

   var $container = $("#chartContainer" + index).insertFusionCharts({
   	swfUrl:graph,
   	renderer:'javascript',
   	dataSource:"/report.do?type=" + type,
   	dataFormat:"jsonurl",
   	width:"550",
   	height:"300",
   	registerWithJS:'1',
   	id:"myChartId" + index
}).data("exportId", "#export" + index)
   	.bind("fusionchartsdrawcomplete", drawComplete);

 

graph and type indicate the type of graph and the contents as they should be returned by the server. Index is an integer from 0 to 3, identifying both the graph as well as the div where the chart should be placed.

 

Do you have any idea what could be causing this?

 

Thanks in advance.

 

Regards,

Tim.

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

Welcome to the FusionCharts Forum :)

 

Thank you for the post.

 

We are looking into it and would get back to you as soon as possible.

 

In the mean time, please try and use the attribute "pYAxisMaxValue" and set it an appropriate value.

 

Hope this helps!

Edited by Bindhu

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to the FusionCharts Forum :)

 

Thank you for the post.

 

We are looking into it and would get back to you as soon as possible.

 

In the mean time, please try and use the attribute "pYAxisMaxValue" and set it an appropriate value.

 

Hope this helps!

 

 

Hi,

 

Thanks for the quick reply. Setting that attribute seems to do the trick: the graphs now render properly.

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