Hello, I started a post when I tried to display a line graph on a dashboard: This did not work very well. I switched gears and now I have a Zen Page that includes a Zen Report in iFrame. However my line chart does not display a line. This is my Report class: /// AETMON.Report
Class AETMON.Report Extends %ZEN.Report.reportPage
{

/// Class name of application this report belongs to.
Parameter APPLICATION;

/// Specifies the default display mode used for this report if
/// the URL parameter, $MODE, is not present.
Parameter DEFAULTMODE As STRING [ Constraint = ",html,tohtml,toxslfo,pdf,xml,xslfo,excel,toexcel,ps,pdfprint,xlsx,tiff,displayxlsx,fo2pdf,foandpdf", Flags = ENUM ] = "html";

/// This is the optional XML namespace used for the report.
Parameter REPORTXMLNAMESPACE;

Property Availability As %ZEN.Datatype.list(DELIMITER = ",");

Property AvaiDateTime As %ZEN.Datatype.list(DELIMITER = ",");

Property CreatedDate As %ZEN.Datatype.string(ZENURL = "CreatedDate");

/// This XML defines the logical contents of this report.
XData ReportDefinition [ XMLNamespace = "http://www.intersystems.com/zen/report/definition" ]
{
<report xmlns="http://www.intersystems.com/zen/report/definition"
 name="Report" 
 sql="SELECT ID, CreatedDate, CreatedTime, availabilityStatus FROM AETMON.AvailabilityLog WHERE CREATEDDATE=ORDER BY CreatedDate, CreatedTime">
<parameter expression='..CreatedDate'/>
<group name="CreatedDate" breakOnField="CreatedDate">
<attribute name="Date" field="CreatedDate" />
<group name="record">
<attribute name="id" field="ID" />
<attribute name="Time" field="CreatedTime" />
<attribute name="Status" field="availabilityStatus" />
</group>
<aggregate name="Count" type="SUM" field="availabilityStatus" />
</group>
</report>
}

/// This XML defines the display for this report.
/// This is used to generate the XSLT stylesheets for both HTML and XSL-FO.
XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
{
<report xmlns="http://www.intersystems.com/zen/report/display"
 name="Report" title="AET Availability Report">

<init ></init>

<document width="8.5in" height="11in" marginLeft="1.25in" marginRight="1.25in" marginTop="1.0in" marginBottom="1.0in" ></document>

<pageheader ></pageheader>

<pagefooter ></pagefooter>

<body>
<class="banner1">AET Availability Report</p>
<clineChart
ongetData="getchartdata"
title="Availability"
height="400px" width="400px"
currYAxis="0"
labelsVisible="true"
lineStyle="red"
markersVisible="true"
plotStyle="stroke-width: 1px;"
seriesCount="1"
seriesNames="Name1,Name2"
seriesSize="2"
seriesYAxes="0"
ongetLabelX="getAxisTime"
ongetLabelY="getAxisY"
>
<yAxis minValue="0" maxValue="1" />
</clineChart>
<group name="CreatedDate" line="1px">
<table orient="row" width="6in">
<item field="@Date" width="2in">
<caption value="Date:" width="2in"/>
</item>
<group name="record" line="1px">
<table orient="row" width="6in">
<item field="@Time" width="2in">
<caption value="Time:" width="2in"/>
</item>
<item field="@Status" >
<caption value="Status:"/>
</item>
</table>
</group>
</table>
</group>
</body>
</report>
}

Method getAxisTime(
val,
yseries)
{
Do ##class(AETMON.Utility).DebugAETMON("AETMON.Report getAxisTime(val = "_val_")")
Set tTime = $Piece(..AvaiDateTime,",",(val+1))
Quit $ZTime(tTime)
}

Method getAxisY(
var1,
var2,
var3)
{
Do ##class(AETMON.Utility).DebugAETMON("AETMON.Report getAxisY()")
Do ##class(AETMON.Utility).DebugAETMON("getAxisY var1 = "_var1)
Do ##class(AETMON.Utility).DebugAETMON("getAxisY var2 = "_var2)
Do ##class(AETMON.Utility).DebugAETMON("getAxisY var3 = "_var3)
If (var1 = 1) Quit "1"
If (var1 = 0) Quit "0"
Quit " "
}

Method getchartdata(
ByRef var,
chart)
{
Do ##class(AETMON.Utility).DebugAETMON("AETMON.Report getchartdata")
Try {
Set sc = $System.Status.OK()
Set tTestDate = "08/06/2019"
Set pFrom = $ZDateH(tTestDate)
Set pTo = $ZDateH(tTestDate)
// Get a resultset containing Availability data
Set sc = ##class(AETMON.AvailabilityLog).GetAvailability(pFrom,pTo,.rs)
Quit:$System.Status.IsError(sc)
Set tCount = 0
While (rs.%Next()) {
Do ##class(AETMON.Utility).DebugAETMON("AETMON.Report getchartdata tCount = "_tCount)
Set var(tCount,0) = rs.%Get("availabilityStatus")
Set var(tCount,1) = rs.%Get("CreatedTime")
If $Increment(tCount)
}
}
Catch(ex) {
Set sc = ex.AsStatus()
}
Set tCreatedTimes = var(0,1) _ "," _ var(1,1)
Do ##class(AETMON.Utility).DebugAETMON("AETMON.Report getchartdata ..AvaiDateTime = "_tCreatedTimes)
Set ..AvaiDateTime = tCreatedTimes
Quit sc
}

}
 </p>

Can anybody tell me what I am missing or what I do wrong?

Thanks,

Oliver

 

 

</body></html>