on 11-18-2014 7:48 AM
var oModel = new sap.ui.model.json.JSONModel({
riskData : [
{category: "Category 01", severity: 9, cVulnerable: 15, cPotVulnerable: 32, cSafe: 5, cTotal: 52},
{category: "Category 02", severity: 8, cVulnerable: 12, cPotVulnerable: 15, cSafe: 2, cTotal: 29},
{category: "Category 03", severity: 5, cVulnerable: 32, cPotVulnerable: 32, cSafe: 1, cTotal: 65},
{category: "Category 04", severity: 6, cVulnerable: 26, cPotVulnerable: 31, cSafe: 5, cTotal: 62},
{category: "Category 05", severity: 3, cVulnerable: 13, cPotVulnerable: 15, cSafe: 6, cTotal: 34},
{category: "Category 06", severity: 2, cVulnerable: 9, cPotVulnerable: 15, cSafe: 1, cTotal: 25},
{category: "Category 07", severity: 7, cVulnerable: 5, cPotVulnerable: 18, cSafe: 0, cTotal:23}
]
});
//set up dataset
var PieChartData = new sap.viz.ui5.data.FlattenedDataset("dataForPie",{
dimensions : [{
axis : 1,
name : 'Category',
value : "{category}"
}],
measures: [{
group: 1,
name : 'cTotal',
value : '{cTotal}'
},
{
group: 2,
name : 'cSafe',
value : '{cSafe}'
}],
data :{
path : "/riskData"
}
});
//set up chart
var PieChart = new sap.viz.ui5.Pie({
id : "pie",
width : "80%",
height : "400px"
});
PieChartData.setModel(oModel);
PieChart.setDataset(PieChartData);
return new sap.m.Page({
title: "Pie Chart View",
content: [PieChart]
});
2014-11-18 09:43:11 Device API logging initialized - DEVICE sap-ui-core.js:44
2014-11-18 09:43:11 registerResourcePath ('', 'https://openui5.hana.ondemand.com/resources/') - sap.ui.ModuleSystem sap-ui-core.js:80
2014-11-18 09:43:11 URL prefixes set to: - sap.ui.ModuleSystem sap-ui-core.js:80
2014-11-18 09:43:11 (default) : https://openui5.hana.ondemand.com/resources/ - sap.ui.ModuleSystem sap-ui-core.js:80
Failed to load resource: the server responded with a status of 404 (Not Found) https://openui5.hana.ondemand.com/resources/sap/viz/library-preload.json
XMLHttpRequest cannot load https://openui5.hana.ondemand.com/resources/sap/viz/library-preload.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404. index.html:1
2014-11-18 09:43:12 failed to preload 'sap.viz.library-preload': NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/viz/library-preload.json'. - sap.ui.ModuleSystem sap-ui-core.js:80
Failed to load resource: the server responded with a status of 404 (Not Found) https://openui5.hana.ondemand.com/resources/sap/viz/ui5/library-preload.json
XMLHttpRequest cannot load https://openui5.hana.ondemand.com/resources/sap/viz/ui5/library-preload.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404. index.html:1
2014-11-18 09:43:12 failed to preload 'sap.viz.ui5.library-preload': NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/viz/ui5/library-preload.json'. - sap.ui.ModuleSystem sap-ui-core.js:80
Failed to load resource: the server responded with a status of 404 (Not Found) https://openui5.hana.ondemand.com/resources/sap/viz/library.js
XMLHttpRequest cannot load https://openui5.hana.ondemand.com/resources/sap/viz/library.js. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404. index.html:1
Uncaught Error: failed to load 'sap/viz/library.js' from https://openui5.hana.ondemand.com/resources/sap/viz/library.js: 0 - NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/viz/library.js'. sap-ui-core.js:149
2014-11-18 09:43:12 registerResourcePath ('views', './views/') - sap.ui.ModuleSystem sap-ui-core.js:80
Uncaught TypeError: Cannot read property 'ui5' of undefined sap-ui-core.js:147
Failed to load resource: net::ERR_CACHE_MISS http://localhost/DSPresentation/index.html
I have spent 3 days on this and I cant find any useful suggestions in the forums.
fyi, it's never gonna work for you ! You're using openui5 & you know what, the chart libraries aren't part of openui5. They are only available with sapui5. Try bootstrapping with sapui5,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sakthivel, I ran into same issue which is trying to refer sap.viz from downloaded run time openui5 framework .
Now i realised those two are different and to refer sapui5 ,we need to use src as
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js">
in the boot strap .
(Luckily i stumbled across this thread )
My question is just like i am refering opeui5 libraries from local server. Can i also download sapui5 framework and refer that in the bootstrap for my program ?
like
src="../openui5-sdk/resources/sap-ui-core.js"
The reason i am asking , i am wondering there would some difference on performance on referring resources which are local to server vs remote location (https://sapui5.hana.ondemand.com)
Please advise .
Thanks
Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got it to work:
import sap.viz at your index.html:
data-sap-ui-libs="sap.m, sap.viz"
Then you don't need this: jQuery.sap.require("sap.viz.ui5.data");
But if you want to use the sap. require, do it like that:
jQuery.sap.require("sap.viz.ui5.data.FlattenedDataset");
I hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.