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/category-chart/selection-matcher/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
}
}
43 changes: 43 additions & 0 deletions samples/charts/category-chart/selection-matcher/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"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": "19.0.4",
"@angular/common": "19.0.4",
"@angular/compiler": "19.0.4",
"@angular/core": "19.0.4",
"@angular/forms": "19.0.4",
"@angular/platform-browser": "19.0.4",
"@angular/platform-browser-dynamic": "19.0.4",
"@types/hammerjs": "2.0.40",
"classlist.js": "1.1.20150312",
"hammerjs": "2.0.8",
"igniteui-angular-charts": "19.0.0",
"igniteui-angular-core": "19.0.0",
"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.15.0"
},
"devDependencies": {
"@angular/cli": "19.0.4",
"@angular/compiler-cli": "19.0.4",
"@angular/language-service": "19.0.4",
"@angular-devkit/build-angular": "19.0.4",
"@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.6.3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
export class EnergyRenewableConsumptionItem {
public constructor(init: Partial<EnergyRenewableConsumptionItem>) {
Object.assign(this, init);
}

public location: string;
public year: number;
public hydro: number;
public solar: number;
public wind: number;
public other: number;

}
export class EnergyRenewableConsumption extends Array<EnergyRenewableConsumptionItem> {
public constructor(items: Array<EnergyRenewableConsumptionItem> | number = -1) {
if (Array.isArray(items)) {
super(...items);
} else {
const newItems = [
new EnergyRenewableConsumptionItem(
{
location: `China`,
year: 2019,
hydro: 1269.5,
solar: 223,
wind: 405.2,
other: 102.8
}),
new EnergyRenewableConsumptionItem(
{
location: `Europe`,
year: 2019,
hydro: 632.54,
solar: 154,
wind: 461.3,
other: 220.3
}),
new EnergyRenewableConsumptionItem(
{
location: `USA`,
year: 2019,
hydro: 271.16,
solar: 108,
wind: 303.4,
other: 78.34
}),
new EnergyRenewableConsumptionItem(
{
location: `Brazil`,
year: 2019,
hydro: 399.3,
solar: 5.5,
wind: 55.83,
other: 56.25
}),
new EnergyRenewableConsumptionItem(
{
location: `Canada`,
year: 2019,
hydro: 381.98,
solar: 4.3,
wind: 34.17,
other: 10.81
}),
];
super(...newItems.slice(0));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="container vertical sample">
<div class="legend-title">
Renewable Electricity Generated
</div>
<div class="legend">
<igx-legend
name="legend"
#legend
orientation="Horizontal">
</igx-legend>
</div>
<div class="container fill">
<igx-category-chart
name="chart"
#chart
[legend]="legend"
[dataSource]="energyRenewableConsumption"
chartType="Column"
crosshairsDisplayMode="None"
yAxisTitle="TWh"
isHorizontalZoomEnabled="false"
isVerticalZoomEnabled="false"
selectionMode="SelectionColorFill"
selectionBehavior="Auto"
selectionBrush="orange">
</igx-category-chart>
</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,84 @@
import { AfterViewInit, Component, ViewChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { ComponentRenderer, LegendDescriptionModule, CategoryChartDescriptionModule, DataChartAnnotationDescriptionModule, DataChartInteractivityDescriptionModule, DataChartCoreDescriptionModule } from 'igniteui-angular-core';
import { EnergyRenewableConsumptionItem, EnergyRenewableConsumption } from './EnergyRenewableConsumption';
import { IgxCategoryChartComponent, IgxChartSelection, IgxSeriesMatcher } from 'igniteui-angular-charts';
import { IgxLegendComponent } from 'igniteui-angular-charts';

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

export class AppComponent implements AfterViewInit
{

@ViewChild("legend", { static: true } )
private legend: IgxLegendComponent
@ViewChild("chart", { static: true } )
private chart: IgxCategoryChartComponent
private _energyRenewableConsumption: EnergyRenewableConsumption = null;
public get energyRenewableConsumption(): EnergyRenewableConsumption {
if (this._energyRenewableConsumption == null)
{
this._energyRenewableConsumption = new EnergyRenewableConsumption();
}
return this._energyRenewableConsumption;
}

private _componentRenderer: ComponentRenderer = null;
public get renderer(): ComponentRenderer {
if (this._componentRenderer == null) {
this._componentRenderer = new ComponentRenderer();
var context = this._componentRenderer.context;
LegendDescriptionModule.register(context);
CategoryChartDescriptionModule.register(context);
DataChartAnnotationDescriptionModule.register(context);
DataChartInteractivityDescriptionModule.register(context);
DataChartCoreDescriptionModule.register(context);
}
return this._componentRenderer;
}

public constructor(private _detector: ChangeDetectorRef)
{
}

public ngAfterViewInit(): void
{
this.selectionMatcherOnViewInit();
}

private _timer: ReturnType<typeof setInterval>;

public selectionMatcherOnViewInit(): void {

var chart = this.chart;

this._timer = setTimeout(() => {
var data = this.energyRenewableConsumption;
let matcher: IgxSeriesMatcher = new IgxSeriesMatcher();

let selection: IgxChartSelection = new IgxChartSelection();
selection.item = data[1];
matcher.memberPath = "hydro";
matcher.memberPathType = "ValueMemberPath";
selection.matcher = matcher;
chart.selectedSeriesItems.add(selection);

let matcher2: IgxSeriesMatcher = new IgxSeriesMatcher();
let selection2: IgxChartSelection = new IgxChartSelection();
selection2.item = data[2];
matcher2.memberPath = "wind";
matcher2.memberPathType = "ValueMemberPath";
selection2.matcher = matcher2;

chart.selectedSeriesItems.add(selection2);

}, 100);
}

}

Loading