Updating/removing some old files, preparing to add bubble chart

This commit is contained in:
Felix 2019-07-10 12:22:26 +01:00
parent 45e700675a
commit 9f50b3c2ce
7 changed files with 36 additions and 58 deletions

View file

@ -40,8 +40,8 @@ import { P500Component } from './pages/500.component';
import { AuthModule } from './auth/auth.module'; import { AuthModule } from './auth/auth.module';
import { DashboardModule } from './dashboard/dashboard.module'; import { DashboardModule } from './dashboard/dashboard.module';
import { DxChartModule } from 'devextreme-angular'; import { ChartsModule } from 'ng2-charts';
import { StackedBarChartComponent } from './panels/stacked-bar.component'; // import { StackedBarChartComponent } from './panels/stacked-bar.component';
import { SuppliersComponent } from './dashboard/suppliers.component'; import { SuppliersComponent } from './dashboard/suppliers.component';
import { MoreStuffComponent } from './dashboard/more-graphs-and-tables.component'; import { MoreStuffComponent } from './dashboard/more-graphs-and-tables.component';
@ -51,7 +51,6 @@ import { MoreStuffComponent } from './dashboard/more-graphs-and-tables.component
imports: [ imports: [
BrowserModule, BrowserModule,
HttpClientModule, HttpClientModule,
DxChartModule,
NgxPaginationModule, NgxPaginationModule,
BsDropdownModule.forRoot(), BsDropdownModule.forRoot(),
TabsModule.forRoot(), TabsModule.forRoot(),
@ -62,7 +61,7 @@ import { MoreStuffComponent } from './dashboard/more-graphs-and-tables.component
], ],
declarations: [ declarations: [
AppComponent, AppComponent,
StackedBarChartComponent, // StackedBarChartComponent,
FullLayoutComponent, FullLayoutComponent,
SimpleLayoutComponent, SimpleLayoutComponent,
NAV_DROPDOWN_DIRECTIVES, NAV_DROPDOWN_DIRECTIVES,

View file

@ -9,8 +9,11 @@ import { DataType } from '../shared/data-types.enum';
import * as moment from 'moment'; import * as moment from 'moment';
import { SuppliersComponent } from '../dashboard/suppliers.component'; import { SuppliersComponent } from '../dashboard/suppliers.component';
import { MoreStuffComponent } from '../dashboard/more-graphs-and-tables.component'; import { MoreStuffComponent } from '../dashboard/more-graphs-and-tables.component';
import { StackedBarChartComponent } from '../panels/stacked-bar.component'; // import { StackedBarChartComponent } from '../panels/stacked-bar.component';
interface RecurSupplierData {
name : string;
}
@Component({ @Component({
templateUrl: 'dashboard-customer.component.html' templateUrl: 'dashboard-customer.component.html'

View file

@ -1,33 +1,14 @@
<script type="text/javascript" charset="utf8" src="/home/tomslater/Documents/FoodLoop-Web/src/sort-table.js"></script>
<div class="animated fadeIn"> <div class="animated fadeIn">
<div class="form-group row"> <div class="form-group row">
<table class="table table-striped table-hover"> <div class="card-block">
<thead> <div class="row">
<tr> <div class="col-12">
<th>Name</th> <h4 class="card-title mb-0">Weekly Spending by Category</h4>
<th>Postcode</th>
<th>Spend</th>
</tr>
</thead>
<tbody>
<!-- table body - name, postcode and spend data should be presented here in cost descending order -->
<tr recur-result *ngFor="let recur of recurList" tr.names="name" tr.recur="recur" (onClick)="recurClick($event, template)"></tr>
<tr>
<td>Tom's Tippity Top Toenails Ltd.</td>
<td>LA11LY</td>
<td>£250,000.00</td>
</tr>
<tr>
<td>Selena's Scratching Sticks Inc.</td>
<td>WS15PQ</td>
<td>£5.00</td>
</tr>
<tr>
<td>Big Barry and Son's Balloon Store and Clown Outfits Corp.</td>
<td>PF43RD</td>
<td>£22.00</td>
</tr>
</tbody>
</table>
</div> </div>
</div><!--/.col--> </div>
<div class="chart-wrapper">
<canvas baseChart class="chart"></canvas>
</div>
</div>
</div>
</div>

View file

@ -4,19 +4,18 @@ import { AgmCoreModule } from '@agm/core';
import { BsModalService, ModalDirective } from 'ngx-bootstrap/modal'; import { BsModalService, ModalDirective } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
interface RecurSupplierData { // interface RecurSupplierData {
name : string; // name : string;
} // }
@Component({ @Component({
templateUrl: 'more-graphs-and-tables.component.html', templateUrl: 'more-graphs-and-tables.component.html',
}) })
export class MoreStuffComponent implements OnInit, AfterViewInit { // if you wanna rename this, replace in all files 'MoreStuffComponent' with desired name and 'more-graphs-and-tables.component' with another desired name export class MoreStuffComponent implements OnInit { // if you wanna rename this, replace in all files 'MoreStuffComponent' with desired name and 'more-graphs-and-tables.component' with another desired name
@Input() public recurList: Array<RecurSupplierData>; // @Input() public recurList: Array<RecurSupplierData>;
@Output() public onClick = new EventEmitter(); @Output() public onClick = new EventEmitter();
@Input() public categories: any; @Input() public categories: any;
public recurClick(event: any): void { public recurClick(event: any): void {
this.onClick.emit( event ); this.onClick.emit( event );
} }
@ -28,8 +27,4 @@ export class MoreStuffComponent implements OnInit, AfterViewInit { // if you wa
ngOnInit(): void { ngOnInit(): void {
} }
ngAfterViewInit() {
}
} }

View file

@ -1,4 +1,4 @@
<script type="text/javascript" charset="utf8" src="/home/tomslater/Documents/FoodLoop-Web/src/sort-table.js"></script> <script type="text/javascript" charset="utf8" src=""></script>
<div class="animated fadeIn"> <div class="animated fadeIn">
<div class="form-group row"> <div class="form-group row">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
@ -13,19 +13,19 @@
<!-- table body - name, postcode and spend data should be presented here in cost descending order --> <!-- table body - name, postcode and spend data should be presented here in cost descending order -->
<tr recur-result *ngFor="let recur of recurList" tr.names="name" tr.recur="recur" (onClick)="recurClick($event, template)"></tr> <tr recur-result *ngFor="let recur of recurList" tr.names="name" tr.recur="recur" (onClick)="recurClick($event, template)"></tr>
<tr> <tr>
<td>Bill's Buildings</td> <td>Tom's Tippity Top Toenails Ltd.</td>
<td>LA13RB</td> <td>LA11LY</td>
<td>£34.64</td> <td>£250,000.00</td>
</tr> </tr>
<tr> <tr>
<td>Sam's Snake</td> <td>Selena's Scratching Sticks Inc.</td>
<td>TRY3R3</td> <td>WS15PQ</td>
<td>£567.76</td> <td>£5.00</td>
</tr> </tr>
<tr> <tr>
<td>Lloyds</td> <td>Big Barry and Son's Balloon Store and Clown Outfits Corp.</td>
<td>ABV134</td> <td>PF43RD</td>
<td>£9.00</td> <td>£22.00</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>