Sign in to follow this  
GKoehl

Labelstep Issue With Js Rendered Graph

Recommended Posts

Hey All,

 

I am new to the forum and I have looked for a post regarding the issue I am seeing but was unable to find one. If this post is misplaced please point me in the right direction. So I recently upgraded to 3.2, and I think all of the added functionality is great, thank you for the hard work. I have come across an issue and I am not sure if I am doing something improperly or it is a feature that is not yet available.

 

Basically I am trying to set the the "labelStep" value of a chart for the javascript rendered graph (MSLine). When I render the graph as flash with labelStep='4', the x-axis labels display as expected. However when I am viewing the same graph rendered with javascript, I see no label stepping as all x-axis labels are displayed.

 

I included a text file that shows an idea of what my graph would look like, sorry for the jumbled xml, I'm unable to use setDataXML with line breaks in the xml and I have yet to update the system to be able to use setXMLUrl. Thanks for any help you can offer, if this is simply a feature that is not added yet just let me know, thanks.

 

-- EDIT --

File would not upload properly so I'll just past the text, sorry for the inconvenience.

 

 

 

<script type='text/javascript' src='/js/jquery.js'></script>

<script type='text/javascript' src='/Charts/FusionCharts.js'></script>

<script type='text/javascript'>

var $j = jQuery.noConflict();

$j(document).ready(function() {

FusionCharts.setCurrentRenderer('javascript');

var chart_dt_inout_chart = new FusionCharts('/Charts/MSLine.swf', 'dt_inout_chart', '100%', '100%', '0', '1');

chart_dt_inout_chart.setDataXML("<chart labelStep='4'><categories><vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='12 AM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='1 AM' /> <category label='2 AM' /> <category label='4 AM' /> <category label='6 AM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='7 AM' /> <category label='8 AM' /> <category label='9 AM' /> <category label='10 AM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='11 AM' /> <category label='12 PM' /> <category label='1 PM' /> <category label='2 PM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='3 PM' /> <category label='4 PM' /> <category label='5 PM' /> <category label='6 PM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='7 PM' /> <category label='8 PM' /> <category label='9 PM' /> <category label='10 PM' /> <vline color='CCCCCC' dashed='1' dashLen='1' dashGap='2'></vline> <category label='11 PM' /> </categories> <dataset seriesName='Incoming' color='56a734' anchorBgColor='56a734'> <set value='0' /> <set value='4' /> </dataset> <dataset seriesName='Outgoing' color='ff9404' anchorBgColor='ff9404'> <set value='1' /> <set value='10' /> </dataset></chart>");

chart_dt_inout_chart.render('dt_inout_chartDiv');

});

</script>

<div id='dt_inout_chartDiv' align='center'>Loading Chart...</div>

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

 

I am afraid, as of it does not support the "labelStep" attribute.

 

We hope to support the same in our next release.

Share this post


Link to post
Share on other sites

Actually, there is a workaround I've discovered. Place this code in before you call render(), it will show only every 4th label as you've asked:

 

if (!!chart_dt_inout_chart._overrideJSChartConfiguration) {
chart_dt_inout_chart._overrideJSChartConfiguration({
	xAxis: {
		labels: {
			formatter: function() {
				if (this.index % 4 == 0) {
					return this.value;
				} else { 
					return "";
				}
			}
		}
	}
});
}

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