Skip to content

Commit

Permalink
Added adminLTE makeover and making it finally look like a widget
Browse files Browse the repository at this point in the history
  • Loading branch information
thehoneymad committed Apr 11, 2017
1 parent a3e7adb commit 26d4f4d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/ui-toolbox/bar-chart/bar-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { LoggerService } from '../../shared/index';
export class BarChartComponent implements Widget {
options: any;
data: any;
title: any;

isDataAvailable: boolean = false;

Expand All @@ -31,7 +32,9 @@ export class BarChartComponent implements Widget {

setWidgetConfig(widgetConfig: WidgetConfig) {
if (widgetConfig) {
if (!this.options && widgetConfig.config) {
if (widgetConfig.config) {
this.title = widgetConfig.config.title.text;
delete widgetConfig.config.title;
this.options = widgetConfig.config;
}

Expand Down
16 changes: 15 additions & 1 deletion src/app/ui-toolbox/bar-chart/bar-chart.html
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
<p-chart #chart *ngIf="isDataAvailable" type="bar" [data]="data" [options]="options"></p-chart>
<div class="col-md 8" *ngIf="isDataAvailable">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title pull-left">{{title}}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body no-padding">
<p-chart #chart type="bar" [data]="data" [options]="options"></p-chart>
</div>
</div>
</div>

0 comments on commit 26d4f4d

Please sign in to comment.