Skip to content

Commit

Permalink
Merge pull request #260 from mgusmano/ext-angular-6.7.x
Browse files Browse the repository at this point in the history
formatting
  • Loading branch information
mgusmano authored Feb 12, 2019
2 parents 01d1b7d + 1626a04 commit 722e300
Show file tree
Hide file tree
Showing 37 changed files with 191 additions and 401 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {createData} from './createData';

declare var Ext: any;
import { Component } from '@angular/core';
import {createData} from './createData';

Ext.require([
'Ext.chart.axis.Numeric',
Expand All @@ -14,129 +13,120 @@ Ext.require([
templateUrl: './OHLC.html',
styles: [``]
})
export class OHLCComponent implements OnInit {
export class OHLCComponent {

constructor() {

this.refresh();
}

ngOnInit() {
isPhone = Ext.os.is.Phone;
store = Ext.create('Ext.data.Store', {
fields: ['time', 'open', 'high', 'low', 'close']
});

theme:string= 'default';
zoom:boolean= false;

panzoom:any;
crosshair:any;

chart:any;

chartNavReady = function(event) {
console.log("chartNavReady");
this.chart = event.ext;
this.panzoom = this.chart.getInteraction('panzoom');
this.crosshair = this.chart.getInteraction('crosshair');
}

isPhone = Ext.os.is.Phone;

refresh = () => {
this.store.loadData(createData(1000));
}

store = Ext.create('Ext.data.Store', {
fields: ['time', 'open', 'high', 'low', 'close']
});

theme:string= 'default';
zoom:boolean= false;

panzoom:any;
crosshair:any;

chart:any;

chartNavReady = function(event) {
console.log("chartNavReady");
this.chart = event.ext;
this.panzoom = this.chart.getInteraction('panzoom');
this.crosshair = this.chart.getInteraction('crosshair');
}


refresh = () => {
this.store.loadData(createData(1000));
}

changeTheme = theme => this.theme = theme;

toggleZoomOnPan = (zoomOnPan) => {
this.toggleCrosshair(false);
this.panzoom.setZoomOnPan(zoomOnPan);
this.zoom = zoomOnPan;
}

toggleCrosshair = (crosshair) => {
this.panzoom.setEnabled(!crosshair);
this.crosshair.setEnabled(crosshair);
if(crosshair){
this.crosshair = crosshair;
}
}


cartesianAxes = [{
type: 'numeric',
fields: ['open', 'high', 'low', 'close'],
position: 'left',
maximum: 1000,
minimum: 0
}, {
type: 'time',
fields: ['time'],
position: 'bottom',
visibleRange: [0, 0.3],
style: {
axisLine: false
}
}];

cartesianSeries = {
type: 'candlestick',
xField: 'time',
openField: 'open',
highField: 'high',
lowField: 'low',
closeField: 'close',
style: {
ohlcType: 'ohlc',
barWidth: 10,
opacity: 0.9,
dropStyle: {
fill: 'rgb(237,123,43)',
stroke: 'rgb(237,123,43)'
},
raiseStyle: {
fill: 'rgb(55,153,19)',
stroke: 'rgb(55,153,19)'
}
},
aggregator: {
strategy: 'time'
}
};


cartesianInteractions = [{
type: 'panzoom',
axes: {
left: {
allowPan: false,
allowZoom: false
},
bottom: {
allowPan: true,
allowZoom: true
}
}
}, {
type: 'crosshair',
axes: {
label: {
fillStyle: 'white'
},
rect: {
fillStyle: '#344459',
opacity: 0.7,
radius: 5
}
}
}];
changeTheme = theme => this.theme = theme;

toggleZoomOnPan = (zoomOnPan) => {
this.toggleCrosshair(false);
this.panzoom.setZoomOnPan(zoomOnPan);
this.zoom = zoomOnPan;
}

toggleCrosshair = (crosshair) => {
this.panzoom.setEnabled(!crosshair);
this.crosshair.setEnabled(crosshair);
if(crosshair){
this.crosshair = crosshair;
}
}


cartesianAxes = [{
type: 'numeric',
fields: ['open', 'high', 'low', 'close'],
position: 'left',
maximum: 1000,
minimum: 0
}, {
type: 'time',
fields: ['time'],
position: 'bottom',
visibleRange: [0, 0.3],
style: {
axisLine: false
}
}];

cartesianSeries = {
type: 'candlestick',
xField: 'time',
openField: 'open',
highField: 'high',
lowField: 'low',
closeField: 'close',
style: {
ohlcType: 'ohlc',
barWidth: 10,
opacity: 0.9,
dropStyle: {
fill: 'rgb(237,123,43)',
stroke: 'rgb(237,123,43)'
},
raiseStyle: {
fill: 'rgb(55,153,19)',
stroke: 'rgb(55,153,19)'
}
},
aggregator: {
strategy: 'time'
}
};


cartesianInteractions = [{
type: 'panzoom',
axes: {
left: {
allowPan: false,
allowZoom: false
},
bottom: {
allowPan: true,
allowZoom: true
}
}
}, {
type: 'crosshair',
axes: {
label: {
fillStyle: 'white'
},
rect: {
fillStyle: '#344459',
opacity: 0.7,
radius: 5
}
}
}];

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {model} from '../../CompanyModel';

declare var Ext: any;

import { Component } from '@angular/core';
import {model} from '../../CompanyModel';

@Component({
selector: 'rowbody-component',
templateUrl: './RowBody.html',
styles: [``]
})
export class RowBodyComponent implements OnInit {
export class RowBodyComponent {

store = Ext.create('Ext.data.Store', {
model,
Expand Down Expand Up @@ -50,12 +48,4 @@ export class RowBodyComponent implements OnInit {
return formattedValue;
}

constructor() { }



ngOnInit() {
}


}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {model} from '../../CompanyModel';

declare var Ext: any;
import { Component } from '@angular/core';
import {model} from '../../CompanyModel';

Ext.require([
'Ext.grid.plugin.SummaryRow',
Expand All @@ -14,7 +13,7 @@ Ext.require([
templateUrl: './SummaryRow.html',
styles: [``]
})
export class SummaryRowComponent implements OnInit {
export class SummaryRowComponent {

store = Ext.create('Ext.data.Store', {
model,
Expand All @@ -39,13 +38,5 @@ export class SummaryRowComponent implements OnInit {
} ;

summarizeCompanies = (grid, context) => context.records.length + ' Companies';

constructor() { }



ngOnInit() {
}


}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import {model} from '../../CompanyModel';

declare var Ext: any;
import { Component } from '@angular/core';
import {model} from '../../CompanyModel';

Ext.require(['Ext.grid.plugin.ViewOptions']);

Expand All @@ -10,7 +9,7 @@ Ext.require(['Ext.grid.plugin.ViewOptions']);
templateUrl: './ViewOptions.html',
styles: [``]
})
export class ViewOptionsComponent implements OnInit {
export class ViewOptionsComponent {

toolbarHtml = `
<div style="fontSize:'14px';fontWeight: 'normal';">Long press on a column header to customize this grid.</div>
Expand All @@ -25,8 +24,6 @@ export class ViewOptionsComponent implements OnInit {
}
});

constructor() { }

renderSign = (format, value) => {
var formattedValue = Ext.util.Format.number(value, format);
var color = "";
Expand All @@ -39,8 +36,4 @@ export class ViewOptionsComponent implements OnInit {
return formattedValue;
} ;

ngOnInit() {
}


}
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';

declare var Ext: any;
import { Component } from '@angular/core';
import {model} from './GridModel'
import {BigDataService} from './BigData.service';

declare var Ext: any;

Ext.require([
'Ext.grid.plugin.*',
'Ext.tip.ToolTip',
'Ext.data.summary.Sum',
'Ext.exporter.*'
]);


@Component({
selector: 'bigdata-component',
templateUrl: './BigData.html',
styles: [``]
})
export class BigDataComponent implements OnInit {
export class BigDataComponent {

constructor(bigDataService : BigDataService) { }

Expand All @@ -37,10 +34,6 @@ export class BigDataComponent implements OnInit {
});



ngOnInit() {
}

grid:any;

gridReady = (event) => {
Expand Down
Loading

0 comments on commit 722e300

Please sign in to comment.