{
"eula": "",
"vendor": "SAP",
"license": "",
"id": "com.sap.sac.sample.echarts.prepared",
"version": "1.0.0",
"name": "ECharts Prepared",
"newInstancePrefix": "EChartPrepared",
"description": "A sample custom widget wrapped EChart Prepared",
"webcomponents": [
{
"kind": "main",
"tag": "com-sap-sample-echarts-prepared",
"url": "http://localhost:3000/echarts/prepared/main.js",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"width": {
"type": "integer",
"default": 600
},
"height": {
"type": "integer",
"default": 420
}
},
"methods": {
},
"events": {
}
}var getScriptPromisify = (src) => {
return new Promise(resolve => {
$.getScript(src, resolve)
})
}
(function () {
const prepared = document.createElement('template')
prepared.innerHTML = `
<style>
</style>
<div id="root" style="width: 100%; height: 100%;">
</div>
`
class SamplePrepared extends HTMLElement {
constructor () {
super()
this._shadowRoot = this.attachShadow({ mode: 'open' })
this._shadowRoot.appendChild(prepared.content.cloneNode(true))
this._root = this._shadowRoot.getElementById('root')
this._props = {}
this.render()
}
onCustomWidgetResize (width, height) {
this.render()
}
async render () {
await getScriptPromisify('https://cdn.bootcdn.net/ajax/libs/echarts/5.0.0/echarts.min.js')
const chart = echarts.init(this._root)
const option = {
// https://echarts.apache.org/examples/zh/index.html
}
chart.setOption(option)
}
}
customElements.define('com-sap-sample-echarts-prepared', SamplePrepared)
})()var resultSet = Table_1.getDataSource().getResultSet();
EChartLifeExpectancy2_1.render(resultSet);{
"eula": "",
"vendor": "SAP",
"license": "",
"id": "com.sap.sac.sample.echarts.life_expectancy2",
"version": "1.0.0",
"name": "ECharts LifeExpectancy2",
"newInstancePrefix": "EChartLifeExpectancy2",
"description": "A sample custom widget wrapped EChart LifeExpectancy",
"webcomponents": [
{
"kind": "main",
"tag": "com-sap-sample-echarts-life_expectancy2",
"url": "http://localhost:3000/echarts/life_expectancy2/main.js",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"width": {
"type": "integer",
"default": 600
},
"height": {
"type": "integer",
"default": 420
}
},
"methods": {
"render": {
"description": "Render",
"parameters": [
{
"name": "resultSet",
"type": "any",
"description": "The json"
}
]
}
},
"events": {
}
}
myChart.setOption(option)You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 48 | |
| 48 | |
| 37 | |
| 34 | |
| 29 | |
| 23 | |
| 22 | |
| 22 | |
| 21 | |
| 21 |