ngx-admin/src/app/pages/charts/echarts/echarts-radar.component.ts

70 lines
1.9 KiB
TypeScript
Raw Normal View History

import { Component } from '@angular/core';
import { NgaThemeService } from '@akveo/nga-theme';
@Component({
selector: 'ngx-echarts-radar',
2017-07-27 12:06:50 +03:00
template: `
<div echarts [options]="options" class="echart"></div>
`,
})
export class EchartsRadarComponent {
options: any;
constructor(private theme: NgaThemeService) {
this.theme.getJsTheme().subscribe(config => {
this.options = {
backgroundColor: config.echartsBackgroundColor,
color: [config.echartsRadarColor1, config.echartsRadarColor2],
tooltip: {},
legend: {
data: ['Allocated Budget', 'Actual Spending'],
textStyle: {
color: config.echartsRadarLegendTextColor,
},
},
radar: {
name: {
textStyle: {
color: config.echartsRadarNameTextColor,
},
},
indicator: [
{ name: 'Sales', max: 6500 },
{ name: 'Administration', max: 16000 },
{ name: 'Information Techology', max: 30000 },
{ name: 'Customer Support', max: 38000 },
{ name: 'Development', max: 52000 },
{ name: 'Marketing', max: 25000 },
],
// axisLine: {
// lineStyle: {
// color: 'white',
// },
// },
splitArea: {
areaStyle: {
color: config.echartsRadarSplitAreaStyleColor,
},
2017-07-27 12:06:50 +03:00
},
},
series: [
2017-07-27 12:06:50 +03:00
{
name: 'Budget vs Spending',
type: 'radar',
data: [
{
value: [4300, 10000, 28000, 35000, 50000, 19000],
name: 'Allocated Budget',
},
{
value: [5000, 14000, 28000, 31000, 42000, 21000],
name: 'Actual Spending',
},
],
2017-07-27 12:06:50 +03:00
},
],
};
});
}
}