Skip to content

Commit

Permalink
feat(igniteui-angular): add Category and Financial Chart templates
Browse files Browse the repository at this point in the history
  • Loading branch information
damyanpetev committed Apr 25, 2018
1 parent 1bdc2ba commit 1ac7eba
Show file tree
Hide file tree
Showing 13 changed files with 1,449 additions and 0 deletions.
@@ -0,0 +1,4 @@
:host {
width: 100%;
padding: 0 24px;
}
@@ -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>
@@ -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);
});
});
@@ -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, }
];

}
20 changes: 20 additions & 0 deletions templates/angular/igx-ts/category-chart/default/index.ts
@@ -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();
14 changes: 14 additions & 0 deletions templates/angular/igx-ts/category-chart/index.ts
@@ -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();
@@ -0,0 +1,4 @@
:host {
width: 100%;
padding: 0 24px;
}
@@ -0,0 +1,3 @@
<p>$(description)</p>
<igx-financial-chart [dataSource]="data" height="600px" width="100%">
</igx-financial-chart>
@@ -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);
});
});
@@ -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;

}

0 comments on commit 1ac7eba

Please sign in to comment.