Sign in to follow this  
Guest Madhumita

Date/Time as X Axis

Recommended Posts

I am trying to generate server CPU graphs where the time span ranges based on user input. For a given user input 1,000 datapoints are returned from a MS SQL database in XML format. How should I format the returned Date/Time variable so the 2D line chart properly displays the date time? On the same page the X Axis time range can be anywhere from 1 hour to 2 years.

I attached some of the code I am using:

 <!-- START Script Block for Chart ByCategory -->
<div id='ByCategoryDiv' align='center'>
Chart.
</div>
<script type="text/javascript">
var chart_ByCategory = new FusionCharts("../FusionCharts/line.swf", "ByCategory", "1000", "400", "0", "0");
chart_ByCategory.setDataXML("<chart caption='Test Customer' subcaption='CPU Usage' xaxisname='Date/Time' yaxisname='CPU Percentage' palette='1' formatnumberscale='0' showvalues='0' drawAnchors='0' lineThickness='1'><set label='2009-12-01T11:30:32' value='7.59' /><set label='2009-12-01T11:31:32' value='0.54' /><set label='2009-12-01T11:32:32' value='0.82' /><set label='2009-12-01T11:33:32' value='0.62' /><set label='2009-12-01T11:34:32' value='1.43' /><set label='2009-12-01T11:35:32' value='7.62' /><set label='2009-12-01T11:36:32' value='0.65' /><set label='2009-12-01T11:37:32' value='0.69' /><set label='2009-12-01T11:38:32' value='0.69' /><set label='2009-12-01T11:39:32' value='1.09' /><set label='2009-12-01T11:40:32' value='8.72' /><set label='2009-12-01T11:41:32' value='0.90' /><set label='2009-12-01T11:42:32' value='0.84' /><set label='2009-12-01T11:43:32' value='0.60' /><set label='2009-12-01T11:44:32' value='1.14' /><set label='2009-12-01T11:45:32' value='8.18' /><set label='2009-12-01T11:46:32' value='0.81' /><set label='2009-12-01T11:47:32' value='0.74' /><set label='2009-12-01T11:48:32' value='0.75' /><set label='2009-12-01T11:49:32' value='1.39' /><set label='2009-12-01T11:50:32' value='7.97' /><set label='2009-12-01T11:51:32' value='0.72' /><set label='2009-12-01T11:52:32' value='0.72' /><set label='2009-12-01T11:53:32' value='0.62' /><set label='2009-12-01T11:54:32' value='1.25' /><set label='2009-12-01T11:55:32' value='8.11' /><set label='2009-12-01T11:56:32' value='0.76' /><set label='2009-12-01T11:57:32' value='0.71' /><set label='2009-12-01T11:58:32' value='0.49' /><set label='2009-12-01T11:59:32' value='1.11' /><set label='2009-12-01T12:00:32' value='12.78' /><set label='2009-12-01T12:01:32' value='0.66' /><set label='2009-12-01T12:02:32' value='0.57' /><set label='2009-12-01T12:03:32' value='0.70' /><set label='2009-12-01T12:04:32' value='1.15' /><set label='2009-12-01T12:05:32' value='7.80' /><set label='2009-12-01T12:06:32' value='0.52' /><set label='2009-12-01T12:07:32' value='0.87' /><set label='2009-12-01T12:08:32' value='0.54' /><set label='2009-12-01T12:09:32' value='1.43' /><set label='2009-12-01T12:10:32' value='8.01' /><set label='2009-12-01T12:11:32' value='0.81' /><set label='2009-12-01T12:12:32' value='0.85' /><set label='2009-12-01T12:13:32' value='1.59' /><set label='2009-12-01T12:14:32' value='2.08' /><set label='2009-12-01T12:15:32' value='8.54' /><set label='2009-12-01T12:16:32' value='0.54' /><set label='2009-12-01T12:17:32' value='0.74' /><set label='2009-12-01T12:18:32' value='0.60' /><set label='2009-12-01T12:19:32' value='1.21' /><set label='2009-12-01T12:20:32' value='7.75' /><set label='2009-12-01T12:21:32' value='0.57' /><set label='2009-12-01T12:22:32' value='0.74' /><set label='2009-12-01T12:23:32' value='0.56' /><set label='2009-12-01T12:24:32' value='1.27' /><set label='2009-12-01T12:25:32' value='7.86' /><set label='2009-12-01T12:26:32' value='0.62' /><set label='2009-12-01T12:27:32' value='0.82' /><set label='2009-12-01T12:28:32' value='0.72' /><set label='2009-12-01T12:29:32' value='1.40' /><set label='2009-12-01T12:30:32' value='8.30' /><set label='2009-12-01T12:31:32' value='0.83' /><set label='2009-12-01T12:32:32' value='0.55' /><set label='2009-12-01T12:33:32' value='0.79' /><set label='2009-12-01T12:34:32' value='1.14' /><set label='2009-12-01T12:35:32' value='7.79' /><set label='2009-12-01T12:36:32' value='0.78' /><set label='2009-12-01T12:37:32' value='0.91' /><set label='2009-12-01T12:38:32' value='0.71' /><set label='2009-12-01T12:39:32' value='1.42' /><set label='2009-12-01T12:40:32' value='8.93' /><set label='2009-12-01T12:41:32' value='0.97' /><set label='2009-12-01T12:42:32' value='0.89' /><set label='2009-12-01T12:43:32' value='0.67' /><set label='2009-12-01T12:44:32' value='1.18' /><set label='2009-12-01T12:45:32' value='8.15' /><set label='2009-12-01T12:46:32' value='0.72' /><set label='2009-12-01T12:47:32' value='0.73' /><set label='2009-12-01T12:48:32' value='0.68' /><set label='2009-12-01T12:49:32' value='1.22' /><set label='2009-12-01T12:50:32' value='7.87' /><set label='2009-12-01T12:51:32' value='0.89' /><set label='2009-12-01T12:52:32' value='0.71' /><set label='2009-12-01T12:53:32' value='0.57' /><set label='2009-12-01T12:54:32' value='1.40' /><set label='2009-12-01T12:55:32' value='7.90' /><set label='2009-12-01T12:56:32' value='0.78' /><set label='2009-12-01T12:57:32' value='0.70' /><set label='2009-12-01T12:58:32' value='0.68' /><set label='2009-12-01T12:59:32' value='1.30' /><set label='2009-12-01T13:00:32' value='12.23' /><set label='2009-12-01T13:01:32' value='0.91' /><set label='2009-12-01T13:02:32' value='0.61' /><set label='2009-12-01T13:03:32' value='0.82' /><set label='2009-12-01T13:04:32' value='1.38' /><set label='2009-12-01T13:05:32' value='9.07' /><set label='2009-12-01T13:06:32' value='1.09' /><set label='2009-12-01T13:07:32' value='1.09' /><set label='2009-12-01T13:08:32' value='0.72' /><set label='2009-12-01T13:09:32' value='1.40' /><set label='2009-12-01T13:10:32' value='7.91' /><set label='2009-12-01T13:11:32' value='0.62' /><set label='2009-12-01T13:12:32' value='0.62' /><set label='2009-12-01T13:13:32' value='1.17' /><set label='2009-12-01T13:14:32' value='2.88' /><set label='2009-12-01T13:15:32' value='8.79' /><set label='2009-12-01T13:16:32' value='0.84' /><set label='2009-12-01T13:17:32' value='0.96' /><set label='2009-12-01T13:18:32' value='0.85' /><set label='2009-12-01T13:19:32' value='1.49' /><set label='2009-12-01T13:20:32' value='7.87' /><set label='2009-12-01T13:21:32' value='0.61' /><set label='2009-12-01T13:22:32' value='0.78' /><set label='2009-12-01T13:23:32' value='0.85' /><set label='2009-12-01T13:24:32' value='1.61' /><set label='2009-12-01T13:25:32' value='8.18' /><set label='2009-12-01T13:26:32' value='0.92' /><set label='2009-12-01T13:27:32' value='0.91' /><set label='2009-12-01T13:28:32' value='1.04' /><set label='2009-12-01T13:29:32' value='1.16' /><set label='2009-12-01T13:30:32' value='8.05' /><set label='2009-12-01T13:31:32' value='0.67' /><set label='2009-12-01T13:32:32' value='0.72' /><set label='2009-12-01T13:33:32' value='0.72' /><set label='2009-12-01T13:34:32' value='1.26' /><set label='2009-12-01T13:35:32' value='7.74' /><set label='2009-12-01T13:36:32' value='0.75' /><set label='2009-12-01T13:37:32' value='0.76' /><set label='2009-12-01T13:38:32' value='0.83' /><set label='2009-12-01T13:39:32' value='1.23' /><set label='2009-12-01T13:40:32' value='8.89' /><set label='2009-12-01T13:41:32' value='0.68' /><set label='2009-12-01T13:42:32' value='0.75' /><set label='2009-12-01T13:43:32' value='0.85' /><set label='2009-12-01T13:44:32' value='1.33' /><set label='2009-12-01T13:45:32' value='8.38' /><set label='2009-12-01T13:46:32' value='0.81' /><set label='2009-12-01T13:47:32' value='0.77' /><set label='2009-12-01T13:48:32' value='0.77' /><set label='2009-12-01T13:49:32' value='1.21' /><set label='2009-12-01T13:50:32' value='7.96' /><set label='2009-12-01T13:51:32' value='0.71' /><set label='2009-12-01T13:52:32' value='0.82' /><set label='2009-12-01T13:53:32' value='0.72' /><set label='2009-12-01T13:54:32' value='1.41' /><set label='2009-12-01T13:55:32' value='7.96' /><set label='2009-12-01T13:56:32' value='0.67' /><set label='2009-12-01T13:57:32' value='0.83' /><set label='2009-12-01T13:58:32' value='0.76' /><set label='2009-12-01T13:59:32' value='1.43' /><set label='2009-12-01T14:00:32' value='12.42' /><set label='2009-12-01T14:01:32' value='1.03' /><set label='2009-12-01T14:02:32' value='0.89' /><set label='2009-12-01T14:03:32' value='0.72' /><set label='2009-12-01T14:04:32' value='1.31' /><set label='2009-12-01T14:05:32' value='7.79' /><set label='2009-12-01T14:06:32' value='0.83' /><set label='2009-12-01T14:07:32' value='1.42' /><set label='2009-12-01T14:08:32' value='0.87' /><set label='2009-12-01T14:09:32' value='1.61' /><set label='2009-12-01T14:10:32' value='8.21' /><set label='2009-12-01T14:11:32' value='0.69' /><set label='2009-12-01T14:12:32' value='0.72' /><set label='2009-12-01T14:13:32' value='0.87' /><set label='2009-12-01T14:14:32' value='1.45' /><set label='2009-12-01T14:15:32' value='9.30' /><set label='2009-12-01T14:16:32' value='1.55' /><set label='2009-12-01T14:17:32' value='1.17' /><set label='2009-12-01T14:18:32' value='0.95' /><set label='2009-12-01T14:19:32' value='1.53' /><set label='2009-12-01T14:20:32' value='8.20' /><set label='2009-12-01T14:21:32' value='1.30' /><set label='2009-12-01T14:22:32' value='0.89' /><set label='2009-12-01T14:23:32' value='0.67' /><set label='2009-12-01T14:24:32' value='1.35' /><set label='2009-12-01T14:25:32' value='8.18' /><set label='2009-12-01T14:26:32' value='1.11' /><set label='2009-12-01T14:27:32' value='0.97' /><set label='2009-12-01T14:28:32' value='0.90' /><set label='2009-12-01T14:29:32' value='1.65' /><set label='2009-12-01T14:30:32' value='7.72' /><set label='2009-12-01T14:31:32' value='0.99' /><set label='2009-12-01T14:32:32' value='0.92' /><set label='2009-12-01T14:33:32' value='0.82' /><set label='2009-12-01T14:34:32' value='1.79' /><set label='2009-12-01T14:35:32' value='7.80' /><set label='2009-12-01T14:36:32' value='0.78' /><set label='2009-12-01T14:37:32' value='1.02' /><set label='2009-12-01T14:38:32' value='0.69' /><set label='2009-12-01T14:39:32' value='1.55' /><set label='2009-12-01T14:40:32' value='8.88' /><set label='2009-12-01T14:41:32' value='0.79' /><set label='2009-12-01T14:42:32' value='0.66' /><set label='2009-12-01T14:43:32' value='0.64' /><set label='2009-12-01T14:44:32' value='1.46' /><set label='2009-12-01T14:45:32' value='7.84' /><set label='2009-12-01T14:46:32' value='0.65' /><set label='2009-12-01T14:47:32' value='0.74' /><set label='2009-12-01T14:48:32' value='0.69' /><set label='2009-12-01T14:49:32' value='1.45' /><set label='2009-12-01T14:50:32' value='7.92' /><set label='2009-12-01T14:51:32' value='0.74' /><set label='2009-12-01T14:52:32' value='0.78' /><set label='2009-12-01T14:53:32' value='0.62' /><set label='2009-12-01T14:54:32' value='1.32' /><set label='2009-12-01T14:55:32' value='7.97' /><set label='2009-12-01T14:56:32' value='0.97' /><set label='2009-12-01T14:57:32' value='0.73' /><set label='2009-12-01T14:58:32' value='0.71' /><set label='2009-12-01T14:59:32' value='1.55' /><set label='2009-12-01T15:00:32' value='12.52' /><set label='2009-12-01T15:01:32' value='0.69' /><set label='2009-12-01T15:02:32' value='0.60' /><set label='2009-12-01T15:03:32' value='0.68' /><set label='2009-12-01T15:04:32' value='1.18' /><set label='2009-12-01T15:05:32' value='7.97' /><set label='2009-12-01T15:06:32' value='0.70' /><set label='2009-12-01T15:07:32' value='1.02' /><set label='2009-12-01T15:08:32' value='0.88' /><set label='2009-12-01T15:09:32' value='1.24' /><set label='2009-12-01T15:10:32' value='7.91' /><set label='2009-12-01T15:11:32' value='0.69' /><set label='2009-12-01T15:12:32' value='0.64' /><set label='2009-12-01T15:13:32' value='1.00' /><set label='2009-12-01T15:14:32' value='2.46' /><set label='2009-12-01T15:15:32' value='10.10' /><set label='2009-12-01T15:16:32' value='0.95' /><set label='2009-12-01T15:17:32' value='0.70' /><set label='2009-12-01T15:18:32' value='0.76' /><set label='2009-12-01T15:19:32' value='1.21' /><set label='2009-12-01T15:20:32' value='7.92' /><set label='2009-12-01T15:21:32' value='0.69' /><set label='2009-12-01T15:22:32' value='0.76' /><set label='2009-12-01T15:23:32' value='0.74' /><set label='2009-12-01T15:24:32' value='1.20' /><set label='2009-12-01T15:25:32' value='7.84' /><set label='2009-12-01T15:26:32' value='0.71' /><set label='2009-12-01T15:27:32' value='0.74' /><set label='2009-12-01T15:28:32' value='0.89' /><set label='2009-12-01T15:29:32' value='1.15' /><set label='2009-12-01T15:30:32' value='7.94' /><set label='2009-12-01T15:31:32' value='0.60' /><set label='2009-12-01T15:32:32' value='0.60' /><set label='2009-12-01T15:33:32' value='0.74' /><set label='2009-12-01T15:34:32' value='1.17' /><set label='2009-12-01T15:35:32' value='7.93' /><set label='2009-12-01T15:36:32' value='0.84' /><set label='2009-12-01T15:37:32' value='0.88' /><set label='2009-12-01T15:38:32' value='0.66' /><set label='2009-12-01T15:39:32' value='1.08' /><set label='2009-12-01T15:40:32' value='9.10' /><set label='2009-12-01T15:41:32' value='0.88' /><set label='2009-12-01T15:42:32' value='0.80' /><set label='2009-12-01T15:43:32' value='0.72' /><set label='2009-12-01T15:44:32' value='1.21' /><set label='2009-12-01T15:45:32' value='8.19' /><set label='2009-12-01T15:46:32' value='0.79' /><set label='2009-12-01T15:47:32' value='0.65' /><set label='2009-12-01T15:48:32' value='0.61' /><set label='2009-12-01T15:49:32' value='1.12' /><set label='2009-12-01T15:50:32' value='7.97' /><set label='2009-12-01T15:51:32' value='0.68' /><set label='2009-12-01T15:52:32' value='0.84' /><set label='2009-12-01T15:53:32' value='0.67' /><set label='2009-12-01T15:54:32' value='1.20' /><set label='2009-12-01T15:55:32' value='8.00' /><set label='2009-12-01T15:56:32' value='0.70' /><set label='2009-12-01T15:57:32' value='0.62' /><set label='2009-12-01T15:58:32' value='0.59' /><set label='2009-12-01T15:59:32' value='1.26' /><set label='2009-12-01T16:00:32' value='12.74' /><set label='2009-12-01T16:01:32' value='0.89' /><set label='2009-12-01T16:02:32' value='0.68' /><set label='2009-12-01T16:03:32' value='0.75' /><set label='2009-12-01T16:04:32' value='1.32' /><set label='2009-12-01T16:05:32' value='7.99' /><set label='2009-12-01T16:06:32' value='0.67' /><set label='2009-12-01T16:07:32' value='0.74' /><set label='2009-12-01T16:08:32' value='0.62' /><set label='2009-12-01T16:09:32' value='1.18' /><set label='2009-12-01T16:10:32' value='7.99' /><set label='2009-12-01T16:11:32' value='0.70' /><set label='2009-12-01T16:12:32' value='0.71' /><set label='2009-12-01T16:13:32' value='1.02' /><set label='2009-12-01T16:14:32' value='2.04' /><set label='2009-12-01T16:15:32' value='8.88' /><set label='2009-12-01T16:16:32' value='1.15' /><set label='2009-12-01T16:17:32' value='0.63' /><set label='2009-12-01T16:18:32' value='0.64' /><set label='2009-12-01T16:19:32' value='1.26' /><set label='2009-12-01T16:20:32' value='8.14' /><set label='2009-12-01T16:21:32' value='0.64' /><set label='2009-12-01T16:22:32' value='0.86' /><set label='2009-12-01T16:23:32' value='0.70' /><set label='2009-12-01T16:24:32' value='1.12' /><set label='2009-12-01T16:25:32' value='7.90' /><set label='2009-12-01T16:26:32' value='0.63' /><set label='2009-12-01T16:27:32' value='0.67' /><set label='2009-12-01T16:28:32' value='0.77' /><set label='2009-12-01T16:29:32' value='1.18' /><set label='2009-12-01T16:30:32' value='8.80' /><set label='2009-12-01T16:31:32' value='0.79' /><set label='2009-12-01T16:32:32' value='0.86' /><set label='2009-12-01T16:33:32' value='0.45' /><set label='2009-12-01T16:34:32' value='0.95' /><set label='2009-12-01T16:35:32' value='7.57' /><set label='2009-12-01T16:36:32' value='0.42' /><set label='2009-12-01T16:37:32' value='0.60' /><set label='2009-12-01T16:38:32' value='0.58' /><set label='2009-12-01T16:39:32' value='0.92' /><set label='2009-12-01T16:40:32' value='8.81' /><set label='2009-12-01T16:41:32' value='0.56' /><set label='2009-12-01T16:42:32' value='0.50' /><set label='2009-12-01T16:43:32' value='0.47' /><set label='2009-12-01T16:44:32' value='0.96' /><set label='2009-12-01T16:45:32' value='7.79' /><set label='2009-12-01T16:46:32' value='0.45' /><set label='2009-12-01T16:47:32' value='0.48' /><set label='2009-12-01T16:48:32' value='0.50' /><set label='2009-12-01T16:49:32' value='0.97' /><set label='2009-12-01T16:50:32' value='7.66' /><set label='2009-12-01T16:51:32' value='0.52' /><set label='2009-12-01T16:52:32' value='0.63' /><set label='2009-12-01T16:53:32' value='0.41' /><set label='2009-12-01T16:54:32' value='0.93' /><set label='2009-12-01T16:55:32' value='7.84' /><set label='2009-12-01T16:56:32' value='0.61' /><set label='2009-12-01T16:57:32' value='0.55' /><set label='2009-12-01T16:58:32' value='0.47' /><set label='2009-12-01T16:59:32' value='1.06' /><set label='2009-12-01T17:00:32' value='11.89' /><set label='2009-12-01T17:01:32' value='0.55' /><set label='2009-12-01T17:02:32' value='0.49' /><set label='2009-12-01T17:03:32' value='0.49' /><set label='2009-12-01T17:04:32' value='0.96' /><set label='2009-12-01T17:05:32' value='7.89' /><set label='2009-12-01T17:06:32' value='0.55' /><set label='2009-12-01T17:07:32' value='0.68' /><set label='2009-12-01T17:08:32' value='0.49' /><set label='2009-12-01T17:09:32' value='1.04' /><set label='2009-12-01T17:10:32' value='7.72' /><set label='2009-12-01T17:11:32' value='0.45' /><set label='2009-12-01T17:12:32' value='1.34' /><set label='2009-12-01T17:13:32' value='1.48' /><set label='2009-12-01T17:14:32' value='1.80' /><set label='2009-12-01T17:15:32' value='8.16' /><set label='2009-12-01T17:16:32' value='0.63' /><set label='2009-12-01T17:17:32' value='0.49' /><set label='2009-12-01T17:18:32' value='0.57' /><set label='2009-12-01T17:19:32' value='1.02' /><set label='2009-12-01T17:20:32' value='7.69' /><set label='2009-12-01T17:21:32' value='0.43' /><set label='2009-12-01T17:22:32' value='0.52' /><set label='2009-12-01T17:23:32' value='0.40' /><set label='2009-12-01T17:24:32' value='0.93' /><set label='2009-12-01T17:25:32' value='7.89' /><set label='2009-12-01T17:26:32' value='0.53' /><set label='2009-12-01T17:27:32' value='0.57' /><set label='2009-12-01T17:28:32' value='0.71' /><set label='2009-12-01T17:29:32' value='1.08' /></chart>");
chart_ByCategory.render("ByCategoryDiv");
</script>
<!-- END Script Block for Chart ByCategory -->

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

 

 

 

Could you please be a bit more specific on how you wish to format the date/time in y-axis?

 

 

 

Apologies for the inconvenience. :P

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