Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

failed to Create Chart

$
0
0

Hi

i have two files:

 

2. SalesData.html which contain current code:

 

<

<!DOCTYPE HTML>

<html>

  <head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.ui.commons,sap.makit"

  data-sap-ui-theme="sap_goldreflection">

  </script>

  <script src="https://sapui5.hana.ondemand.com/resources/sap/ui/model/json/JSONModel.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.ui.model.json"

  data-sap-ui-theme="sap_goldreflection">

  </script>

 

 

  <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->

 

 

  <script>

  sap.ui.localResources("bi_system");

  var view = sap.ui.view({id:"idSalesDataChart1", viewName:"bi_system.SalesDataChart", type:sap.ui.core.mvc.ViewType.JS});

  view.placeAt("content");

  </script>

 

 

  </head>

  <body class="sapUiBody" role="application">

  <div id="content"></div>

  </body>

</html>

 

 

 

2. SalesDataChart.view.js file which contain current code:

 

sap.ui.jsview("bi_system.SalesDataChart", {

 

 

  getControllerName : function() {

  return "bi_system.SalesDataChart";

  },

 

 

  createContent : function(oController) {

  var oChart = new sap.makit.Chart({

     height: "80%", width: "100%",

     category : new sap.makit.Category({ column : "yearCategory" }),

     series : new sap.makit.Series({ column : "productSeries" }),

     values : [new sap.makit.Value({ expression : "revenueValue", format : "currency" })]

  });

  var testData = {

     mycollection : [

         { year : 2008, product : "Prod 1", revenue : 900000 },

         { year : 2008, product : "Prod 2", revenue : 700000 },

         { year : 2009, product : "Prod 1", revenue : 100000 },

         { year : 2009, product : "Prod 2", revenue : 900000 },

         { year : 2010, product : "Prod 1", revenue : 110000 },

         { year : 2010, product : "Prod 2", revenue : 120000 }

     ]

  };

 

 

  var jsonModel = new sap.ui.model.json.JSONModel();

  jsonModel.setData(testData);

 

 

  oChart.addColumn(new sap.makit.Column({name:"yearCategory", value:"{year}"}));

  oChart.addColumn(new sap.makit.Column({name:"productSeries", value:"{product}"}));

  oChart.addColumn(new sap.makit.Column({name:"revenueValue", value:"{revenue}", type:"number"}));

  oChart.setModel(jsonModel);

  oChart.bindRows("/mycollection");

  return oChart;

  }

 

 

});

);

 

i tried to upload SalesData.html but i got empty results even though no errors appear in webpage:


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>