#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10

    Cfchart -- time on x-axis


    I'm trying to use cfchart to graph network traffic over the past 24 hours. The problem is that it's creating a tick on the x-axis for the time on every data point, and therefore can't show the tick labels because they're too squished together. Is there a way I can make it only show a tick at each hour while still maintaining all of the data points?

    Here's the code I'm using:

    Code:
    <cfchart format="jpg" xaxistitle="Time" yaxistitle="Mbps" xaxistype="category" showlegend="true" chartwidth="750" chartheight="400" labelformat="number" showmarkers="false" showygridlines="true">
    	<cfchartseries type="line" serieslabel="Inbound" seriescolor="blue">
    		<cfloop query="attributes.traffic">
    			<cfchartdata item="#TimeFormat(attributes.traffic.datetime, "HH:mm")#" value="#attributes.traffic.inbound#">
    		</cfloop>
    	</cfchartseries>
    	<cfchartseries type="line" serieslabel="Outbound" seriescolor="green" >
    		<cfloop query="attributes.traffic">
    			<cfchartdata item="#TimeFormat(attributes.traffic.datetime, "HH:mm")#" value="#attributes.traffic.outbound#">
    		</cfloop>
    	</cfchartseries>
    </cfchart>
    Last edited by rawk; April 7th, 2011 at 04:44 PM.
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,273
    Rep Power
    968
    Without actually seeing it, it's hard to say. You can try specifying a value for the "gridLines" attribute. But if none of the available attributes seem to do what you need, you can try defining your own chart style (http://help.adobe.com/en_US/ColdFusi...2c24-74f2.html ).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10
    Here's the image it produces:

    Image 750

    Here's the same image only rendered with a width of 7500 instead of 750. On this image, you can actually see the numbers along the x-axis.

    Image 7500

    I just tried the gridLines attribute, but it only seems to affect horizontal gridlines.
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,273
    Rep Power
    968
    Yeah, then it may indeed be something you need to tweak in the style XML. I haven't messed with it a lot myself, but I know that there are a ton of options exposed by the XML styling.

    Comments on this post

    • rawk agrees
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10
    Thanks for the input, Kite. I was afraid of that.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0
    Hi Rawk just wondered if you ever got a fix for this ? I am having the same issue with the date time format.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    131
    Rep Power
    7
    Originally Posted by Stevie72
    Hi Rawk just wondered if you ever got a fix for this ? I am having the same issue with the date time format.
    The setting you are looking for is called "skipLabels". Use the webcharts utility to see it action. Create a bar chart > select xAxis > Group > Skip Labels
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    84
    Rep Power
    10
    Originally Posted by Stevie72
    Hi Rawk just wondered if you ever got a fix for this ? I am having the same issue with the date time format.
    Unfortunately, I did not. I'm actually using Open BlueDragon and xml chart styles are not yet supported. I will soon be looking into a third party graphing utility that I can use as Java plugin.
  16. #9
  17. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,273
    Rep Power
    968
    It's going to be HIGHLY unlikely that the charting system will ever have parity on the other CFML engines because they are not free. Adobe pays a lot of money to have this integration, and the alternative engines would be hard pressed to generate a comparable agreement.

IMN logo majestic logo threadwatch logo seochat tools logo