barsa-echarts 1.0.456 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/barsa-echarts.mjs +4 -4
- package/{esm2020 → esm2022}/lib/barsa-echarts.module.mjs +81 -81
- package/esm2022/lib/base/chart-base.directive.mjs +75 -0
- package/esm2022/lib/base/chart-line-time-base.directive.mjs +80 -0
- package/{esm2020 → esm2022}/lib/base/index.mjs +7 -7
- package/{esm2020 → esm2022}/lib/base/micro-chart-area-base.directive.mjs +89 -89
- package/esm2022/lib/base/micro-chart-bar-base.directive.mjs +48 -0
- package/{esm2020 → esm2022}/lib/base/micro-chart-base.directive.mjs +49 -49
- package/{esm2020 → esm2022}/lib/base/micro-chart-circular-base.directive.mjs +75 -75
- package/esm2022/lib/base/micro-chart-comparison-base.directive.mjs +99 -0
- package/{esm2020 → esm2022}/lib/base/micro-chart-line-base.directive.mjs +60 -60
- package/{esm2020 → esm2022}/lib/base/micro-chart-stackbar-base.directive.mjs +51 -51
- package/esm2022/lib/micro-charts/micro-chart-area/micro-chart-area.component.mjs +34 -0
- package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-bar/micro-chart-bar.component.mjs +25 -25
- package/esm2022/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.mjs +86 -0
- package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-circular/micro-chart-circular.component.mjs +21 -21
- package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-comparison/micro-chart-comparison.component.mjs +22 -22
- package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-line/micro-chart-line.component.mjs +31 -31
- package/{esm2020 → esm2022}/lib/micro-charts/micro-chart-stackbar/micro-chart-stackbar.component.mjs +20 -20
- package/{esm2020 → esm2022}/lib/models/area-chart.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/bar-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/comparison-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/models/line-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/models/stackbar-item.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +14 -14
- package/{fesm2020 → fesm2022}/barsa-echarts.mjs +838 -838
- package/fesm2022/barsa-echarts.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/barsa-echarts.module.d.ts +22 -22
- package/lib/base/chart-base.directive.d.ts +28 -28
- package/lib/base/chart-line-time-base.directive.d.ts +19 -19
- package/lib/base/index.d.ts +7 -7
- package/lib/base/micro-chart-area-base.directive.d.ts +18 -18
- package/lib/base/micro-chart-bar-base.directive.d.ts +14 -14
- package/lib/base/micro-chart-base.directive.d.ts +14 -14
- package/lib/base/micro-chart-circular-base.directive.d.ts +13 -13
- package/lib/base/micro-chart-comparison-base.directive.d.ts +17 -17
- package/lib/base/micro-chart-line-base.directive.d.ts +15 -15
- package/lib/base/micro-chart-stackbar-base.directive.d.ts +14 -14
- package/lib/micro-charts/micro-chart-area/micro-chart-area.component.d.ts +19 -19
- package/lib/micro-charts/micro-chart-bar/micro-chart-bar.component.d.ts +16 -16
- package/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.d.ts +35 -35
- package/lib/micro-charts/micro-chart-circular/micro-chart-circular.component.d.ts +10 -10
- package/lib/micro-charts/micro-chart-comparison/micro-chart-comparison.component.d.ts +12 -12
- package/lib/micro-charts/micro-chart-line/micro-chart-line.component.d.ts +18 -18
- package/lib/micro-charts/micro-chart-stackbar/micro-chart-stackbar.component.d.ts +11 -11
- package/lib/models/area-chart.d.ts +11 -11
- package/lib/models/bar-item.d.ts +5 -5
- package/lib/models/comparison-item.d.ts +9 -9
- package/lib/models/index.d.ts +5 -5
- package/lib/models/line-item.d.ts +8 -8
- package/lib/models/stackbar-item.d.ts +7 -7
- package/package.json +7 -13
- package/public-api.d.ts +11 -11
- package/esm2020/lib/base/chart-base.directive.mjs +0 -75
- package/esm2020/lib/base/chart-line-time-base.directive.mjs +0 -80
- package/esm2020/lib/base/micro-chart-bar-base.directive.mjs +0 -48
- package/esm2020/lib/base/micro-chart-comparison-base.directive.mjs +0 -99
- package/esm2020/lib/micro-charts/micro-chart-area/micro-chart-area.component.mjs +0 -35
- package/esm2020/lib/micro-charts/micro-chart-bullet/micro-chart-bullet.component.mjs +0 -87
- package/fesm2015/barsa-echarts.mjs +0 -880
- package/fesm2015/barsa-echarts.mjs.map +0 -1
- package/fesm2020/barsa-echarts.mjs.map +0 -1
|
@@ -1,878 +1,878 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, ChangeDetectionStrategy, ViewChild, Input, Directive, NgModule, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
|
-
import * as i1
|
|
3
|
+
import * as i1 from 'barsa-novin-ray-core';
|
|
4
4
|
import { BaseComponent, BaseDirective, BarsaNovinRayCoreModule } from 'barsa-novin-ray-core';
|
|
5
|
-
import * as i1 from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
|
|
8
|
-
class MicroChartBulletComponent extends BaseComponent {
|
|
9
|
-
constructor(renderer) {
|
|
10
|
-
super();
|
|
11
|
-
this.renderer = renderer;
|
|
12
|
-
this.suffix = '';
|
|
13
|
-
this.separatorLinesFakeArray = [];
|
|
14
|
-
}
|
|
15
|
-
ngOnInit() {
|
|
16
|
-
super.ngOnInit();
|
|
17
|
-
this.delta = Math.abs(this.value - this.target);
|
|
18
|
-
this.forecastWidth = this.getWidth(this.forecast);
|
|
19
|
-
this.deltaWidth = this.getWidth(this.delta);
|
|
20
|
-
this.valueWidth = this.getWidth(this.value);
|
|
21
|
-
this.targetWidth = this.getWidth(this.target, true);
|
|
22
|
-
this.deltaBackgroundColor = this.getBackgroundColor('delta');
|
|
23
|
-
this.forecastBackgroundColor = this.getBackgroundColor('forecast');
|
|
24
|
-
this.valueBackgroundColor = this.getBackgroundColor('value');
|
|
25
|
-
this.targetWithSuffix = this.getValueWithSuffix(this.target);
|
|
26
|
-
this.deltaWithSuffix = this.getValueWithSuffix(this.delta);
|
|
27
|
-
this.valueWithSuffix = this.getValueWithSuffix(this.value);
|
|
28
|
-
this.fakeArray();
|
|
29
|
-
}
|
|
30
|
-
ngAfterViewInit() {
|
|
31
|
-
super.ngAfterViewInit();
|
|
32
|
-
if (this.deltaDom) {
|
|
33
|
-
const deltaLeft = this.value >= this.target ? this.getWidth(this.target) : this.getWidth(this.target - this.delta);
|
|
34
|
-
this.renderer.setStyle(this.deltaDom.nativeElement, 'left', deltaLeft);
|
|
35
|
-
const deltaPointerDom = this.deltaDom.nativeElement.querySelector('.pointer');
|
|
36
|
-
const deltaPointerLeft = this.value >= this.target ? '' : '0';
|
|
37
|
-
this.renderer.setStyle(deltaPointerDom, 'left', deltaPointerLeft);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
getWidth(value, isTarget) {
|
|
41
|
-
if (value) {
|
|
42
|
-
let width = (value / this.range) * 100;
|
|
43
|
-
width = isTarget ? width - 2 : width;
|
|
44
|
-
return width.toString() + '%';
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
return '0';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
getValueWithSuffix(value) {
|
|
51
|
-
return value.toString() + (this.suffix || '');
|
|
52
|
-
}
|
|
53
|
-
getBackgroundColor(item) {
|
|
54
|
-
if (item === 'forecast') {
|
|
55
|
-
return this.forecast >= this.target ? '#a1dbb1' : '#fda8ab';
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return this.value >= this.target ? '#3fa45b' : '#dc0d0e';
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
fakeArray() {
|
|
62
|
-
for (let i = 0; i < this.separatorLines; i++) {
|
|
63
|
-
this.separatorLinesFakeArray.push(i);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
70
|
-
type: Component,
|
|
71
|
-
args: [{ selector: 'be-micro-chart-bullet', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\">\r\n <div class=\"range\">\r\n <div class=\"target\"
|
|
72
|
-
}], ctorParameters:
|
|
73
|
-
type: ViewChild,
|
|
74
|
-
args: ['deltaBox']
|
|
75
|
-
}], range: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], value: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}], forecast: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], target: [{
|
|
82
|
-
type: Input
|
|
83
|
-
}], suffix: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}], separatorLines: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}], isDelta: [{
|
|
88
|
-
type: Input
|
|
8
|
+
class MicroChartBulletComponent extends BaseComponent {
|
|
9
|
+
constructor(renderer) {
|
|
10
|
+
super();
|
|
11
|
+
this.renderer = renderer;
|
|
12
|
+
this.suffix = '';
|
|
13
|
+
this.separatorLinesFakeArray = [];
|
|
14
|
+
}
|
|
15
|
+
ngOnInit() {
|
|
16
|
+
super.ngOnInit();
|
|
17
|
+
this.delta = Math.abs(this.value - this.target);
|
|
18
|
+
this.forecastWidth = this.getWidth(this.forecast);
|
|
19
|
+
this.deltaWidth = this.getWidth(this.delta);
|
|
20
|
+
this.valueWidth = this.getWidth(this.value);
|
|
21
|
+
this.targetWidth = this.getWidth(this.target, true);
|
|
22
|
+
this.deltaBackgroundColor = this.getBackgroundColor('delta');
|
|
23
|
+
this.forecastBackgroundColor = this.getBackgroundColor('forecast');
|
|
24
|
+
this.valueBackgroundColor = this.getBackgroundColor('value');
|
|
25
|
+
this.targetWithSuffix = this.getValueWithSuffix(this.target);
|
|
26
|
+
this.deltaWithSuffix = this.getValueWithSuffix(this.delta);
|
|
27
|
+
this.valueWithSuffix = this.getValueWithSuffix(this.value);
|
|
28
|
+
this.fakeArray();
|
|
29
|
+
}
|
|
30
|
+
ngAfterViewInit() {
|
|
31
|
+
super.ngAfterViewInit();
|
|
32
|
+
if (this.deltaDom) {
|
|
33
|
+
const deltaLeft = this.value >= this.target ? this.getWidth(this.target) : this.getWidth(this.target - this.delta);
|
|
34
|
+
this.renderer.setStyle(this.deltaDom.nativeElement, 'left', deltaLeft);
|
|
35
|
+
const deltaPointerDom = this.deltaDom.nativeElement.querySelector('.pointer');
|
|
36
|
+
const deltaPointerLeft = this.value >= this.target ? '' : '0';
|
|
37
|
+
this.renderer.setStyle(deltaPointerDom, 'left', deltaPointerLeft);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
getWidth(value, isTarget) {
|
|
41
|
+
if (value) {
|
|
42
|
+
let width = (value / this.range) * 100;
|
|
43
|
+
width = isTarget ? width - 2 : width;
|
|
44
|
+
return width.toString() + '%';
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return '0';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
getValueWithSuffix(value) {
|
|
51
|
+
return value.toString() + (this.suffix || '');
|
|
52
|
+
}
|
|
53
|
+
getBackgroundColor(item) {
|
|
54
|
+
if (item === 'forecast') {
|
|
55
|
+
return this.forecast >= this.target ? '#a1dbb1' : '#fda8ab';
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return this.value >= this.target ? '#3fa45b' : '#dc0d0e';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
fakeArray() {
|
|
62
|
+
for (let i = 0; i < this.separatorLines; i++) {
|
|
63
|
+
this.separatorLinesFakeArray.push(i);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBulletComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: MicroChartBulletComponent, selector: "be-micro-chart-bullet", inputs: { range: "range", value: "value", forecast: "forecast", target: "target", suffix: "suffix", separatorLines: "separatorLines", isDelta: "isDelta" }, viewQueries: [{ propertyName: "deltaDom", first: true, predicate: ["deltaBox"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chart-container\">\r\n <div class=\"range\">\r\n @if (target) {\r\n <div class=\"target\" #target [style.left]=\"targetWidth\">\r\n <span>{{ targetWithSuffix }}</span>\r\n </div>\r\n } @if (forecast) {\r\n <div class=\"forecast\" [style.background-color]=\"forecastBackgroundColor\" [style.width]=\"forecastWidth\"></div>\r\n } @if (isDelta && delta) {\r\n <div class=\"delta\" #deltaBox [style.background-color]=\"deltaBackgroundColor\" [style.width]=\"deltaWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ deltaWithSuffix + '\u25B2' }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"deltaBackgroundColor\"></div>\r\n </div>\r\n } @else { @if (value) {\r\n <div class=\"value\" [style.background-color]=\"valueBackgroundColor\" [style.width]=\"valueWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ valueWithSuffix }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"valueBackgroundColor\"></div>\r\n </div>\r\n } }\r\n\r\n <!-- separator lines-->\r\n </div>\r\n @if (separatorLines) {\r\n <div class=\"separator-lines\">\r\n @for (i of separatorLinesFakeArray; track i) {\r\n <div class=\"separator-line\"></div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".separator-lines,.range .value,.range .target,.range .forecast,.range{margin-bottom:auto;margin-top:auto;top:0;bottom:0}:host{display:flex;width:100%;height:100%;align-items:center}.chart-container{height:15px;width:100%;position:relative}.range{width:100%;position:absolute;background-color:#e6eee8;z-index:2}.range .forecast{position:absolute;left:0}.range .target{position:absolute;z-index:5;width:2%;height:24px;background-color:#000}.range .target span{position:absolute;bottom:-20px;right:-10px}.range .value{position:absolute;left:0;height:7px}.range .value .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .value span{position:absolute;bottom:19px;right:-6px}.range .delta{position:absolute;height:15px}.range .delta .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .delta span{position:absolute;bottom:19px}.separator-lines{position:absolute;display:flex;justify-content:space-between;height:20px;width:100%}.separator-lines .separator-line{background-color:#e9730c;width:2px}.separator-lines .separator-line:first-child,.separator-lines .separator-line:last-child{background-color:#c21a1a!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
68
|
+
}
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBulletComponent, decorators: [{
|
|
70
|
+
type: Component,
|
|
71
|
+
args: [{ selector: 'be-micro-chart-bullet', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chart-container\">\r\n <div class=\"range\">\r\n @if (target) {\r\n <div class=\"target\" #target [style.left]=\"targetWidth\">\r\n <span>{{ targetWithSuffix }}</span>\r\n </div>\r\n } @if (forecast) {\r\n <div class=\"forecast\" [style.background-color]=\"forecastBackgroundColor\" [style.width]=\"forecastWidth\"></div>\r\n } @if (isDelta && delta) {\r\n <div class=\"delta\" #deltaBox [style.background-color]=\"deltaBackgroundColor\" [style.width]=\"deltaWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ deltaWithSuffix + '\u25B2' }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"deltaBackgroundColor\"></div>\r\n </div>\r\n } @else { @if (value) {\r\n <div class=\"value\" [style.background-color]=\"valueBackgroundColor\" [style.width]=\"valueWidth\">\r\n <span [style.color]=\"valueBackgroundColor\">{{ valueWithSuffix }}</span>\r\n <div class=\"pointer\" [style.background-color]=\"valueBackgroundColor\"></div>\r\n </div>\r\n } }\r\n\r\n <!-- separator lines-->\r\n </div>\r\n @if (separatorLines) {\r\n <div class=\"separator-lines\">\r\n @for (i of separatorLinesFakeArray; track i) {\r\n <div class=\"separator-line\"></div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".separator-lines,.range .value,.range .target,.range .forecast,.range{margin-bottom:auto;margin-top:auto;top:0;bottom:0}:host{display:flex;width:100%;height:100%;align-items:center}.chart-container{height:15px;width:100%;position:relative}.range{width:100%;position:absolute;background-color:#e6eee8;z-index:2}.range .forecast{position:absolute;left:0}.range .target{position:absolute;z-index:5;width:2%;height:24px;background-color:#000}.range .target span{position:absolute;bottom:-20px;right:-10px}.range .value{position:absolute;left:0;height:7px}.range .value .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .value span{position:absolute;bottom:19px;right:-6px}.range .delta{position:absolute;height:15px}.range .delta .pointer{position:absolute;width:2px;height:20px;bottom:0}.range .delta span{position:absolute;bottom:19px}.separator-lines{position:absolute;display:flex;justify-content:space-between;height:20px;width:100%}.separator-lines .separator-line{background-color:#e9730c;width:2px}.separator-lines .separator-line:first-child,.separator-lines .separator-line:last-child{background-color:#c21a1a!important}\n"] }]
|
|
72
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { deltaDom: [{
|
|
73
|
+
type: ViewChild,
|
|
74
|
+
args: ['deltaBox']
|
|
75
|
+
}], range: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], value: [{
|
|
78
|
+
type: Input
|
|
79
|
+
}], forecast: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], target: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], suffix: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], separatorLines: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], isDelta: [{
|
|
88
|
+
type: Input
|
|
89
89
|
}] } });
|
|
90
90
|
|
|
91
|
-
class ChartBaseDirective extends BaseDirective {
|
|
92
|
-
constructor(_el, renderer2) {
|
|
93
|
-
super(_el);
|
|
94
|
-
this._el = _el;
|
|
95
|
-
this.renderer2 = renderer2;
|
|
96
|
-
this.tooltip = {
|
|
97
|
-
trigger: 'item',
|
|
98
|
-
responsive: true,
|
|
99
|
-
position: 'top',
|
|
100
|
-
formatter: '{c}',
|
|
101
|
-
backgroundColor: '#fafcfe',
|
|
102
|
-
borderColor: '#c8e2f7',
|
|
103
|
-
borderWidth: '0.8',
|
|
104
|
-
textStyle: {
|
|
105
|
-
color: '#5d6f80'
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
this.grid = {
|
|
109
|
-
top: 0,
|
|
110
|
-
bottom: 0,
|
|
111
|
-
left: 0,
|
|
112
|
-
right: 0
|
|
113
|
-
};
|
|
114
|
-
this.xAxis = {
|
|
115
|
-
data: [],
|
|
116
|
-
type: 'value'
|
|
117
|
-
};
|
|
118
|
-
this.yAxis = {
|
|
119
|
-
data: [],
|
|
120
|
-
type: 'category'
|
|
121
|
-
};
|
|
122
|
-
this.series = [];
|
|
123
|
-
}
|
|
124
|
-
ngOnInit() {
|
|
125
|
-
// set some style to chart
|
|
126
|
-
super.ngOnInit();
|
|
127
|
-
const elDom = this._el.nativeElement;
|
|
128
|
-
this.renderer2.setStyle(elDom, 'width', '100%');
|
|
129
|
-
this.renderer2.setStyle(elDom, 'height', '100%');
|
|
130
|
-
this.renderer2.setStyle(elDom, 'display', 'block');
|
|
131
|
-
// initialize echart micro-charts
|
|
132
|
-
this._initializeOptions();
|
|
133
|
-
}
|
|
134
|
-
ngAfterViewInit() {
|
|
135
|
-
this.setOptions(this.options);
|
|
136
|
-
setTimeout(() => {
|
|
137
|
-
head.load(['Lib/Echarts/echarts.My.min.js'], () => {
|
|
138
|
-
const elDom = this._el.nativeElement;
|
|
139
|
-
this.chart = echarts.init(elDom);
|
|
140
|
-
this._renderChart();
|
|
141
|
-
});
|
|
142
|
-
}, 300);
|
|
143
|
-
}
|
|
144
|
-
_renderChart() {
|
|
145
|
-
this.chart.setOption(this.options);
|
|
146
|
-
}
|
|
147
|
-
_initializeOptions() {
|
|
148
|
-
this.options = {
|
|
149
|
-
grid: this.grid,
|
|
150
|
-
xAxis: this.xAxis,
|
|
151
|
-
yAxis: this.yAxis,
|
|
152
|
-
series: this.series,
|
|
153
|
-
tooltip: this.tooltip
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
160
|
-
type: Directive
|
|
161
|
-
}], ctorParameters:
|
|
91
|
+
class ChartBaseDirective extends BaseDirective {
|
|
92
|
+
constructor(_el, renderer2) {
|
|
93
|
+
super(_el);
|
|
94
|
+
this._el = _el;
|
|
95
|
+
this.renderer2 = renderer2;
|
|
96
|
+
this.tooltip = {
|
|
97
|
+
trigger: 'item',
|
|
98
|
+
responsive: true,
|
|
99
|
+
position: 'top',
|
|
100
|
+
formatter: '{c}',
|
|
101
|
+
backgroundColor: '#fafcfe',
|
|
102
|
+
borderColor: '#c8e2f7',
|
|
103
|
+
borderWidth: '0.8',
|
|
104
|
+
textStyle: {
|
|
105
|
+
color: '#5d6f80'
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
this.grid = {
|
|
109
|
+
top: 0,
|
|
110
|
+
bottom: 0,
|
|
111
|
+
left: 0,
|
|
112
|
+
right: 0
|
|
113
|
+
};
|
|
114
|
+
this.xAxis = {
|
|
115
|
+
data: [],
|
|
116
|
+
type: 'value'
|
|
117
|
+
};
|
|
118
|
+
this.yAxis = {
|
|
119
|
+
data: [],
|
|
120
|
+
type: 'category'
|
|
121
|
+
};
|
|
122
|
+
this.series = [];
|
|
123
|
+
}
|
|
124
|
+
ngOnInit() {
|
|
125
|
+
// set some style to chart
|
|
126
|
+
super.ngOnInit();
|
|
127
|
+
const elDom = this._el.nativeElement;
|
|
128
|
+
this.renderer2.setStyle(elDom, 'width', '100%');
|
|
129
|
+
this.renderer2.setStyle(elDom, 'height', '100%');
|
|
130
|
+
this.renderer2.setStyle(elDom, 'display', 'block');
|
|
131
|
+
// initialize echart micro-charts
|
|
132
|
+
this._initializeOptions();
|
|
133
|
+
}
|
|
134
|
+
ngAfterViewInit() {
|
|
135
|
+
this.setOptions(this.options);
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
head.load(['Lib/Echarts/echarts.My.min.js'], () => {
|
|
138
|
+
const elDom = this._el.nativeElement;
|
|
139
|
+
this.chart = echarts.init(elDom);
|
|
140
|
+
this._renderChart();
|
|
141
|
+
});
|
|
142
|
+
}, 300);
|
|
143
|
+
}
|
|
144
|
+
_renderChart() {
|
|
145
|
+
this.chart.setOption(this.options);
|
|
146
|
+
}
|
|
147
|
+
_initializeOptions() {
|
|
148
|
+
this.options = {
|
|
149
|
+
grid: this.grid,
|
|
150
|
+
xAxis: this.xAxis,
|
|
151
|
+
yAxis: this.yAxis,
|
|
152
|
+
series: this.series,
|
|
153
|
+
tooltip: this.tooltip
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ChartBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
157
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ChartBaseDirective, usesInheritance: true, ngImport: i0 }); }
|
|
158
|
+
}
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ChartBaseDirective, decorators: [{
|
|
160
|
+
type: Directive
|
|
161
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
|
|
162
162
|
|
|
163
|
-
class MicroChartBaseDirective extends ChartBaseDirective {
|
|
164
|
-
constructor(_el, renderer2) {
|
|
165
|
-
super(_el, renderer2);
|
|
166
|
-
this._el = _el;
|
|
167
|
-
this.renderer2 = renderer2;
|
|
168
|
-
this.xAxis = {
|
|
169
|
-
data: [],
|
|
170
|
-
type: 'value',
|
|
171
|
-
axisLine: {
|
|
172
|
-
show: false
|
|
173
|
-
},
|
|
174
|
-
axisLabel: {
|
|
175
|
-
show: false
|
|
176
|
-
},
|
|
177
|
-
splitLine: {
|
|
178
|
-
show: false
|
|
179
|
-
},
|
|
180
|
-
axisTick: {
|
|
181
|
-
show: false
|
|
182
|
-
},
|
|
183
|
-
max: 100
|
|
184
|
-
};
|
|
185
|
-
this.yAxis = {
|
|
186
|
-
data: [],
|
|
187
|
-
type: 'category',
|
|
188
|
-
axisLabel: {
|
|
189
|
-
show: false
|
|
190
|
-
},
|
|
191
|
-
axisLine: {
|
|
192
|
-
show: false
|
|
193
|
-
},
|
|
194
|
-
splitLine: {
|
|
195
|
-
show: false
|
|
196
|
-
},
|
|
197
|
-
axisTick: {
|
|
198
|
-
show: false
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
206
|
-
type: Directive
|
|
207
|
-
}], ctorParameters:
|
|
163
|
+
class MicroChartBaseDirective extends ChartBaseDirective {
|
|
164
|
+
constructor(_el, renderer2) {
|
|
165
|
+
super(_el, renderer2);
|
|
166
|
+
this._el = _el;
|
|
167
|
+
this.renderer2 = renderer2;
|
|
168
|
+
this.xAxis = {
|
|
169
|
+
data: [],
|
|
170
|
+
type: 'value',
|
|
171
|
+
axisLine: {
|
|
172
|
+
show: false
|
|
173
|
+
},
|
|
174
|
+
axisLabel: {
|
|
175
|
+
show: false
|
|
176
|
+
},
|
|
177
|
+
splitLine: {
|
|
178
|
+
show: false
|
|
179
|
+
},
|
|
180
|
+
axisTick: {
|
|
181
|
+
show: false
|
|
182
|
+
},
|
|
183
|
+
max: 100
|
|
184
|
+
};
|
|
185
|
+
this.yAxis = {
|
|
186
|
+
data: [],
|
|
187
|
+
type: 'category',
|
|
188
|
+
axisLabel: {
|
|
189
|
+
show: false
|
|
190
|
+
},
|
|
191
|
+
axisLine: {
|
|
192
|
+
show: false
|
|
193
|
+
},
|
|
194
|
+
splitLine: {
|
|
195
|
+
show: false
|
|
196
|
+
},
|
|
197
|
+
axisTick: {
|
|
198
|
+
show: false
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
203
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartBaseDirective, usesInheritance: true, ngImport: i0 }); }
|
|
204
|
+
}
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBaseDirective, decorators: [{
|
|
206
|
+
type: Directive
|
|
207
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
|
|
208
208
|
|
|
209
|
-
class MicroChartLineBaseDirective extends MicroChartBaseDirective {
|
|
210
|
-
constructor(_el, renderer2) {
|
|
211
|
-
super(_el, renderer2);
|
|
212
|
-
this._el = _el;
|
|
213
|
-
this.renderer2 = renderer2;
|
|
214
|
-
}
|
|
215
|
-
setOptions(options) {
|
|
216
|
-
this._scaleDownLineData();
|
|
217
|
-
// initialize series
|
|
218
|
-
this._initSeries(options);
|
|
219
|
-
// set input data
|
|
220
|
-
this.line.data.forEach((item) => {
|
|
221
|
-
this.xAxis?.data?.push(item.label);
|
|
222
|
-
const dataObj = {
|
|
223
|
-
value: item.value,
|
|
224
|
-
symbol: 'none'
|
|
225
|
-
};
|
|
226
|
-
options.series[0].data.push(dataObj);
|
|
227
|
-
});
|
|
228
|
-
this.xAxis.max = undefined;
|
|
229
|
-
this.xAxis.type = 'category';
|
|
230
|
-
// set custom yAxis
|
|
231
|
-
this.yAxis.min = 0;
|
|
232
|
-
this.yAxis.max = 6;
|
|
233
|
-
this.yAxis.type = 'value';
|
|
234
|
-
}
|
|
235
|
-
/* eslint-disable */
|
|
236
|
-
_scaleDownLineData() {
|
|
237
|
-
const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
|
|
238
|
-
return this.line.data.forEach((dataItem) => {
|
|
239
|
-
dataItem.value *= 6 / maxValue;
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
_initSeries(options) {
|
|
243
|
-
options.series = [
|
|
244
|
-
{
|
|
245
|
-
type: 'line',
|
|
246
|
-
color: this.line?.color,
|
|
247
|
-
data: [],
|
|
248
|
-
label: {
|
|
249
|
-
show: false
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
];
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
258
|
-
type: Directive,
|
|
259
|
-
args: [{
|
|
260
|
-
selector: '[beMicroChartLine]'
|
|
261
|
-
}]
|
|
262
|
-
}], ctorParameters:
|
|
263
|
-
type: Input
|
|
209
|
+
class MicroChartLineBaseDirective extends MicroChartBaseDirective {
|
|
210
|
+
constructor(_el, renderer2) {
|
|
211
|
+
super(_el, renderer2);
|
|
212
|
+
this._el = _el;
|
|
213
|
+
this.renderer2 = renderer2;
|
|
214
|
+
}
|
|
215
|
+
setOptions(options) {
|
|
216
|
+
this._scaleDownLineData();
|
|
217
|
+
// initialize series
|
|
218
|
+
this._initSeries(options);
|
|
219
|
+
// set input data
|
|
220
|
+
this.line.data.forEach((item) => {
|
|
221
|
+
this.xAxis?.data?.push(item.label);
|
|
222
|
+
const dataObj = {
|
|
223
|
+
value: item.value,
|
|
224
|
+
symbol: 'none'
|
|
225
|
+
};
|
|
226
|
+
options.series[0].data.push(dataObj);
|
|
227
|
+
});
|
|
228
|
+
this.xAxis.max = undefined;
|
|
229
|
+
this.xAxis.type = 'category';
|
|
230
|
+
// set custom yAxis
|
|
231
|
+
this.yAxis.min = 0;
|
|
232
|
+
this.yAxis.max = 6;
|
|
233
|
+
this.yAxis.type = 'value';
|
|
234
|
+
}
|
|
235
|
+
/* eslint-disable */
|
|
236
|
+
_scaleDownLineData() {
|
|
237
|
+
const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
|
|
238
|
+
return this.line.data.forEach((dataItem) => {
|
|
239
|
+
dataItem.value *= 6 / maxValue;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
_initSeries(options) {
|
|
243
|
+
options.series = [
|
|
244
|
+
{
|
|
245
|
+
type: 'line',
|
|
246
|
+
color: this.line?.color,
|
|
247
|
+
data: [],
|
|
248
|
+
label: {
|
|
249
|
+
show: false
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartLineBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
255
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartLineBaseDirective, selector: "[beMicroChartLine]", inputs: { line: "line" }, usesInheritance: true, ngImport: i0 }); }
|
|
256
|
+
}
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartLineBaseDirective, decorators: [{
|
|
258
|
+
type: Directive,
|
|
259
|
+
args: [{
|
|
260
|
+
selector: '[beMicroChartLine]'
|
|
261
|
+
}]
|
|
262
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { line: [{
|
|
263
|
+
type: Input
|
|
264
264
|
}] } });
|
|
265
265
|
|
|
266
|
-
class MicroChartLineComponent extends BaseComponent {
|
|
267
|
-
constructor(el) {
|
|
268
|
-
super();
|
|
269
|
-
this.el = el;
|
|
270
|
-
}
|
|
271
|
-
ngOnInit() {
|
|
272
|
-
super.ngOnInit();
|
|
273
|
-
this.getFirstAndLastValues();
|
|
274
|
-
}
|
|
275
|
-
getFirstAndLastValues() {
|
|
276
|
-
const dataLength = this.line.data.length;
|
|
277
|
-
this.firstValue = this.line.data[0].value.toString();
|
|
278
|
-
this.lastValue = this.line.data[dataLength - 1].value.toString();
|
|
279
|
-
this.firstLabel = this.line.data[0].label;
|
|
280
|
-
this.lastLabel = this.line.data[dataLength - 1].label;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
286
|
-
type: Component,
|
|
287
|
-
args: [{ selector: 'be-micro-chart-line', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"top-labels\">\r\n <span>{{ lastValue }}{{ line?.suffix }}</span>\r\n <span>{{ firstValue }}{{ line?.suffix }}</span>\r\n</div>\r\n\r\n<div class=\"chart\">\r\n <div *untilInView=\"el\" beMicroChartLine [line]=\"line\"></div>\r\n</div>\r\n\r\n<div class=\"bottom-labels\">\r\n <span>{{ lastLabel }}</span>\r\n <span>{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%;height:52%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}\n"] }]
|
|
288
|
-
}], ctorParameters:
|
|
289
|
-
type: Input
|
|
266
|
+
class MicroChartLineComponent extends BaseComponent {
|
|
267
|
+
constructor(el) {
|
|
268
|
+
super();
|
|
269
|
+
this.el = el;
|
|
270
|
+
}
|
|
271
|
+
ngOnInit() {
|
|
272
|
+
super.ngOnInit();
|
|
273
|
+
this.getFirstAndLastValues();
|
|
274
|
+
}
|
|
275
|
+
getFirstAndLastValues() {
|
|
276
|
+
const dataLength = this.line.data.length;
|
|
277
|
+
this.firstValue = this.line.data[0].value.toString();
|
|
278
|
+
this.lastValue = this.line.data[dataLength - 1].value.toString();
|
|
279
|
+
this.firstLabel = this.line.data[0].label;
|
|
280
|
+
this.lastLabel = this.line.data[dataLength - 1].label;
|
|
281
|
+
}
|
|
282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartLineComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
283
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartLineComponent, selector: "be-micro-chart-line", inputs: { line: "line" }, usesInheritance: true, ngImport: i0, template: "<div class=\"top-labels\">\r\n <span>{{ lastValue }}{{ line?.suffix }}</span>\r\n <span>{{ firstValue }}{{ line?.suffix }}</span>\r\n</div>\r\n\r\n<div class=\"chart\">\r\n <div *untilInView=\"el\" beMicroChartLine [line]=\"line\"></div>\r\n</div>\r\n\r\n<div class=\"bottom-labels\">\r\n <span>{{ lastLabel }}</span>\r\n <span>{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%;height:52%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartLineBaseDirective, selector: "[beMicroChartLine]", inputs: ["line"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
284
|
+
}
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartLineComponent, decorators: [{
|
|
286
|
+
type: Component,
|
|
287
|
+
args: [{ selector: 'be-micro-chart-line', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"top-labels\">\r\n <span>{{ lastValue }}{{ line?.suffix }}</span>\r\n <span>{{ firstValue }}{{ line?.suffix }}</span>\r\n</div>\r\n\r\n<div class=\"chart\">\r\n <div *untilInView=\"el\" beMicroChartLine [line]=\"line\"></div>\r\n</div>\r\n\r\n<div class=\"bottom-labels\">\r\n <span>{{ lastLabel }}</span>\r\n <span>{{ firstLabel }}</span>\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%;height:52%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}\n"] }]
|
|
288
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { line: [{
|
|
289
|
+
type: Input
|
|
290
290
|
}] } });
|
|
291
291
|
|
|
292
|
-
class MicroChartStackbarBaseDirective extends MicroChartBaseDirective {
|
|
293
|
-
constructor(_el, renderer2) {
|
|
294
|
-
super(_el, renderer2);
|
|
295
|
-
this._el = _el;
|
|
296
|
-
this.renderer2 = renderer2;
|
|
297
|
-
}
|
|
298
|
-
setOptions(options) {
|
|
299
|
-
this.chartData.data.forEach((dataItem) => {
|
|
300
|
-
const dataConfig = this.creatData(dataItem);
|
|
301
|
-
options.series.push(dataConfig);
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
creatData(dataItem) {
|
|
305
|
-
return {
|
|
306
|
-
name: 'Direct',
|
|
307
|
-
barWidth: 15,
|
|
308
|
-
type: 'bar',
|
|
309
|
-
stack: 'total',
|
|
310
|
-
emphasis: {
|
|
311
|
-
focus: 'series'
|
|
312
|
-
},
|
|
313
|
-
data: [
|
|
314
|
-
{
|
|
315
|
-
value: dataItem.value,
|
|
316
|
-
itemStyle: {
|
|
317
|
-
color: dataItem.color
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
],
|
|
321
|
-
label: {
|
|
322
|
-
show: true,
|
|
323
|
-
formatter: (d) => d.data.value.toString() + this.chartData.suffix,
|
|
324
|
-
fontSize: 10
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
332
|
-
type: Directive,
|
|
333
|
-
args: [{
|
|
334
|
-
selector: '[beMicroChartStackbar]'
|
|
335
|
-
}]
|
|
336
|
-
}], ctorParameters:
|
|
337
|
-
type: Input
|
|
292
|
+
class MicroChartStackbarBaseDirective extends MicroChartBaseDirective {
|
|
293
|
+
constructor(_el, renderer2) {
|
|
294
|
+
super(_el, renderer2);
|
|
295
|
+
this._el = _el;
|
|
296
|
+
this.renderer2 = renderer2;
|
|
297
|
+
}
|
|
298
|
+
setOptions(options) {
|
|
299
|
+
this.chartData.data.forEach((dataItem) => {
|
|
300
|
+
const dataConfig = this.creatData(dataItem);
|
|
301
|
+
options.series.push(dataConfig);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
creatData(dataItem) {
|
|
305
|
+
return {
|
|
306
|
+
name: 'Direct',
|
|
307
|
+
barWidth: 15,
|
|
308
|
+
type: 'bar',
|
|
309
|
+
stack: 'total',
|
|
310
|
+
emphasis: {
|
|
311
|
+
focus: 'series'
|
|
312
|
+
},
|
|
313
|
+
data: [
|
|
314
|
+
{
|
|
315
|
+
value: dataItem.value,
|
|
316
|
+
itemStyle: {
|
|
317
|
+
color: dataItem.color
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
label: {
|
|
322
|
+
show: true,
|
|
323
|
+
formatter: (d) => d.data.value.toString() + this.chartData.suffix,
|
|
324
|
+
fontSize: 10
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartStackbarBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
329
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartStackbarBaseDirective, selector: "[beMicroChartStackbar]", inputs: { chartData: "chartData" }, usesInheritance: true, ngImport: i0 }); }
|
|
330
|
+
}
|
|
331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartStackbarBaseDirective, decorators: [{
|
|
332
|
+
type: Directive,
|
|
333
|
+
args: [{
|
|
334
|
+
selector: '[beMicroChartStackbar]'
|
|
335
|
+
}]
|
|
336
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { chartData: [{
|
|
337
|
+
type: Input
|
|
338
338
|
}] } });
|
|
339
339
|
|
|
340
|
-
class MicroChartStackbarComponent extends BaseComponent {
|
|
341
|
-
constructor(el) {
|
|
342
|
-
super();
|
|
343
|
-
this.el = el;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
349
|
-
type: Component,
|
|
350
|
-
args: [{ selector: 'be-micro-chart-stackbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartStackbar class=\"chart\" [chartData]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%}\n"] }]
|
|
351
|
-
}], ctorParameters:
|
|
352
|
-
type: Input
|
|
340
|
+
class MicroChartStackbarComponent extends BaseComponent {
|
|
341
|
+
constructor(el) {
|
|
342
|
+
super();
|
|
343
|
+
this.el = el;
|
|
344
|
+
}
|
|
345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartStackbarComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
346
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartStackbarComponent, selector: "be-micro-chart-stackbar", inputs: { data: "data" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartStackbar class=\"chart\" [chartData]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartStackbarBaseDirective, selector: "[beMicroChartStackbar]", inputs: ["chartData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
347
|
+
}
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartStackbarComponent, decorators: [{
|
|
349
|
+
type: Component,
|
|
350
|
+
args: [{ selector: 'be-micro-chart-stackbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartStackbar class=\"chart\" [chartData]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}.chart{width:100%}\n"] }]
|
|
351
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
|
|
352
|
+
type: Input
|
|
353
353
|
}] } });
|
|
354
354
|
|
|
355
|
-
class MicroChartCircularBaseDirective extends MicroChartBaseDirective {
|
|
356
|
-
constructor(_el, renderer2) {
|
|
357
|
-
super(_el, renderer2);
|
|
358
|
-
this._el = _el;
|
|
359
|
-
this.renderer2 = renderer2;
|
|
360
|
-
}
|
|
361
|
-
setOptions(options) {
|
|
362
|
-
// remove extra data from circular chart
|
|
363
|
-
this._initSeries(options);
|
|
364
|
-
// add data to series
|
|
365
|
-
options.series[0].data.push({ value: this.data });
|
|
366
|
-
}
|
|
367
|
-
_initSeries(options) {
|
|
368
|
-
options.series = [
|
|
369
|
-
{
|
|
370
|
-
type: 'gauge',
|
|
371
|
-
progress: {
|
|
372
|
-
show: true,
|
|
373
|
-
width: 5
|
|
374
|
-
},
|
|
375
|
-
axisLine: {
|
|
376
|
-
lineStyle: {
|
|
377
|
-
width: 5
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
axisTick: {
|
|
381
|
-
show: false
|
|
382
|
-
},
|
|
383
|
-
splitLine: {
|
|
384
|
-
show: false,
|
|
385
|
-
length: 15,
|
|
386
|
-
lineStyle: {
|
|
387
|
-
width: 2,
|
|
388
|
-
color: '#999'
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
axisLabel: {
|
|
392
|
-
distance: 30,
|
|
393
|
-
color: '#999',
|
|
394
|
-
fontSize: 10,
|
|
395
|
-
show: false
|
|
396
|
-
},
|
|
397
|
-
anchor: {
|
|
398
|
-
show: true,
|
|
399
|
-
showAbove: true,
|
|
400
|
-
size: 15,
|
|
401
|
-
itemStyle: {
|
|
402
|
-
borderWidth: 1
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
title: {
|
|
406
|
-
show: false
|
|
407
|
-
},
|
|
408
|
-
detail: {
|
|
409
|
-
valueAnimation: true,
|
|
410
|
-
fontSize: 12,
|
|
411
|
-
offsetCenter: [0, '70%']
|
|
412
|
-
},
|
|
413
|
-
data: []
|
|
414
|
-
}
|
|
415
|
-
];
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
421
|
-
type: Directive,
|
|
422
|
-
args: [{ selector: '[beMicroChartCircular]' }]
|
|
423
|
-
}], ctorParameters:
|
|
424
|
-
type: Input
|
|
355
|
+
class MicroChartCircularBaseDirective extends MicroChartBaseDirective {
|
|
356
|
+
constructor(_el, renderer2) {
|
|
357
|
+
super(_el, renderer2);
|
|
358
|
+
this._el = _el;
|
|
359
|
+
this.renderer2 = renderer2;
|
|
360
|
+
}
|
|
361
|
+
setOptions(options) {
|
|
362
|
+
// remove extra data from circular chart
|
|
363
|
+
this._initSeries(options);
|
|
364
|
+
// add data to series
|
|
365
|
+
options.series[0].data.push({ value: this.data });
|
|
366
|
+
}
|
|
367
|
+
_initSeries(options) {
|
|
368
|
+
options.series = [
|
|
369
|
+
{
|
|
370
|
+
type: 'gauge',
|
|
371
|
+
progress: {
|
|
372
|
+
show: true,
|
|
373
|
+
width: 5
|
|
374
|
+
},
|
|
375
|
+
axisLine: {
|
|
376
|
+
lineStyle: {
|
|
377
|
+
width: 5
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
axisTick: {
|
|
381
|
+
show: false
|
|
382
|
+
},
|
|
383
|
+
splitLine: {
|
|
384
|
+
show: false,
|
|
385
|
+
length: 15,
|
|
386
|
+
lineStyle: {
|
|
387
|
+
width: 2,
|
|
388
|
+
color: '#999'
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
axisLabel: {
|
|
392
|
+
distance: 30,
|
|
393
|
+
color: '#999',
|
|
394
|
+
fontSize: 10,
|
|
395
|
+
show: false
|
|
396
|
+
},
|
|
397
|
+
anchor: {
|
|
398
|
+
show: true,
|
|
399
|
+
showAbove: true,
|
|
400
|
+
size: 15,
|
|
401
|
+
itemStyle: {
|
|
402
|
+
borderWidth: 1
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
title: {
|
|
406
|
+
show: false
|
|
407
|
+
},
|
|
408
|
+
detail: {
|
|
409
|
+
valueAnimation: true,
|
|
410
|
+
fontSize: 12,
|
|
411
|
+
offsetCenter: [0, '70%']
|
|
412
|
+
},
|
|
413
|
+
data: []
|
|
414
|
+
}
|
|
415
|
+
];
|
|
416
|
+
}
|
|
417
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartCircularBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
418
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartCircularBaseDirective, selector: "[beMicroChartCircular]", inputs: { data: "data" }, usesInheritance: true, ngImport: i0 }); }
|
|
419
|
+
}
|
|
420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartCircularBaseDirective, decorators: [{
|
|
421
|
+
type: Directive,
|
|
422
|
+
args: [{ selector: '[beMicroChartCircular]' }]
|
|
423
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { data: [{
|
|
424
|
+
type: Input
|
|
425
425
|
}] } });
|
|
426
426
|
|
|
427
|
-
class MicroChartCircularComponent extends BaseComponent {
|
|
428
|
-
constructor(el) {
|
|
429
|
-
super();
|
|
430
|
-
this.el = el;
|
|
431
|
-
this.data = 50;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
437
|
-
type: Component,
|
|
438
|
-
args: [{ selector: 'be-micro-chart-circular', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartCircular [data]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
|
|
439
|
-
}], ctorParameters:
|
|
440
|
-
type: Input
|
|
427
|
+
class MicroChartCircularComponent extends BaseComponent {
|
|
428
|
+
constructor(el) {
|
|
429
|
+
super();
|
|
430
|
+
this.el = el;
|
|
431
|
+
this.data = 50;
|
|
432
|
+
}
|
|
433
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartCircularComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
434
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartCircularComponent, selector: "be-micro-chart-circular", inputs: { data: "data" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartCircular [data]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartCircularBaseDirective, selector: "[beMicroChartCircular]", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
435
|
+
}
|
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartCircularComponent, decorators: [{
|
|
437
|
+
type: Component,
|
|
438
|
+
args: [{ selector: 'be-micro-chart-circular', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartCircular [data]=\"data\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
|
|
439
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
|
|
440
|
+
type: Input
|
|
441
441
|
}] } });
|
|
442
442
|
|
|
443
|
-
class MicroChartComparisonBaseDirective extends MicroChartBaseDirective {
|
|
444
|
-
constructor(_el, renderer2) {
|
|
445
|
-
super(_el, renderer2);
|
|
446
|
-
this._el = _el;
|
|
447
|
-
this.renderer2 = renderer2;
|
|
448
|
-
}
|
|
449
|
-
setOptions(options) {
|
|
450
|
-
// initialize series
|
|
451
|
-
this._initValues(options);
|
|
452
|
-
// set custom xAxis
|
|
453
|
-
this.xAxis.type = 'value';
|
|
454
|
-
this.xAxis.boundaryGap = ['0%', '50%'];
|
|
455
|
-
// set custom yAxis
|
|
456
|
-
this.yAxis.type = 'category';
|
|
457
|
-
this.yAxis.offset = 6;
|
|
458
|
-
this.yAxis.axisLabel = {
|
|
459
|
-
show: true,
|
|
460
|
-
inside: true,
|
|
461
|
-
lineHeight: 16
|
|
462
|
-
};
|
|
463
|
-
// set custom grid
|
|
464
|
-
this.grid.top = 10;
|
|
465
|
-
const textStyle = {
|
|
466
|
-
verticalAlign: 'bottom',
|
|
467
|
-
fontSize: 12,
|
|
468
|
-
fontWeight: 'bold'
|
|
469
|
-
};
|
|
470
|
-
this.chartData.data.forEach((item) => {
|
|
471
|
-
const seriesData = {
|
|
472
|
-
value: item.value,
|
|
473
|
-
itemStyle: {
|
|
474
|
-
color: item.color
|
|
475
|
-
},
|
|
476
|
-
label: {
|
|
477
|
-
position: ['100', '0%']
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
options.series[0].data.push(seriesData);
|
|
481
|
-
const yAxisData = { value: item.label, textStyle };
|
|
482
|
-
this.yAxis?.data?.push(yAxisData);
|
|
483
|
-
});
|
|
484
|
-
// if we have double tile
|
|
485
|
-
if (this.size === 'l') {
|
|
486
|
-
this.grid.left = 50;
|
|
487
|
-
this.yAxis.axisLabel.inside = false;
|
|
488
|
-
this.yAxis.axisLabel.lineHeight = undefined;
|
|
489
|
-
options.series[0].label.position = 'right';
|
|
490
|
-
this.yAxis.offset = -2;
|
|
491
|
-
options.series[0].showBackground = false;
|
|
492
|
-
this.xAxis.max = 112;
|
|
493
|
-
options.series[0].data.map((dataItem) => {
|
|
494
|
-
delete dataItem.label.offset;
|
|
495
|
-
dataItem.label.position = ['100%', '0%'];
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
options.series[0].label.formatter = (d) => d.data.value + this.chartData.suffix;
|
|
499
|
-
}
|
|
500
|
-
_initValues(options) {
|
|
501
|
-
options.series = [
|
|
502
|
-
{
|
|
503
|
-
showBackground: true,
|
|
504
|
-
barWidth: this.chartData.barWidth ?? 3,
|
|
505
|
-
type: 'bar',
|
|
506
|
-
data: [],
|
|
507
|
-
label: {
|
|
508
|
-
show: true,
|
|
509
|
-
position: 'top',
|
|
510
|
-
distance: 0,
|
|
511
|
-
valueAnimation: true,
|
|
512
|
-
fontFamily: 'monospace',
|
|
513
|
-
formatter: (d) => d.data.value + '%',
|
|
514
|
-
lineHeight: -10
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
];
|
|
518
|
-
options.plotOptions = {
|
|
519
|
-
bar: {
|
|
520
|
-
horizontal: true,
|
|
521
|
-
distributed: true
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
529
|
-
type: Directive,
|
|
530
|
-
args: [{
|
|
531
|
-
selector: '[beMicroChartComparison]'
|
|
532
|
-
}]
|
|
533
|
-
}], ctorParameters:
|
|
534
|
-
type: Input
|
|
535
|
-
}], chartData: [{
|
|
536
|
-
type: Input
|
|
443
|
+
class MicroChartComparisonBaseDirective extends MicroChartBaseDirective {
|
|
444
|
+
constructor(_el, renderer2) {
|
|
445
|
+
super(_el, renderer2);
|
|
446
|
+
this._el = _el;
|
|
447
|
+
this.renderer2 = renderer2;
|
|
448
|
+
}
|
|
449
|
+
setOptions(options) {
|
|
450
|
+
// initialize series
|
|
451
|
+
this._initValues(options);
|
|
452
|
+
// set custom xAxis
|
|
453
|
+
this.xAxis.type = 'value';
|
|
454
|
+
this.xAxis.boundaryGap = ['0%', '50%'];
|
|
455
|
+
// set custom yAxis
|
|
456
|
+
this.yAxis.type = 'category';
|
|
457
|
+
this.yAxis.offset = 6;
|
|
458
|
+
this.yAxis.axisLabel = {
|
|
459
|
+
show: true,
|
|
460
|
+
inside: true,
|
|
461
|
+
lineHeight: 16
|
|
462
|
+
};
|
|
463
|
+
// set custom grid
|
|
464
|
+
this.grid.top = 10;
|
|
465
|
+
const textStyle = {
|
|
466
|
+
verticalAlign: 'bottom',
|
|
467
|
+
fontSize: 12,
|
|
468
|
+
fontWeight: 'bold'
|
|
469
|
+
};
|
|
470
|
+
this.chartData.data.forEach((item) => {
|
|
471
|
+
const seriesData = {
|
|
472
|
+
value: item.value,
|
|
473
|
+
itemStyle: {
|
|
474
|
+
color: item.color
|
|
475
|
+
},
|
|
476
|
+
label: {
|
|
477
|
+
position: ['100', '0%']
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
options.series[0].data.push(seriesData);
|
|
481
|
+
const yAxisData = { value: item.label, textStyle };
|
|
482
|
+
this.yAxis?.data?.push(yAxisData);
|
|
483
|
+
});
|
|
484
|
+
// if we have double tile
|
|
485
|
+
if (this.size === 'l') {
|
|
486
|
+
this.grid.left = 50;
|
|
487
|
+
this.yAxis.axisLabel.inside = false;
|
|
488
|
+
this.yAxis.axisLabel.lineHeight = undefined;
|
|
489
|
+
options.series[0].label.position = 'right';
|
|
490
|
+
this.yAxis.offset = -2;
|
|
491
|
+
options.series[0].showBackground = false;
|
|
492
|
+
this.xAxis.max = 112;
|
|
493
|
+
options.series[0].data.map((dataItem) => {
|
|
494
|
+
delete dataItem.label.offset;
|
|
495
|
+
dataItem.label.position = ['100%', '0%'];
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
options.series[0].label.formatter = (d) => d.data.value + this.chartData.suffix;
|
|
499
|
+
}
|
|
500
|
+
_initValues(options) {
|
|
501
|
+
options.series = [
|
|
502
|
+
{
|
|
503
|
+
showBackground: true,
|
|
504
|
+
barWidth: this.chartData.barWidth ?? 3,
|
|
505
|
+
type: 'bar',
|
|
506
|
+
data: [],
|
|
507
|
+
label: {
|
|
508
|
+
show: true,
|
|
509
|
+
position: 'top',
|
|
510
|
+
distance: 0,
|
|
511
|
+
valueAnimation: true,
|
|
512
|
+
fontFamily: 'monospace',
|
|
513
|
+
formatter: (d) => d.data.value + '%',
|
|
514
|
+
lineHeight: -10
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
];
|
|
518
|
+
options.plotOptions = {
|
|
519
|
+
bar: {
|
|
520
|
+
horizontal: true,
|
|
521
|
+
distributed: true
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartComparisonBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
526
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartComparisonBaseDirective, selector: "[beMicroChartComparison]", inputs: { size: "size", chartData: "chartData" }, usesInheritance: true, ngImport: i0 }); }
|
|
527
|
+
}
|
|
528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartComparisonBaseDirective, decorators: [{
|
|
529
|
+
type: Directive,
|
|
530
|
+
args: [{
|
|
531
|
+
selector: '[beMicroChartComparison]'
|
|
532
|
+
}]
|
|
533
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { size: [{
|
|
534
|
+
type: Input
|
|
535
|
+
}], chartData: [{
|
|
536
|
+
type: Input
|
|
537
537
|
}] } });
|
|
538
538
|
|
|
539
|
-
class MicroChartComparisonComponent extends BaseComponent {
|
|
540
|
-
constructor(el) {
|
|
541
|
-
super();
|
|
542
|
-
this.el = el;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
548
|
-
type: Component,
|
|
549
|
-
args: [{ selector: 'be-micro-chart-comparison', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartComparison [chartData]=\"data\" [size]=\"size\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
|
|
550
|
-
}], ctorParameters:
|
|
551
|
-
type: Input
|
|
552
|
-
}], size: [{
|
|
553
|
-
type: Input
|
|
539
|
+
class MicroChartComparisonComponent extends BaseComponent {
|
|
540
|
+
constructor(el) {
|
|
541
|
+
super();
|
|
542
|
+
this.el = el;
|
|
543
|
+
}
|
|
544
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartComparisonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
545
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartComparisonComponent, selector: "be-micro-chart-comparison", inputs: { data: "data", size: "size" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartComparison [chartData]=\"data\" [size]=\"size\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartComparisonBaseDirective, selector: "[beMicroChartComparison]", inputs: ["size", "chartData"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
546
|
+
}
|
|
547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartComparisonComponent, decorators: [{
|
|
548
|
+
type: Component,
|
|
549
|
+
args: [{ selector: 'be-micro-chart-comparison', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartComparison [chartData]=\"data\" [size]=\"size\"></div>\r\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
|
|
550
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
|
|
551
|
+
type: Input
|
|
552
|
+
}], size: [{
|
|
553
|
+
type: Input
|
|
554
554
|
}] } });
|
|
555
555
|
|
|
556
|
-
class MicroChartAreaBaseDirective extends MicroChartBaseDirective {
|
|
557
|
-
constructor(_el, renderer2) {
|
|
558
|
-
super(_el, renderer2);
|
|
559
|
-
this._el = _el;
|
|
560
|
-
this.renderer2 = renderer2;
|
|
561
|
-
this.areas = [];
|
|
562
|
-
}
|
|
563
|
-
/* eslint-disable */
|
|
564
|
-
setOptions(options) {
|
|
565
|
-
this._scaleDownLineData();
|
|
566
|
-
// set custom xAxis
|
|
567
|
-
this.xAxis.type = 'category';
|
|
568
|
-
this.line.data.forEach((item) => {
|
|
569
|
-
this.xAxis?.data?.push(item.label);
|
|
570
|
-
});
|
|
571
|
-
this.xAxis.max = undefined;
|
|
572
|
-
this.xAxis.boundaryGap = false;
|
|
573
|
-
// set custom yAxis
|
|
574
|
-
this.yAxis.splitLine = { show: false };
|
|
575
|
-
this.yAxis.type = 'value';
|
|
576
|
-
this.yAxis.splitNumber = 3;
|
|
577
|
-
this.yAxis.min = 0;
|
|
578
|
-
this.yAxis.max = 6;
|
|
579
|
-
// handel area
|
|
580
|
-
this.areas.forEach((area) => {
|
|
581
|
-
const line = this._createItem(area.color, area.data.map((c) => ({
|
|
582
|
-
value: c,
|
|
583
|
-
symbol: 'none'
|
|
584
|
-
})));
|
|
585
|
-
this.series.push(line);
|
|
586
|
-
});
|
|
587
|
-
// handel line
|
|
588
|
-
const seriesItem = this._createSeriesItem(this.line.data.map((item) => ({
|
|
589
|
-
value: item.value,
|
|
590
|
-
symbol: 'none'
|
|
591
|
-
})));
|
|
592
|
-
this.series.push(seriesItem);
|
|
593
|
-
}
|
|
594
|
-
_scaleDownLineData() {
|
|
595
|
-
const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
|
|
596
|
-
return this.line.data.forEach((dataItem) => {
|
|
597
|
-
dataItem.value *= 6 / maxValue;
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
_createSeriesItem(data) {
|
|
601
|
-
return {
|
|
602
|
-
type: 'line',
|
|
603
|
-
data,
|
|
604
|
-
lineStyle: { width: 1 },
|
|
605
|
-
color: this.line?.color || 'black',
|
|
606
|
-
label: {
|
|
607
|
-
show: false
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
_createItem(color = '', data, name = 'none', stack = 'none') {
|
|
612
|
-
return {
|
|
613
|
-
name,
|
|
614
|
-
type: 'line',
|
|
615
|
-
stack,
|
|
616
|
-
areaStyle: {
|
|
617
|
-
color
|
|
618
|
-
},
|
|
619
|
-
itemStyle: {
|
|
620
|
-
color
|
|
621
|
-
},
|
|
622
|
-
emphasis: {
|
|
623
|
-
focus: 'series'
|
|
624
|
-
},
|
|
625
|
-
data
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
632
|
-
type: Directive,
|
|
633
|
-
args: [{
|
|
634
|
-
selector: '[beMicroChartArea]'
|
|
635
|
-
}]
|
|
636
|
-
}], ctorParameters:
|
|
637
|
-
type: Input
|
|
638
|
-
}], line: [{
|
|
639
|
-
type: Input
|
|
556
|
+
class MicroChartAreaBaseDirective extends MicroChartBaseDirective {
|
|
557
|
+
constructor(_el, renderer2) {
|
|
558
|
+
super(_el, renderer2);
|
|
559
|
+
this._el = _el;
|
|
560
|
+
this.renderer2 = renderer2;
|
|
561
|
+
this.areas = [];
|
|
562
|
+
}
|
|
563
|
+
/* eslint-disable */
|
|
564
|
+
setOptions(options) {
|
|
565
|
+
this._scaleDownLineData();
|
|
566
|
+
// set custom xAxis
|
|
567
|
+
this.xAxis.type = 'category';
|
|
568
|
+
this.line.data.forEach((item) => {
|
|
569
|
+
this.xAxis?.data?.push(item.label);
|
|
570
|
+
});
|
|
571
|
+
this.xAxis.max = undefined;
|
|
572
|
+
this.xAxis.boundaryGap = false;
|
|
573
|
+
// set custom yAxis
|
|
574
|
+
this.yAxis.splitLine = { show: false };
|
|
575
|
+
this.yAxis.type = 'value';
|
|
576
|
+
this.yAxis.splitNumber = 3;
|
|
577
|
+
this.yAxis.min = 0;
|
|
578
|
+
this.yAxis.max = 6;
|
|
579
|
+
// handel area
|
|
580
|
+
this.areas.forEach((area) => {
|
|
581
|
+
const line = this._createItem(area.color, area.data.map((c) => ({
|
|
582
|
+
value: c,
|
|
583
|
+
symbol: 'none'
|
|
584
|
+
})));
|
|
585
|
+
this.series.push(line);
|
|
586
|
+
});
|
|
587
|
+
// handel line
|
|
588
|
+
const seriesItem = this._createSeriesItem(this.line.data.map((item) => ({
|
|
589
|
+
value: item.value,
|
|
590
|
+
symbol: 'none'
|
|
591
|
+
})));
|
|
592
|
+
this.series.push(seriesItem);
|
|
593
|
+
}
|
|
594
|
+
_scaleDownLineData() {
|
|
595
|
+
const maxValue = Math.max.apply(Math, this.line.data.map((dataItem) => dataItem.value));
|
|
596
|
+
return this.line.data.forEach((dataItem) => {
|
|
597
|
+
dataItem.value *= 6 / maxValue;
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
_createSeriesItem(data) {
|
|
601
|
+
return {
|
|
602
|
+
type: 'line',
|
|
603
|
+
data,
|
|
604
|
+
lineStyle: { width: 1 },
|
|
605
|
+
color: this.line?.color || 'black',
|
|
606
|
+
label: {
|
|
607
|
+
show: false
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
_createItem(color = '', data, name = 'none', stack = 'none') {
|
|
612
|
+
return {
|
|
613
|
+
name,
|
|
614
|
+
type: 'line',
|
|
615
|
+
stack,
|
|
616
|
+
areaStyle: {
|
|
617
|
+
color
|
|
618
|
+
},
|
|
619
|
+
itemStyle: {
|
|
620
|
+
color
|
|
621
|
+
},
|
|
622
|
+
emphasis: {
|
|
623
|
+
focus: 'series'
|
|
624
|
+
},
|
|
625
|
+
data
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartAreaBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
629
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartAreaBaseDirective, selector: "[beMicroChartArea]", inputs: { areas: "areas", line: "line" }, usesInheritance: true, ngImport: i0 }); }
|
|
630
|
+
}
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartAreaBaseDirective, decorators: [{
|
|
632
|
+
type: Directive,
|
|
633
|
+
args: [{
|
|
634
|
+
selector: '[beMicroChartArea]'
|
|
635
|
+
}]
|
|
636
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { areas: [{
|
|
637
|
+
type: Input
|
|
638
|
+
}], line: [{
|
|
639
|
+
type: Input
|
|
640
640
|
}] } });
|
|
641
641
|
|
|
642
|
-
class MicroChartAreaComponent extends BaseComponent {
|
|
643
|
-
constructor(el) {
|
|
644
|
-
super();
|
|
645
|
-
this.el = el;
|
|
646
|
-
}
|
|
647
|
-
ngOnInit() {
|
|
648
|
-
super.ngOnInit();
|
|
649
|
-
this.suffix = this.chartData?.line?.suffix;
|
|
650
|
-
this.getFirstAndLastValues();
|
|
651
|
-
}
|
|
652
|
-
getFirstAndLastValues() {
|
|
653
|
-
const dataLength = this.chartData.line.data.length;
|
|
654
|
-
this.firstValue = this.chartData.line.data[0].value.toString();
|
|
655
|
-
this.lastValue = this.chartData.line.data[dataLength - 1].value.toString();
|
|
656
|
-
this.firstLabel = this.chartData.line.data[0].label;
|
|
657
|
-
this.lastLabel = this.chartData.line.data[dataLength - 1].label;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
663
|
-
type: Component,
|
|
664
|
-
args: [{ selector: 'be-micro-chart-area', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"right-labels\"
|
|
665
|
-
}], ctorParameters:
|
|
666
|
-
type: Input
|
|
667
|
-
}], chartData: [{
|
|
668
|
-
type: Input
|
|
642
|
+
class MicroChartAreaComponent extends BaseComponent {
|
|
643
|
+
constructor(el) {
|
|
644
|
+
super();
|
|
645
|
+
this.el = el;
|
|
646
|
+
}
|
|
647
|
+
ngOnInit() {
|
|
648
|
+
super.ngOnInit();
|
|
649
|
+
this.suffix = this.chartData?.line?.suffix;
|
|
650
|
+
this.getFirstAndLastValues();
|
|
651
|
+
}
|
|
652
|
+
getFirstAndLastValues() {
|
|
653
|
+
const dataLength = this.chartData.line.data.length;
|
|
654
|
+
this.firstValue = this.chartData.line.data[0].value.toString();
|
|
655
|
+
this.lastValue = this.chartData.line.data[dataLength - 1].value.toString();
|
|
656
|
+
this.firstLabel = this.chartData.line.data[0].label;
|
|
657
|
+
this.lastLabel = this.chartData.line.data[dataLength - 1].label;
|
|
658
|
+
}
|
|
659
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartAreaComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
660
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: MicroChartAreaComponent, selector: "be-micro-chart-area", inputs: { size: "size", chartData: "chartData" }, usesInheritance: true, ngImport: i0, template: "@if (size === 'l') {\r\n<div class=\"right-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ chartData?.line?.suffix }}</span>\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n</div>\r\n} @if (size === 's') {\r\n<div class=\"top-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n</div>\r\n}\r\n\r\n<div *untilInView=\"el\" beMicroChartArea [areas]=\"chartData.areas\" [line]=\"chartData.line\"></div>\r\n\r\n@if (size === 'l') {\r\n<div class=\"left-labels\">\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n} @if (size === 's') {\r\n<div class=\"bottom-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n}\r\n", styles: [":host{display:block;width:100%;height:100%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}.right-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:right}.left-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:left}\n"], dependencies: [{ kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartAreaBaseDirective, selector: "[beMicroChartArea]", inputs: ["areas", "line"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
661
|
+
}
|
|
662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartAreaComponent, decorators: [{
|
|
663
|
+
type: Component,
|
|
664
|
+
args: [{ selector: 'be-micro-chart-area', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (size === 'l') {\r\n<div class=\"right-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ chartData?.line?.suffix }}</span>\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n</div>\r\n} @if (size === 's') {\r\n<div class=\"top-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n</div>\r\n}\r\n\r\n<div *untilInView=\"el\" beMicroChartArea [areas]=\"chartData.areas\" [line]=\"chartData.line\"></div>\r\n\r\n@if (size === 'l') {\r\n<div class=\"left-labels\">\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstValue }}{{ suffix }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n} @if (size === 's') {\r\n<div class=\"bottom-labels\">\r\n <span [style.color]=\"chartData.lastValueColor\">{{ lastLabel }}</span>\r\n <span [style.color]=\"chartData.firstValueColor\">{{ firstLabel }}</span>\r\n</div>\r\n}\r\n", styles: [":host{display:block;width:100%;height:100%}span{margin:0;font-size:10px}.top-labels{width:100%;height:23%;display:flex;justify-content:space-between}.bottom-labels{width:100%;height:25%;display:flex;justify-content:space-between}.right-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:right}.left-labels{min-width:40px;display:flex;flex-direction:column;justify-content:space-between;text-align:left}\n"] }]
|
|
665
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { size: [{
|
|
666
|
+
type: Input
|
|
667
|
+
}], chartData: [{
|
|
668
|
+
type: Input
|
|
669
669
|
}] } });
|
|
670
670
|
|
|
671
|
-
class MicroChartBarBaseDirective extends MicroChartBaseDirective {
|
|
672
|
-
constructor(_el, renderer2) {
|
|
673
|
-
super(_el, renderer2);
|
|
674
|
-
this._el = _el;
|
|
675
|
-
this.renderer2 = renderer2;
|
|
676
|
-
}
|
|
677
|
-
setOptions(options) {
|
|
678
|
-
// initialize series
|
|
679
|
-
this._initSeries(options);
|
|
680
|
-
// set custom grid
|
|
681
|
-
this.grid.bottom = 20;
|
|
682
|
-
// set custom xAxis
|
|
683
|
-
this.xAxis.type = 'category';
|
|
684
|
-
this.xAxis.max = undefined;
|
|
685
|
-
if (this.xAxis.axisLabel) {
|
|
686
|
-
this.xAxis.axisLabel.show = true;
|
|
687
|
-
}
|
|
688
|
-
this.data.forEach((dataItem) => {
|
|
689
|
-
this?.xAxis?.data?.push(dataItem.label);
|
|
690
|
-
const dataSeriesItem = { value: dataItem.value, itemStyle: { color: dataItem.color } };
|
|
691
|
-
options.series[0].data.push(dataSeriesItem);
|
|
692
|
-
});
|
|
693
|
-
// set custom yAxis
|
|
694
|
-
this.yAxis.type = 'value';
|
|
695
|
-
}
|
|
696
|
-
_initSeries(options) {
|
|
697
|
-
options.series = [
|
|
698
|
-
{
|
|
699
|
-
type: 'bar',
|
|
700
|
-
data: []
|
|
701
|
-
}
|
|
702
|
-
];
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
708
|
-
type: Directive,
|
|
709
|
-
args: [{
|
|
710
|
-
selector: '[beMicroChartBar]'
|
|
711
|
-
}]
|
|
712
|
-
}], ctorParameters:
|
|
713
|
-
type: Input
|
|
671
|
+
class MicroChartBarBaseDirective extends MicroChartBaseDirective {
|
|
672
|
+
constructor(_el, renderer2) {
|
|
673
|
+
super(_el, renderer2);
|
|
674
|
+
this._el = _el;
|
|
675
|
+
this.renderer2 = renderer2;
|
|
676
|
+
}
|
|
677
|
+
setOptions(options) {
|
|
678
|
+
// initialize series
|
|
679
|
+
this._initSeries(options);
|
|
680
|
+
// set custom grid
|
|
681
|
+
this.grid.bottom = 20;
|
|
682
|
+
// set custom xAxis
|
|
683
|
+
this.xAxis.type = 'category';
|
|
684
|
+
this.xAxis.max = undefined;
|
|
685
|
+
if (this.xAxis.axisLabel) {
|
|
686
|
+
this.xAxis.axisLabel.show = true;
|
|
687
|
+
}
|
|
688
|
+
this.data.forEach((dataItem) => {
|
|
689
|
+
this?.xAxis?.data?.push(dataItem.label);
|
|
690
|
+
const dataSeriesItem = { value: dataItem.value, itemStyle: { color: dataItem.color } };
|
|
691
|
+
options.series[0].data.push(dataSeriesItem);
|
|
692
|
+
});
|
|
693
|
+
// set custom yAxis
|
|
694
|
+
this.yAxis.type = 'value';
|
|
695
|
+
}
|
|
696
|
+
_initSeries(options) {
|
|
697
|
+
options.series = [
|
|
698
|
+
{
|
|
699
|
+
type: 'bar',
|
|
700
|
+
data: []
|
|
701
|
+
}
|
|
702
|
+
];
|
|
703
|
+
}
|
|
704
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBarBaseDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
705
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: MicroChartBarBaseDirective, selector: "[beMicroChartBar]", inputs: { data: "data" }, usesInheritance: true, ngImport: i0 }); }
|
|
706
|
+
}
|
|
707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBarBaseDirective, decorators: [{
|
|
708
|
+
type: Directive,
|
|
709
|
+
args: [{
|
|
710
|
+
selector: '[beMicroChartBar]'
|
|
711
|
+
}]
|
|
712
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { data: [{
|
|
713
|
+
type: Input
|
|
714
714
|
}] } });
|
|
715
715
|
|
|
716
|
-
class MicroChartBarComponent extends BaseComponent {
|
|
717
|
-
constructor(el) {
|
|
718
|
-
super();
|
|
719
|
-
this.el = el;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
725
|
-
type: Component,
|
|
726
|
-
args: [{ selector: 'be-micro-chart-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartBar [ngClass]=\"size === 'l' ? 'flex-50' : 'flex-100'\" [data]=\"data\"></div>\r\n<div class=\"chart-desc\"
|
|
727
|
-
}], ctorParameters:
|
|
728
|
-
type: Input
|
|
729
|
-
}], size: [{
|
|
730
|
-
type: Input
|
|
731
|
-
}], extraData: [{
|
|
732
|
-
type: Input
|
|
716
|
+
class MicroChartBarComponent extends BaseComponent {
|
|
717
|
+
constructor(el) {
|
|
718
|
+
super();
|
|
719
|
+
this.el = el;
|
|
720
|
+
}
|
|
721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBarComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: MicroChartBarComponent, selector: "be-micro-chart-bar", inputs: { data: "data", size: "size", extraData: "extraData" }, usesInheritance: true, ngImport: i0, template: "<div *untilInView=\"el\" beMicroChartBar [ngClass]=\"size === 'l' ? 'flex-50' : 'flex-100'\" [data]=\"data\"></div>\r\n@if (size === 'l') {\r\n<div class=\"chart-desc\">\r\n <h2>{{ extraData.value }}{{ extraData.suffix }}</h2>\r\n</div>\r\n}\r\n", styles: [":host{display:flex;width:100%;height:100%}.flex-50,.flex-100{flex:50%}.chart-desc{flex:50%;display:flex;align-items:flex-end;justify-content:flex-end}.chart-desc h2{margin:0}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }, { kind: "directive", type: MicroChartBarBaseDirective, selector: "[beMicroChartBar]", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
723
|
+
}
|
|
724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: MicroChartBarComponent, decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{ selector: 'be-micro-chart-bar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *untilInView=\"el\" beMicroChartBar [ngClass]=\"size === 'l' ? 'flex-50' : 'flex-100'\" [data]=\"data\"></div>\r\n@if (size === 'l') {\r\n<div class=\"chart-desc\">\r\n <h2>{{ extraData.value }}{{ extraData.suffix }}</h2>\r\n</div>\r\n}\r\n", styles: [":host{display:flex;width:100%;height:100%}.flex-50,.flex-100{flex:50%}.chart-desc{flex:50%;display:flex;align-items:flex-end;justify-content:flex-end}.chart-desc h2{margin:0}\n"] }]
|
|
727
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { data: [{
|
|
728
|
+
type: Input
|
|
729
|
+
}], size: [{
|
|
730
|
+
type: Input
|
|
731
|
+
}], extraData: [{
|
|
732
|
+
type: Input
|
|
733
733
|
}] } });
|
|
734
734
|
|
|
735
|
-
class ChartLineTimeBaseDirective extends ChartBaseDirective {
|
|
736
|
-
constructor(groupbyPipe, _el, renderer2) {
|
|
737
|
-
super(_el, renderer2);
|
|
738
|
-
this.groupbyPipe = groupbyPipe;
|
|
739
|
-
this._el = _el;
|
|
740
|
-
this.renderer2 = renderer2;
|
|
741
|
-
this.xAxis = [];
|
|
742
|
-
this.yAxis = [];
|
|
743
|
-
}
|
|
744
|
-
ngOnChanges(changes) {
|
|
745
|
-
super.ngOnChanges(changes);
|
|
746
|
-
const { chartOption } = changes;
|
|
747
|
-
if (chartOption) {
|
|
748
|
-
let options = chartOption.currentValue;
|
|
749
|
-
options = {
|
|
750
|
-
...options,
|
|
751
|
-
toolbox: {
|
|
752
|
-
feature: {
|
|
753
|
-
dataZoom: {
|
|
754
|
-
yAxisIndex: 'none'
|
|
755
|
-
},
|
|
756
|
-
restore: {},
|
|
757
|
-
saveAsImage: {}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
this._setTooltipFormatter(options, 'series', 'tooltip');
|
|
762
|
-
this._setTooltipFormatter(options, 'xAxis', 'axisLabel');
|
|
763
|
-
this._setTooltipFormatter(options, 'yAxis', 'tooltip');
|
|
764
|
-
if (!chartOption.firstChange) {
|
|
765
|
-
this._renderChart();
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
setOptions(options) {
|
|
770
|
-
this.options = {
|
|
771
|
-
...options,
|
|
772
|
-
...this.chartOption,
|
|
773
|
-
toolbox: {
|
|
774
|
-
feature: {
|
|
775
|
-
dataZoom: {
|
|
776
|
-
yAxisIndex: 'none'
|
|
777
|
-
},
|
|
778
|
-
restore: {},
|
|
779
|
-
saveAsImage: {}
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
// set input data
|
|
784
|
-
}
|
|
785
|
-
_setTooltipFormatter(options, prop, prop2) {
|
|
786
|
-
const arr = options[prop];
|
|
787
|
-
if (Array.isArray(arr)) {
|
|
788
|
-
arr.forEach((c) => {
|
|
789
|
-
const obj2 = c[prop2];
|
|
790
|
-
if (obj2 &&
|
|
791
|
-
obj2.formatter &&
|
|
792
|
-
(obj2.formatter.indexOf('=>') > -1 || obj2.formatter.indexOf('function') > -1)) {
|
|
793
|
-
// eslint-disable-next-line no-eval
|
|
794
|
-
obj2.formatter = eval(obj2.formatter);
|
|
795
|
-
}
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
803
|
-
type: Directive,
|
|
804
|
-
args: [{
|
|
805
|
-
selector: '[beChartLineTime]'
|
|
806
|
-
}]
|
|
807
|
-
}], ctorParameters:
|
|
808
|
-
type: Input
|
|
735
|
+
class ChartLineTimeBaseDirective extends ChartBaseDirective {
|
|
736
|
+
constructor(groupbyPipe, _el, renderer2) {
|
|
737
|
+
super(_el, renderer2);
|
|
738
|
+
this.groupbyPipe = groupbyPipe;
|
|
739
|
+
this._el = _el;
|
|
740
|
+
this.renderer2 = renderer2;
|
|
741
|
+
this.xAxis = [];
|
|
742
|
+
this.yAxis = [];
|
|
743
|
+
}
|
|
744
|
+
ngOnChanges(changes) {
|
|
745
|
+
super.ngOnChanges(changes);
|
|
746
|
+
const { chartOption } = changes;
|
|
747
|
+
if (chartOption) {
|
|
748
|
+
let options = chartOption.currentValue;
|
|
749
|
+
options = {
|
|
750
|
+
...options,
|
|
751
|
+
toolbox: {
|
|
752
|
+
feature: {
|
|
753
|
+
dataZoom: {
|
|
754
|
+
yAxisIndex: 'none'
|
|
755
|
+
},
|
|
756
|
+
restore: {},
|
|
757
|
+
saveAsImage: {}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
this._setTooltipFormatter(options, 'series', 'tooltip');
|
|
762
|
+
this._setTooltipFormatter(options, 'xAxis', 'axisLabel');
|
|
763
|
+
this._setTooltipFormatter(options, 'yAxis', 'tooltip');
|
|
764
|
+
if (!chartOption.firstChange) {
|
|
765
|
+
this._renderChart();
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
setOptions(options) {
|
|
770
|
+
this.options = {
|
|
771
|
+
...options,
|
|
772
|
+
...this.chartOption,
|
|
773
|
+
toolbox: {
|
|
774
|
+
feature: {
|
|
775
|
+
dataZoom: {
|
|
776
|
+
yAxisIndex: 'none'
|
|
777
|
+
},
|
|
778
|
+
restore: {},
|
|
779
|
+
saveAsImage: {}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
// set input data
|
|
784
|
+
}
|
|
785
|
+
_setTooltipFormatter(options, prop, prop2) {
|
|
786
|
+
const arr = options[prop];
|
|
787
|
+
if (Array.isArray(arr)) {
|
|
788
|
+
arr.forEach((c) => {
|
|
789
|
+
const obj2 = c[prop2];
|
|
790
|
+
if (obj2 &&
|
|
791
|
+
obj2.formatter &&
|
|
792
|
+
(obj2.formatter.indexOf('=>') > -1 || obj2.formatter.indexOf('function') > -1)) {
|
|
793
|
+
// eslint-disable-next-line no-eval
|
|
794
|
+
obj2.formatter = eval(obj2.formatter);
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ChartLineTimeBaseDirective, deps: [{ token: i1.GroupByPipe }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
800
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.5", type: ChartLineTimeBaseDirective, selector: "[beChartLineTime]", inputs: { chartOption: "chartOption" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
|
|
801
|
+
}
|
|
802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: ChartLineTimeBaseDirective, decorators: [{
|
|
803
|
+
type: Directive,
|
|
804
|
+
args: [{
|
|
805
|
+
selector: '[beChartLineTime]'
|
|
806
|
+
}]
|
|
807
|
+
}], ctorParameters: () => [{ type: i1.GroupByPipe }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { chartOption: [{
|
|
808
|
+
type: Input
|
|
809
809
|
}] } });
|
|
810
810
|
|
|
811
|
-
const components = [
|
|
812
|
-
MicroChartComparisonComponent,
|
|
813
|
-
MicroChartAreaComponent,
|
|
814
|
-
MicroChartBarComponent,
|
|
815
|
-
MicroChartAreaComponent,
|
|
816
|
-
MicroChartStackbarComponent,
|
|
817
|
-
MicroChartCircularComponent,
|
|
818
|
-
MicroChartLineComponent,
|
|
819
|
-
MicroChartAreaBaseDirective,
|
|
820
|
-
MicroChartLineBaseDirective,
|
|
821
|
-
MicroChartStackbarBaseDirective,
|
|
822
|
-
MicroChartComparisonBaseDirective,
|
|
823
|
-
MicroChartCircularComponent,
|
|
824
|
-
MicroChartBarBaseDirective,
|
|
825
|
-
MicroChartCircularBaseDirective,
|
|
826
|
-
MicroChartBulletComponent,
|
|
827
|
-
ChartLineTimeBaseDirective
|
|
828
|
-
];
|
|
829
|
-
class BarsaEchartsModule {
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
865
|
-
type: NgModule,
|
|
866
|
-
args: [{
|
|
867
|
-
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA],
|
|
868
|
-
imports: [CommonModule, BarsaNovinRayCoreModule],
|
|
869
|
-
declarations: [...components],
|
|
870
|
-
exports: [...components]
|
|
871
|
-
}]
|
|
811
|
+
const components = [
|
|
812
|
+
MicroChartComparisonComponent,
|
|
813
|
+
MicroChartAreaComponent,
|
|
814
|
+
MicroChartBarComponent,
|
|
815
|
+
MicroChartAreaComponent,
|
|
816
|
+
MicroChartStackbarComponent,
|
|
817
|
+
MicroChartCircularComponent,
|
|
818
|
+
MicroChartLineComponent,
|
|
819
|
+
MicroChartAreaBaseDirective,
|
|
820
|
+
MicroChartLineBaseDirective,
|
|
821
|
+
MicroChartStackbarBaseDirective,
|
|
822
|
+
MicroChartComparisonBaseDirective,
|
|
823
|
+
MicroChartCircularComponent,
|
|
824
|
+
MicroChartBarBaseDirective,
|
|
825
|
+
MicroChartCircularBaseDirective,
|
|
826
|
+
MicroChartBulletComponent,
|
|
827
|
+
ChartLineTimeBaseDirective
|
|
828
|
+
];
|
|
829
|
+
class BarsaEchartsModule {
|
|
830
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: BarsaEchartsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
831
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.5", ngImport: i0, type: BarsaEchartsModule, declarations: [MicroChartComparisonComponent,
|
|
832
|
+
MicroChartAreaComponent,
|
|
833
|
+
MicroChartBarComponent,
|
|
834
|
+
MicroChartAreaComponent,
|
|
835
|
+
MicroChartStackbarComponent,
|
|
836
|
+
MicroChartCircularComponent,
|
|
837
|
+
MicroChartLineComponent,
|
|
838
|
+
MicroChartAreaBaseDirective,
|
|
839
|
+
MicroChartLineBaseDirective,
|
|
840
|
+
MicroChartStackbarBaseDirective,
|
|
841
|
+
MicroChartComparisonBaseDirective,
|
|
842
|
+
MicroChartCircularComponent,
|
|
843
|
+
MicroChartBarBaseDirective,
|
|
844
|
+
MicroChartCircularBaseDirective,
|
|
845
|
+
MicroChartBulletComponent,
|
|
846
|
+
ChartLineTimeBaseDirective], imports: [CommonModule, BarsaNovinRayCoreModule], exports: [MicroChartComparisonComponent,
|
|
847
|
+
MicroChartAreaComponent,
|
|
848
|
+
MicroChartBarComponent,
|
|
849
|
+
MicroChartAreaComponent,
|
|
850
|
+
MicroChartStackbarComponent,
|
|
851
|
+
MicroChartCircularComponent,
|
|
852
|
+
MicroChartLineComponent,
|
|
853
|
+
MicroChartAreaBaseDirective,
|
|
854
|
+
MicroChartLineBaseDirective,
|
|
855
|
+
MicroChartStackbarBaseDirective,
|
|
856
|
+
MicroChartComparisonBaseDirective,
|
|
857
|
+
MicroChartCircularComponent,
|
|
858
|
+
MicroChartBarBaseDirective,
|
|
859
|
+
MicroChartCircularBaseDirective,
|
|
860
|
+
MicroChartBulletComponent,
|
|
861
|
+
ChartLineTimeBaseDirective] }); }
|
|
862
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: BarsaEchartsModule, imports: [CommonModule, BarsaNovinRayCoreModule] }); }
|
|
863
|
+
}
|
|
864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: BarsaEchartsModule, decorators: [{
|
|
865
|
+
type: NgModule,
|
|
866
|
+
args: [{
|
|
867
|
+
schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA],
|
|
868
|
+
imports: [CommonModule, BarsaNovinRayCoreModule],
|
|
869
|
+
declarations: [...components],
|
|
870
|
+
exports: [...components]
|
|
871
|
+
}]
|
|
872
872
|
}] });
|
|
873
873
|
|
|
874
|
-
/**
|
|
875
|
-
* Generated bundle index. Do not edit.
|
|
874
|
+
/**
|
|
875
|
+
* Generated bundle index. Do not edit.
|
|
876
876
|
*/
|
|
877
877
|
|
|
878
878
|
export { BarsaEchartsModule, ChartLineTimeBaseDirective, MicroChartAreaBaseDirective, MicroChartAreaComponent, MicroChartBarBaseDirective, MicroChartBarComponent, MicroChartBulletComponent, MicroChartCircularBaseDirective, MicroChartCircularComponent, MicroChartComparisonBaseDirective, MicroChartComparisonComponent, MicroChartLineBaseDirective, MicroChartLineComponent, MicroChartStackbarBaseDirective, MicroChartStackbarComponent };
|