Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating charts of oracle data

Status
Not open for further replies.

JtheRipper

IS-IT--Management
Oct 4, 2002
274
0
0
GB
Hi there,

I have data stored in an oracle database and want to create charts from it. I have sucessfully created one big chart containing all the data. The data consists of a capture_date which is of date type, and a numerical value field.

Now I want to split up the chart and create a chart for each day, but it must happen dynamically, i.e. a chart for today, tomorrow will be two seperate charts, but I will still be able to see today's chart, etc, etc. until the end of the month. Then a new page must be created containing only December's charts and so on.

Does anyone have an idea/advice on how to do this?
Thanks,
Jaco
 
Can you use the group function? order the data by the date and output the query using the group by date. This should give you an output of each date where you can display all information/create your graph. (maybe? ;-)


Erwin Oosterhoorn
Analyst Programmer,
ice hockey player/fan.
 
Hi,

I almost got it. I read all my data in an array and took it from there. I am using Chart FX (ugh!) because we have Coldfusion 5 and it does not have cfchart, to create my charts, but now I have another problem. I have approx 288 entries for every day for which I create a chart. The problem is that on my x-axis the ending point for the current chart is the starting point for the next chart and so on. It looks as if it not using all the available space in the chart, only a portion. I think I have so somehow reset the place from where it has to start drawing the new chart, but I am clueless.

Here is a piece of the code:
.
.
.
<cfoutput>
<cfloop index=&quot;x&quot; from=&quot;1&quot; to=&quot;#FromDay#&quot; step=&quot;1&quot;> <!-- loop from day1 until today -->

<!-----------MYNE----------------------->

<CFOBJECT ACTION=&quot;Create&quot; NAME=&quot;RespGraph&quot; CLASS=&quot;ChartFX.WebServer&quot;>
<CFSET RespGraph.OpenDataEx (COD_VALUES, 3, #ArrayLen(RespArray)#)>
<cfloop from=&quot;1&quot; index=&quot;i&quot; to=#ArrayLen(RespArray)#> <!-- loop through array -->
<cfif x eq numberFormat(dateFormat(RespArray[1], &quot;d&quot;)) and
MONTHSELECTED eq numberformat(dateFormat(RespArray[1], &quot;m&quot;))> <!-- if day in array is day x display on chart -->

<cfscript>
RespGraph.ThisSerie=0;
RespGraph.SetArrayProp(&quot;Value&quot;, #i#-1, #RespArray[2]#);
RespGraph.SetArrayProp(&quot;Legend&quot;, #i#-1, #timeFormat(RespArray[1], &quot;HH:mm:ss&quot;)#);
</cfscript>
</cfif> <!-- end if -->
</cfloop> <!-- end of loop through array -->
<cfset RespGraph.CloseData(COD_VALUES)>

<!-- Charting using ChartFX -->
<!-- WTF? -->
<CFSET RespGraph.UserAgent = #HTTP_USER_AGENT#>

<!-- General Settings 1183318017 109576193-->
<CFSET RespGraph.TypeMask = 109577217>

<CFSET RespGraph.Style = -143654919>

<!-- Axis Settings -->
<CFSET RespGraph.RGBBk = 16777228>
<cfset RespGraph.SetArrayProp ( &quot;Title&quot;, CHART_LEFTTIT , &quot;Response Time / execute&quot; )>
<cfset RespGraph.SetArrayProp ( &quot;Title&quot;, CHART_BOTTOMTIT , &quot;Interval - 5 minutes&quot; )>
<cfset RespGraph.SetArrayProp ( &quot;Title&quot;, CHART_TOPTIT , &quot;Response time per execute (#x# #DateFormat(MyDate,&quot;mmm&quot;)#)&quot;)>

<CFSET RespGraphAxis = RespGraph.Axis>
<CFSET RespGraphAxis0 = RespGraph.GetArrayProp(&quot;Item&quot;,1,RespGraphAxis)>
<CFSET RespGraphAxis0.Step = 200>
<CFSET RespGraphAxis0.Decimals = 6>

<!-- Insert horizontal grid lines -->
<CFSET RespGraphAxis0 = RespGraph.GetArrayProp(&quot;Item&quot;,0,RespGraphAxis)>
<CFSET RespGraphAxis0.TickMark = -32767>


<!-- Other settings -->
<CFSET RespGraph.Border = 11>


<!-- Color Settings -->
<CFSET RespGraph.OpenDataEx(2,16,0)>
<CFSET RespGraph.SetArrayProp(&quot;Color&quot;,0,16777230)>
<CFSET RespGraph.SetArrayProp(&quot;Color&quot;,1,16777259)>
<CFSET RespGraph.SetArrayProp(&quot;Color&quot;,2,16777260)>
<CFSET RespGraph.CloseData(2)>


<!-- Other Settings -->
<CFSET RespGraph.Border = 13>
<cfset RespGraph.ImgWidth = 500>
<cfset RespGraph.ImgHeight = 400>
<cfset RespGraph.MarkerSize=&quot;0&quot;>
<cfset RespGraphAxis0.TickMark=&quot;-32767&quot;>



#RespGraph.GetHtmlTag(1300,800,&quot;Auto&quot;,&quot;RespGraph&quot;)#


<!---------MYNE END--------------------->



</cfloop> <!-- end of loop from day 1 until today -->
</cfoutput>


</cfif>
.
.
.

Any ideas/suggestions?

Thanks,
Jaco
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top