代码拉取完成,页面将自动刷新
代码如下,我自定义了一个图表是选择的自定义,数据源选择一个单行的数据源,当我通过以下代码使用 dg-chart-renderer后,render方法会被调用但是,update获取数据的方法不被调用
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="res/style.css">
<title>国内销售周报大屏</title>
<!-- 模板样例CSS,导入后可删除 -->
<style type="text/css">
body::after{
content: "芥舟科技";
position: absolute;
left: 0.1rem;
top: 0.1rem;
}
.chart::after{
position: absolute;
top: 50%;
left: 50%;
margin-top: -1rem;
margin-left: -1rem;
opacity: 0.8;
}
</style>
<script id="commentTemplate" type="text/html">
<li>
</li>
</script>
<script>
var myChartRenderer=
{
render: function(chart)
{
debugger
var chartDataSet = chart.chartDataSets[0];
var dataSet = chartDataSet.dataSet;
//图表标题
var title = chart.nameNonNull();
var options = {
series: [
{
type: 'scatter',
data: [[0, 0]],
symbolSize: 1,
label: {
normal: {
show: true,
formatter: [
'The whole box is a {term|Text Block}, with',
'red border and grey background.',
'{fragment1|A Text Fragment} {fragment2|Another Text Fragment}',
'Text fragments can be customized.'
].join('\n'),
backgroundColor: '#eee',
// borderColor: '#333',
borderColor: 'rgb(199,86,83)',
borderWidth: 2,
borderRadius: 5,
padding: 10,
color: '#000',
fontSize: 14,
shadowBlur: 3,
shadowColor: '#888',
shadowOffsetX: 0,
shadowOffsetY: 3,
lineHeight: 30,
rich: {
term: {
fontSize: 18,
color: 'rgb(199,86,83)'
},
fragment1: {
backgroundColor: '#000',
color: 'yellow',
padding: 5
},
fragment2: {
backgroundColor: '#339911',
color: '#fff',
borderRadius: 15,
padding: 5
}
}
}
}
}
],
xAxis: {
axisLabel: { show: false },
axisLine: { show: false },
splitLine: { show: false },
axisTick: { show: false },
min: -1,
max: 1
},
yAxis: {
axisLabel: { show: false },
axisLine: { show: false },
splitLine: { show: false },
axisTick: { show: false },
min: -1,
max: 1
}
};
//初始化ECharts
chart.echartsInit(options);
},
update: function(chart, results)
{
alert('不调用,不知道为什么')
debugger
}
};
</script>
</head>
<body class="fill-parent"
dg-chart-options="{title:{show:false},legend:{top:0},grid:{top:25}}"
dg-chart-auto-resize="true"
dg-chart-theme="{color:'#F0F0F0',backgroundColor:'transparent',actualBackgroundColor:'#072e7d'}">
<div class="head">
<div class="title">国内销售周报大屏</div>
</div>
<div class="content">
<div class="layout layout-left-top">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-left-center">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-left-bottom">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-center-top">
<div class="panel">
<div class="title main">销售趋势</div>
<div class="chart" dg-chart-widget="b65288b6217fdeee5723" dg-chart-renderer="myChartRenderer"></div>
</div>
</div>
<div class="layout layout-center-bottom">
<div class="panel">
<div class="title main">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-right-top">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-right-center">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
<div class="layout layout-right-bottom">
<div class="panel">
<div class="title">标题</div>
<div class="chart" dg-chart-widget=""></div>
</div>
</div>
</div>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论