Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM node:18
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// These tasks will run in order when initializing your CodeSandbox project.
"setupTasks": [
{
"name": "Install Dependencies",
"command": "yarn install"
}
],
// These tasks can be run from CodeSandbox. Running one will open a log in the app.
"tasks": {
"node node_modules/@angular/cli/bin/ng serve -o --disable-host-check": {
"name": "Start Project",
"command": "node node_modules/@angular/cli/bin/ng serve -o --disable-host-check",
"runAtStart": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"installDependencies":true, "startCommand":"npm start"}
120 changes: 120 additions & 0 deletions samples/charts/dashboard-tile/financial-dashboard/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"demo": {
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/demo",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"stylePreprocessorOptions": {
"includePaths": ["node_modules/"]
}
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "demo:build:production"
},
"development": {
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/assets"
],
"inlineStyleLanguage": "scss",
"stylePreprocessorOptions": {
"includePaths": ["node_modules/"]
}
}
}
}
}
},
"defaultProject": "demo",
"cli": {
"analytics": false
}
}
49 changes: 49 additions & 0 deletions samples/charts/dashboard-tile/financial-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"scripts": {
"ng": "ng",
"update": "ng update",
"start": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng serve -o",
"build": "node --max_old_space_size=12192 node_modules/@angular/cli/bin/ng build --configuration production",
"lint": "ng lint"
},
"dependencies": {
"@angular/animations": "18.2.1",
"@angular/common": "18.2.1",
"@angular/compiler": "18.2.1",
"@angular/core": "18.2.1",
"@angular/forms": "18.2.1",
"@angular/platform-browser": "18.2.1",
"@angular/platform-browser-dynamic": "18.2.1",
"@types/hammerjs": "2.0.40",
"classlist.js": "1.1.20150312",
"hammerjs": "2.0.8",
"igniteui-angular-charts": "18.2.0-beta.1",
"igniteui-angular-core": "18.2.0-beta.1",
"igniteui-angular-dashboards": "18.2.0-beta.1",
"igniteui-angular-gauges": "18.2.0-beta.1",
"igniteui-angular-grids": "18.2.0-beta.1",
"igniteui-angular-inputs": "18.2.0-beta.1",
"igniteui-angular-layouts": "18.2.0-beta.1",
"igniteui-angular-maps": "18.2.0-beta.1",
"intl": "1.2.5",
"jszip": "3.8.0",
"rxjs": "7.8.1",
"tslib": "2.6.1",
"web-animations-js": "2.3.2",
"zone.js": "~0.14.4"
},
"devDependencies": {
"@angular/cli": "18.2.1",
"@angular/compiler-cli": "18.2.1",
"@angular/language-service": "18.2.1",
"@angular-devkit/build-angular": "18.2.1",
"@types/node": "18.17.0",
"codelyzer": "6.0.2",
"jasmine-core": "5.1.1",
"jasmine-spec-reporter": "~4.2.1",
"sass.js": "0.11.1",
"tslint": "~6.1.3",
"ts-node": "10.9.1",
"typescript": "5.5.4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
//begin async data
export class MultipleStocks extends Array<Array<StockItem>> {
public static async fetch(): Promise<MultipleStocks> {
const dataSources: any[] = [
//await this.getAmazonStock(),
await this.getGoogleStock(),
await this.getAmazonStock(),
//await this.getTeslaStock()
];
return new Promise<MultipleStocks>((resolve, reject) => {
resolve(dataSources);
});
}

/** gets Amazon stock OHLC prices from a .JSON file */
public static async getAmazonStock(): Promise<StockItem[]> {
let url = "https://static.infragistics.com/xplatform/data/stocks/stockAmazon.json";
let response = await fetch(url);
let jsonData = await response.json();
let stockData = this.convertData(jsonData);
// setting data intent for Series Title, e.g. FinancialChart usage
(stockData as any).__dataIntents = {
close: ["SeriesTitle/Amazon"]
};
// console.log("fetchAmazonStock: ", stockData.length);

return new Promise<StockItem[]>((resolve, reject) => {
resolve(stockData);
});
}

/** gets Tesla stock OHLC prices from a .JSON file */
public static async getTeslaStock(): Promise<StockItem[]> {
let url = "https://static.infragistics.com/xplatform/data/stocks/stockTesla.json";
let response = await fetch(url);
let jsonData = await response.json();
let stockData = this.convertData(jsonData);
// setting data intent for Series Title, e.g. FinancialChart usage
(stockData as any).__dataIntents = {
close: ["SeriesTitle/Tesla"]
};
return new Promise<StockItem[]>((resolve, reject) => {
resolve(stockData);
});
}

/** gets Microsoft stock OHLC prices from a .JSON file */
public static async getMicrosoftStock(): Promise<StockItem[]> {
let url = "https://static.infragistics.com/xplatform/data/stocks/stockMicrosoft.json";
let response = await fetch(url);
let jsonData = await response.json();
let stockData = this.convertData(jsonData);
// setting data intent for Series Title, e.g. FinancialChart usage
(stockData as any).__dataIntents = {
close: ["SeriesTitle/Microsoft"]
};
return new Promise<StockItem[]>((resolve, reject) => {
resolve(stockData);
});
}

/** gets Google stock OHLC prices from a .JSON file */
public static async getGoogleStock(): Promise<StockItem[]> {
let url = "https://static.infragistics.com/xplatform/data/stocks/stockGoogle.json";
let response = await fetch(url);
let jsonData = await response.json();
let stockData = this.convertData(jsonData);
// setting data intent for Series Title, e.g. FinancialChart usage
(stockData as any).__dataIntents = {
close: ["SeriesTitle/Google"]
};
return new Promise<StockItem[]>((resolve, reject) => {
resolve(stockData);
});
}

public static convertData(jsonData: any[]): StockItem[] {
let stockItems: StockItem[] = [];

for (let json of jsonData) {
let parts = json.date.split("-"); // "2020-01-01"
let item = new StockItem();
item.date = new Date(parts[0], parts[1], parts[2]);
item.open = json.open;
item.high = json.high;
item.low = json.low;
item.close = json.close;
item.volume = json.volume;
stockItems.push(item);

}

return stockItems;
}
}

export class StockItem {
public open?: number;
public close?: number;
public high?: number;
public low?: number;
public volume?: number;

public date?: Date;

}
//end async data
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="container vertical sample">
<div class="container fill">
<igx-dashboard-tile
name="dashboard"
#dashboard
[dataSource]="multipleStocks">
</igx-dashboard-tile>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* styles are loaded the Shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { MultipleStocks } from './MultipleStocks';
import { IgxDashboardTileComponent } from 'igniteui-angular-dashboards';

@Component({
standalone: false,
selector: "app-root",
styleUrls: ["./app.component.scss"],
templateUrl: "./app.component.html",
changeDetection: ChangeDetectionStrategy.OnPush
})

export class AppComponent implements AfterViewInit
{

@ViewChild("dashboard", { static: true } )
private dashboard: IgxDashboardTileComponent
private _multipleStocks: MultipleStocks = null;
private _isFetching: boolean = false;
public get multipleStocks(): MultipleStocks {
if (this._multipleStocks == null && !this._isFetching)
{
this._isFetching = true;
( async () => { this._multipleStocks = await (await MultipleStocks.fetch()); this._detector.markForCheck(); })();
}
return this._multipleStocks;
}

public constructor(private _detector: ChangeDetectorRef)
{
}

public ngAfterViewInit(): void
{
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { CommonModule } from "@angular/common";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { AppComponent } from "./app.component";

import { IgxDashboardTileModule, IgxDataChartDashboardTileModule, IgxGeographicMapDashboardTileModule, IgxLinearGaugeDashboardTileModule, IgxPieChartDashboardTileModule, IgxRadialGaugeDashboardTileModule } from 'igniteui-angular-dashboards';

@NgModule({
bootstrap: [AppComponent],
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
IgxDashboardTileModule,
IgxDataChartDashboardTileModule,
IgxGeographicMapDashboardTileModule,
IgxLinearGaugeDashboardTileModule,
IgxPieChartDashboardTileModule,
IgxRadialGaugeDashboardTileModule
],
providers: [],
schemas: []
})
export class AppModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
};
Loading
Loading