fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.0 KiB

8 years ago
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.tab",
ref: function () {
self.tab = this;
},
single: true,
cardCreator: function (v) {
return {
type: v
7 years ago
};
8 years ago
}
};
},
mounted: function () {
var self = this;
var items = [[{
7 years ago
data: [
{x: "孙林", y: 789},
{x: "金士鹏", y: 156},
{x: "张珊", y: 289},
{x: "孙阳", y: 562},
{x: "袁成洁", y: 546},
{x: "张颖", y: 218},
{x: "王伟", y: 541},
{x: "张武", y: 219},
{x: "韩文", y: 345}
8 years ago
],
7 years ago
name: "测试1",
8 years ago
stack: 1
}, {
7 years ago
data: [
{x: "孙林", y: 789},
{x: "金士鹏", y: 156},
{x: "张珊", y: 289},
{x: "孙阳", y: 562},
{x: "袁成洁", y: 546},
{x: "张颖", y: 218},
{x: "王伟", y: 541},
{x: "张武", y: 219},
{x: "韩文", y: 345}
8 years ago
],
7 years ago
name: "测试2",
8 years ago
stack: 1
}]];
var types = ["bi.axis_chart", "bi.line_chart", "bi.bar_chart"];
var index = 0;
this.tab.setSelect(types[index]);
this.tab.populate(BI.deepClone(items));
this.interval = setInterval(function () {
index++;
if (index >= types.length) {
index = 0;
}
self.tab.setSelect(types[index]);
self.tab.populate(BI.deepClone(items));
7 years ago
}, 2000);
8 years ago
},
destroyed: function () {
clearInterval(this.interval);
}
});
BI.shortcut("demo.axis_chart", Demo.Func);