Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(igniteui-angular): add Category and Financial Chart templates
- Loading branch information
1 parent
1bdc2ba
commit 1ac7eba
Showing
13 changed files
with
1,449 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...lates/angular/igx-ts/category-chart/default/files/src/app/__path__/__name__.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:host { | ||
width: 100%; | ||
padding: 0 24px; | ||
} |
21 changes: 21 additions & 0 deletions
21
...ates/angular/igx-ts/category-chart/default/files/src/app/__path__/__name__.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<p>$(description)</p> | ||
<div> | ||
<span>Chart Type:</span> | ||
<select [(ngModel)]="chartType"> | ||
<option>Auto</option> | ||
<option>Area</option> | ||
<option>Line</option> | ||
<option>Column</option> | ||
<option>Point</option> | ||
<option>Spline</option> | ||
<option>SplineArea</option> | ||
<option>StepArea</option> | ||
<option>StepLine</option> | ||
<option>Waterfall</option> | ||
</select> | ||
</div> | ||
<igx-category-chart height="600px" width="100%" | ||
chartTitle="Population per Country (millions)" | ||
[chartType]="chartType" | ||
[dataSource]="data"> | ||
</igx-category-chart> |
29 changes: 29 additions & 0 deletions
29
...s/angular/igx-ts/category-chart/default/files/src/app/__path__/__name__.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { FormsModule } from '@angular/forms'; | ||
|
||
import { $(ClassName)Component } from './$(filePrefix).component'; | ||
import { IgxCategoryChartModule } from 'igniteui-angular-charts/ES5/igx-category-chart-module'; | ||
|
||
describe('$(ClassName)Component', () => { | ||
let component: $(ClassName)Component; | ||
let fixture: ComponentFixture<$(ClassName)Component>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [$(ClassName)Component], | ||
imports: [FormsModule, IgxCategoryChartModule] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent($(ClassName)Component); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', done => { | ||
expect(component).toBeTruthy(); | ||
fixture.whenStable().then(done); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
templates/angular/igx-ts/category-chart/default/files/src/app/__path__/__name__.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component, ViewEncapsulation } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-$(filePrefix)', | ||
templateUrl: './$(filePrefix).component.html', | ||
styleUrls: ['./$(filePrefix).component.css'] | ||
}) | ||
export class $(ClassName)Component { | ||
public chartType: string = "Auto"; | ||
|
||
data = [ | ||
{ "CountryName": "China", "Pop1995": 1216, "Pop2005": 1297, }, | ||
{ "CountryName": "India", "Pop1995": 920, "Pop2005": 1090, }, | ||
{ "CountryName": "United States", "Pop1995": 266, "Pop2005": 295, }, | ||
{ "CountryName": "Indonesia", "Pop1995": 197, "Pop2005": 229, }, | ||
{ "CountryName": "Brazil", "Pop1995": 161, "Pop2005": 186, } | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { IgniteUIForAngularTemplate } from "../../../../../lib/templates/IgniteUIForAngularTemplate"; | ||
|
||
class IgxCategoryChartTemplate extends IgniteUIForAngularTemplate { | ||
constructor() { | ||
super(__dirname); | ||
this.components = ["Category Chart"]; | ||
this.controlGroup = "Charts"; | ||
this.listInComponentTemplates = true; | ||
this.id = "category-chart"; | ||
this.projectType = "igx-ts"; | ||
this.name = "Category Chart"; | ||
this.description = "Basic Category chart with chart type selector."; | ||
this.dependencies = [ | ||
{ import: "IgxCategoryChartModule", from: "igniteui-angular-charts/ES5/igx-category-chart-module" }, | ||
{import: "FormsModule", from: "@angular/forms"} | ||
]; | ||
this.packages = ["tslib", "igniteui-angular-charts"]; | ||
} | ||
} | ||
module.exports = new IgxCategoryChartTemplate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import { BaseComponent } from "../../../../lib/BaseComponent"; | ||
|
||
class IgxCategoryChartComponent extends BaseComponent { | ||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(__dirname); | ||
this.name = "Category Chart"; | ||
this.group = "Charts"; | ||
} | ||
} | ||
module.exports = new IgxCategoryChartComponent(); |
4 changes: 4 additions & 0 deletions
4
...ates/angular/igx-ts/financial-chart/default/files/src/app/__path__/__name__.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:host { | ||
width: 100%; | ||
padding: 0 24px; | ||
} |
3 changes: 3 additions & 0 deletions
3
...tes/angular/igx-ts/financial-chart/default/files/src/app/__path__/__name__.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p>$(description)</p> | ||
<igx-financial-chart [dataSource]="data" height="600px" width="100%"> | ||
</igx-financial-chart> |
28 changes: 28 additions & 0 deletions
28
.../angular/igx-ts/financial-chart/default/files/src/app/__path__/__name__.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { $(ClassName)Component } from './$(filePrefix).component'; | ||
import { IgxFinancialChartModule } from 'igniteui-angular-charts/ES5/igx-financial-chart-module'; | ||
|
||
describe('$(ClassName)Component', () => { | ||
let component: $(ClassName)Component; | ||
let fixture: ComponentFixture<$(ClassName)Component>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [$(ClassName)Component], | ||
imports: [IgxFinancialChartModule] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent($(ClassName)Component); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', done => { | ||
expect(component).toBeTruthy(); | ||
fixture.whenStable().then(done); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
...lates/angular/igx-ts/financial-chart/default/files/src/app/__path__/__name__.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Component } from '@angular/core'; | ||
import { AMZNData } from "./data"; | ||
|
||
@Component({ | ||
selector: 'app-$(filePrefix)', | ||
templateUrl: './$(filePrefix).component.html', | ||
styleUrls: ['./$(filePrefix).component.css'] | ||
}) | ||
export class $(ClassName)Component { | ||
|
||
public data = AMZNData; | ||
|
||
} |
Oops, something went wrong.