<nz-tab *ngFor="let item of tabs index as i" nzTitle="{{item.title}}" (nzSelect)="selectTab(item.index)">
<div echarts [options]="options[item.index-1]" [loading]="showloading" class="chart"></div>
</nz-tab>
export class TaskList {
// 任務(wù)列表
public taskList: any[] = [];
// 用戶權(quán)限 1 維修部 ;2 商務(wù)部;3 總經(jīng)理
private userRole: number = 1;
private options: any[] ;
// private options: any;
private time: any = 1;
private tabIndex: any = 1;
private tabs: any[] = [{ title: '房間出租量', index: 1 }, { title: '停車位出租量', index: 2 }, { title: '廣告位出租量', index: 3 }];
constructor (private taskListService: TaskListService) {
this.taskList = taskListService.getTaskList();
this.options = [this.taskListService.getRentalsOption(1, this.time), this.taskListService.getRentalsOption(2, this.time), this.taskListService.getRentalsOption(3, this.time)];
}
public ngOnInit () {
}
// 選擇時間id 1 本日;2 本周;3 本月;4本年
public resetTime (time: any): void {
this.time = time;
this.resetOptions(this.tabIndex, this.time);
}
// 選擇時間區(qū)間
public resetTimeRegion (result: Date): void {
console.log('onChange: ', result);
}
// 切換tab
public selectTab (tabIndex: number): void {
this.tabIndex = tabIndex;
this.resetOptions(this.tabIndex, this.time);
}
// 重置charts options
public resetOptions (tabIndex: number, time: any): void {
this.options[(tabIndex - 1)] = this.taskListService.getRentalsOption(tabIndex, time);
console.log(JSON.stringify(this.options[(this.tabIndex - 1)]));
}
}
public option: any = {
color: ['#3ba1ff'],
tooltip : {
trigger: 'axis',
axisPointer : { // 坐標(biāo)軸指示器,坐標(biāo)軸觸發(fā)有效
type : 'shadow', // 默認(rèn)為直線,可選為:'line' | 'shadow'
},
},
grid: {
left: '3%',
right: '3%',
bottom: '3%',
// containLabel: true,
},
xAxis : [
{
type : 'category',
data : [],
axisTick: {
alignWithLabel: true,
},
},
],
yAxis : [
{
type : 'value',
},
],
series : [
{
name: '直接訪問',
type: 'bar',
barWidth: '60%',
data: [],
},
],
public getRentalsOption (tabIndex: number, time: any) {
// 1 本日;2 本周;3 本月;4 本年 ;其他 時間區(qū)間
if (typeof (time) != 'number') {
this.option.xAxis[0].data = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
this.option.series[0].data = [20, 20, 20, 334, 390, 330, 220];
}
if (time == 1 ) {
this.option.xAxis[0].data = ['0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'];
this.option.series[0].data = [10, 52, 200, 334, 390, 330, 220, 10, 52, 200, 334, 390, 330, 220, 10, 52, 200, 334, 390, 330, 220, 10, 52, 200];
}
if (time == 2) {
this.option.xAxis[0].data = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
this.option.series[0].data = [20, 20, 20, 334, 390, 330, 220];
}
if (time == 3) {
const len = this.commonMethod.mGetDate();
const xAxis: string[] = [];
for (let i = 0; i < len; i++) {
xAxis.push((i + 1).toString());
}
this.option.xAxis[0].data = xAxis;
this.option.series[0].data = [10, 52, 200, 334, 390, 10, 52, 200, 334, 390, 10, 52, 200, 334, 390, 10, 52, 200, 334, 390, 10, 52, 200, 334, 390, 10, 52, 200, 334, 390];
}
if (time == 4) {
this.option.xAxis[0].data = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
this.option.series[0].data = [10, 52, 200, 334, 390, 330, 220, 200, 334, 390, 330, 220];
}
return this.option;
}
切換時間的選擇數(shù)據(jù)option變化 但是圖表沒有重新繪制
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。