<html>
<head>
<meta name="description" content="OpenUI5 BIN Starting template" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<script id='sap-ui-bootstrap' type='text/javascript'
src='https://sapui5.hana.ondemand.com/resources/sap-ui-core.js'
data-sap-ui-theme='sap_bluecrystal'
data-sap-ui-libs='sap.ui.commons, sap.ui.core, sap.viz, sap.ui.table, sap.ui.ux3,sap.ui.unified'></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/regression/1.3.0/regression.min.js"></script>
<script>
var oData =
[ {
"Z": "A",
"X": 171.9,
"Y": 183,
"Line": 176.7
},
{
"Z": "B",
"X" : 144.3,
"Y": 158.6,
"Line": 163.3
},
{
"Z": "C",
"X": 160,
"Y": 165,
"Line": 166.8
},
{
"Z": "D",
"X": 201,
"Y": 167,
"Line": 167.9
},
{
"Z": "E",
"X" : 175.3,
"Y": 178.2,
"Line": 174.1
},
{
"Z": "F",
"X": 160,
"Y": 147,
"Line": 156.86
},
{
"Z": "G",
"X": 175.9,
"Y": 185.2,
"Line": 177.9
},
{
"Z": "H",
"X" : 165.3,
"Y": 158.2,
"Line": 163.0
},
{
"Z": "I",
"X": 160,
"Y": 165,
"Line": 166.8
},
{
"Z": "J",
"X": 173,
"Y": 177,
"Line": 173.4
}
];
var regressionData = [];
for (var i = 0; i < 10; i++) {
regressionData[i] = [oData[i].Current, oData[i].Hist];
};
var linearRegression = regression('linear', regressionData);
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData({
Data : oData
});
var dataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions : [ {
axis : 1,
name : 'Z name',
value : "{Z}"
} ],
measures : [ {
group : 1,
name : 'X name',
value : '{X}'
}, {
group : 2,
name : 'Y name',
value : '{Y}'
}],
data : {
path : "/Data",
}
});
var oScatter = new sap.viz.ui5.controls.VizFrame();
oScatter.setVizType('scatter');
oScatter.setDataset(dataset);
oScatter.setVizProperties({
plotArea: {
referenceLine: {
line : {
valueAxis : [{
value : 25,
visible : true,
color : "#000000",
size : 1,
type : "dotted",
label : {
text : "reference line",
visible : true,
style : {
fontSize : "20px",
fontFamily : "sans-serif",
}
}
}]
}
}
},
title: {
visible: false
},
});
var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid': "valueAxis",
'type': "Measure",
'values': ["X name"]
}),
feedValueAxis2 = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid': "valueAxis2",
'type': "Measure",
'values': ["Y name"]
}),
feedColor = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid': "color",
'type': "Dimension",
'values': ["Z name"],
});
oScatter.addFeed(feedValueAxis);
oScatter.addFeed(feedValueAxis2);
oScatter.addFeed(feedColor);
oScatter.setModel(oModel);
oScatter.placeAt("uiArea");
</script>
</head>
<body class="sapUiBody">
<div id="uiArea"></div>
</body>
</html>
Output
300px
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |