Skip to content

Commit 44a0dc8

Browse files
author
pipeline
committed
feature(EJ2-4114): fabric theme for chart changed
1 parent f17119d commit 44a0dc8

File tree

103 files changed

+251
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+251
-82
lines changed

src/chart/area-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/chart/area.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, ViewEncapsulation } from '@angular/core';
2+
import { ILoadedEventArgs } from '@syncfusion/ej2-ng-charts';
23

34
/**
45
* Area Series
@@ -45,6 +46,10 @@ export class AreaChartComponent {
4546
majorTickLines: { width: 0 },
4647
labelFormat: '{value}M'
4748
};
49+
public load(args: ILoadedEventArgs): void {
50+
let selectedTheme: string = location.hash.split('/')[1];
51+
args.chart.theme = (selectedTheme && selectedTheme.indexOf('fabric') > -1) ? 'Fabric' : 'Material';
52+
};
4853
public title: string = 'Average Sales Comparison';
4954
constructor() {
5055
// code

src/chart/area.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="control-section">
2-
<ej-chart style='display:block;' [title]='title' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'>
2+
<ej-chart style='display:block;' [title]='title' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis' (load)='load($event)'>
33
<e-series-collection>
44
<e-series [dataSource]='data' type='Area' xName='x' yName='y' name='Product A' opacity=0.5 width=2 border-color='transparent'>
55
</e-series>

src/chart/bar-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/chart/bar.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ViewEncapsulation } from '@angular/core';
2-
2+
import { ILoadedEventArgs } from '@syncfusion/ej2-ng-charts';
33
/**
44
* Bar Series
55
*/
@@ -41,6 +41,10 @@ export class BarChartComponent {
4141
enable: true,
4242
format: '${series.name}<br> ${point.x} : ${point.y}'
4343
};
44+
public load(args: ILoadedEventArgs): void {
45+
let selectedTheme: string = location.hash.split('/')[1];
46+
args.chart.theme = (selectedTheme && selectedTheme.indexOf('fabric') > -1) ? 'Fabric' : 'Material';
47+
};
4448
public title: string = 'UK Trade in Food Groups - 2015';
4549
constructor() {
4650
//code

src/chart/bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="control-section">
22
<div>
33
<ej-chart style='display:block;' id='chartcontainer' [primaryXAxis]='primaryXAxis' [primaryYAxis]='primaryYAxis'
4-
[title]='title' [tooltip]='tooltip'>
4+
[title]='title' [tooltip]='tooltip' (load)='load($event)'>
55
<e-series-collection>
66
<e-series [dataSource]='data' type='Bar' xName='x' yName='y' name='Imports' width=2> </e-series>
77
<e-series [dataSource]='data1' type='Bar' xName='x' yName='y' name='Exports' width=2> </e-series>

src/chart/bubble-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/chart/bubble.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@ export class BubbleChartComponent {
5050
};
5151

5252
public pointRender(args: IPointRenderEventArgs): void {
53-
let seriesColor: string[] = ['#00bdae', '#404041', '#357cd2', '#e56590', '#f8b883', '#70ad47', '#dd8abd', '#7f84e8', '#7bb4eb',
54-
'#ea7a57', '#404041', '#00bdae' ];
55-
args.fill = seriesColor[args.point.index];
53+
let materialColors: string[] = ['#00bdae', '#404041', '#357cd2', '#e56590', '#f8b883', '#70ad47', '#dd8abd', '#7f84e8', '#7bb4eb',
54+
'#ea7a57', '#404041', '#00bdae' ];
55+
let fabricColors: string[] = ['#4472c4', '#ed7d31', '#ffc000', '#70ad47', '#5b9bd5',
56+
'#c1c1c1', '#6f6fe2', '#e269ae', '#9e480e', '#997300', '#4472c4', '#70ad47', '#ffc000', '#ed7d31'];
57+
let selectedTheme: string = location.hash.split('/')[1];
58+
if (selectedTheme && selectedTheme.indexOf('fabric') > -1) {
59+
args.fill = fabricColors[args.point.index];
60+
} else {
61+
args.fill = materialColors[args.point.index];
62+
}
5663
};
5764

5865
public legend: Object = {

src/chart/column-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/chart/column.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ViewEncapsulation } from '@angular/core';
2-
2+
import { ILoadedEventArgs} from '@syncfusion/ej2-ng-charts';
33
/**
44
* Column Series
55
*/
@@ -39,6 +39,10 @@ export class ColumnChartComponent {
3939
enable: true,
4040
format: '${series.name}<br>${point.x} : ${point.y}'
4141
};
42+
public load(args: ILoadedEventArgs): void {
43+
let selectedTheme: string = location.hash.split('/')[1];
44+
args.chart.theme = (selectedTheme && selectedTheme.indexOf('fabric') > -1) ? 'Fabric' : 'Material';
45+
};
4246
constructor() {
4347
//code
4448
};

0 commit comments

Comments
 (0)