I'm creating a SAPUI5 prototype version of a system that currently exists in Silverlight.
Within the current Silverlight application we have a page which contains a Data Table, a bar chart and a Treemap which all display different representations of the same data.
In SAPUI5, I've replicated the Data Table and Bar Chart successfully, but I cannot get the Treemap to display, all I get is the Uncaught Type Error: Undefined is not a function error on the line where I try to create the Treemap.
var oModel = new sap.ui.model.odata.ODataModel(
"../../../services/PCPVCarlineModelYear.xsodata/",
false);
var treemapDataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [ {
axis : 1, // must be 1 for x-axis. 2 for y-axis
name : 'Carline',
value : "{Carline}"
}],
measures : [ {
group : 1,
name : 'NumberOfVINs',
value : '{NumberOfVINs}'
}],
data : {
path : "/PCPVCarlineModelYear"
}
});
var oTreemap = new sap.viz.ui5.types.Treemap({
dataset : treemapDataset
});
oTreemap.setModel(oModel);
return oTreemap;
The Undefined is not a function error occurs on the var oTreemap = new sap.viz.ui5.Treemap({
line.
If I change the code from Treemap
to Bar
, then it displays a Bar chart correctly, just not the Treemap.
Also, with the index.html
page, I have the following script block declared in order to load the correct libraries:
<script src="/sap/ui5/1/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui- libs="sap.ui.commons,sap.ui.table,sap.viz,sap.viz.ui5"
data-sap-ui-theme="sap_hcb"
data-sap-ui-modules="sap.ui.core.plugin.DeclarativeSupport">
</script>
Can anyone suggest what I may be doing wrong?
Thanks very much,
Martyn.