06-05-2011, 01:02 PM
hello all I have the db driver working and have managed to get the graphamatic xml right to get it to work, bellow is a screen shot of the output png from the xml also bellow. I am wondering if there is a better way to make the y axis float as it is scaling but due to minuete changes in the data doesn't realy have the desired affect.
![[Image: 2dayhotwater.png]](http://thecloud.homelinux.net/CQC/2dayhotwater.png)
and the XML:
<?xml version="1.0" encoding='UTF-8' standalone="no"?>
<!DOCTYPE GraphSpec SYSTEM "file://C:\Graphamatic_GraphSpec.dtd" >
<GraphSpec name="TempGraphs">
<Graph name="2 Day Hot Water Temps"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\2dayhotwater"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = 'Hot Water' or
Descriptor = 'Hot Water' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="Hot Water">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = 'Hot Water'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
<Graph name="2 Day Ground Floor Temp"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\Ground Floor"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = 'Ground Floor' or
Descriptor = 'Ground Floor' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="Ground Floor">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = 'Ground Floor'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
<Graph name="2 Day 1st Floor"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\2day1stfloor"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = '1st Floor' or
Descriptor = '1stFloor' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="1st Floor">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = '1st Floor'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
</GraphSpec>
Also is there a better way of doing this now as I have to set up a task schedule to run the graphamatic program every hour to get upto date results,
and the question on the DB Driver can the sql DB ever get to big and if so how would I incorporate a script into the DB to run to Flush the DB of old enteries Say once a month..
Cheers
Camper OUT
hock:
![[Image: 2dayhotwater.png]](http://thecloud.homelinux.net/CQC/2dayhotwater.png)
and the XML:
<?xml version="1.0" encoding='UTF-8' standalone="no"?>
<!DOCTYPE GraphSpec SYSTEM "file://C:\Graphamatic_GraphSpec.dtd" >
<GraphSpec name="TempGraphs">
<Graph name="2 Day Hot Water Temps"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\2dayhotwater"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = 'Hot Water' or
Descriptor = 'Hot Water' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="Hot Water">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = 'Hot Water'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
<Graph name="2 Day Ground Floor Temp"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\Ground Floor"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = 'Ground Floor' or
Descriptor = 'Ground Floor' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="Ground Floor">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = 'Ground Floor'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
<Graph name="2 Day 1st Floor"
filetype="PNG"
filename="C:\Program Files\CQC\CQCData\HTMLRoot\2day1stfloor"
height="350"
width ="750"
forecolor="000010" backcolor1="EEEEEE" backcolor2="CCCCCC"
xaxisname="Date"
yaxisname="Degrees" >
<Range xaxis="date" yaxis="float" >
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day], -1,
GETDATE()) AND
( Descriptor = '1st Floor' or
Descriptor = '1stFloor' )
ORDER BY TimeStamp
</Query>
</Range>
<DataSeries name="Hot Water" type="line" color="FF0000" xaxis="date" yaxis="int" ymin="0" ymax="100" label="1st Floor">
<Query dsn="CQCHeatingDB" user="sa" pw="">Select TimeStamp, Value
From DataLogValues Where TimeStamp >= DATEADD([day],-1,
GETDATE()) AND Descriptor = '1st Floor'
ORDER BY TimeStamp
</Query>
</DataSeries>
</Graph>
</GraphSpec>
Also is there a better way of doing this now as I have to set up a task schedule to run the graphamatic program every hour to get upto date results,
and the question on the DB Driver can the sql DB ever get to big and if so how would I incorporate a script into the DB to run to Flush the DB of old enteries Say once a month..
Cheers
Camper OUT
