Hi,
I am trying to draw a i5Chart in MII, using a TagQuery referring to http://scn.sap.com/thread/390743
Here is my code:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>{Title}</TITLE>
<META http-equiv="X-UA-Compatible" content="IE=edge">
<META http-equiv='cache-control' content='no-cache'>
<META http-equiv='expires' content='0'>
<META http-equiv='pragma' content='no-cache'>
<LINK href="/XMII/CM/SarlaMIICoreV1.0/000_Common/30_CSS/Content.css" rel="stylesheet" type="text/css"/>
<SCRIPT language="javascript" src="/XMII/CM/SarlaMIICoreV1.0/000_Common/20_JSFiles/UtilityFunctions.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-libs="i5Chart,i5Grid"> </SCRIPT>
<SCRIPT language="javascript" type="text/javascript">
function bodyLoad()
{
var chartobj = new com.sap.xmii.chart.hchart.i5Chart("TestProject/010_Configuration/20_DisplayTemplates/TagHistoricalTrendUI5","TestProject/010_Configuration/10_QueryTemplates/GetHistoricalTagValue");
chartobj.getQueryObject().setTagName(1,document.getElementById("hidTagName").value);
chartobj.getQueryObject().setDuration(60);
chartobj.getQueryObject().setDurationUnits("S");
chartobj.getQueryObject().setRowCount(20);
chartobj.setPropertyValue("ValueColumns", document.getElementById("hidTagName").value);
chartobj.setPropertyValue("LabelColumns", "DateTime");
chartobj.draw("myDiv1");
chartobj.update(true);
}
function PopupHide() {
top.document.getElementById("ScreenDisabler").style.display = 'none';
top.document.getElementById("AlertPopupShell").style.visibility = 'hidden';
return null;
}
</SCRIPT>
</HEAD>
<input id="hidTagName" type="hidden" value="{TagName}"/>
<BODY height="100%" onload = "bodyLoad();">
<DIV id="Main" class="PopupFrameOut" style="width: 100%; height: 100%">
<!-- === Content ============================================================= -->
<TABLE class="PopupFrameIn" cellpadding="0" cellspacing="0" width="100%" height="100%" >
<TR>
<TD width="99%" class="PopupTitleBar">
<SPAN class="PopupTitle" align="left">{Title}</SPAN>
</TD>
<TD width="1%" class="PopupTitleBar" align="right">
<A href="javascript: PopupHide();" class="boldbuttons" align="right"><SPAN>X</SPAN></A>
</TD>
</TR>
<!-- === Message Area ==============================================================-->
<TR>
<TD class="ContentHeaderSection" colspan="2">
<div id="myDiv1"></div>
</TD>
</TR>
</TABLE>
</DIV>
</BODY>
</HTML>
Here is the list of issues I have come across:
- When I am passing RowCount as 0 from Tag Query and modifying at runtime by javascript "chartobj.getQueryObject().setRowCount(20);", in chart it is plotting exactly 20 data points but in the DATA -> Export Raw Data as HTML, it exports only one row.
I am facing issue with updating the chart object after making some changes in it. Tried to refresh also but same result.