diff --git a/package.json b/package.json index d2ef23bd..8ebdb035 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "angular2": "2.0.0-beta.15", "bootstrap": "^4.0.0-alpha.2", "bootstrap-loader": "^1.0.8", + "chartist": "^0.9.7", "core-js": "^2.2.2", "font-awesome": "^4.6.1", "font-awesome-sass-loader": "^1.0.1", diff --git a/src/app/pages/charts/charts.component.ts b/src/app/pages/charts/charts.component.ts index a167324a..08c8f057 100644 --- a/src/app/pages/charts/charts.component.ts +++ b/src/app/pages/charts/charts.component.ts @@ -2,6 +2,7 @@ import {Component} from 'angular2/core'; import {RouteConfig} from 'angular2/router'; import {ChartJs} from "./components/chartJs"; +import {ChartistJs} from "./components/chartistJs/chartistJs.component"; @Component({ selector: 'maps', @@ -15,7 +16,12 @@ import {ChartJs} from "./components/chartJs"; name: 'ChartJs', component: ChartJs, path: '/chart-js', - useAsDefault: true + useAsDefault: true, + }, + { + name: 'ChartistJs', + component: ChartistJs, + path: '/chartist-js', } ]) export class Charts { diff --git a/src/app/pages/charts/components/chartistJs/chartistJs.component.ts b/src/app/pages/charts/components/chartistJs/chartistJs.component.ts new file mode 100644 index 00000000..23b93dfe --- /dev/null +++ b/src/app/pages/charts/components/chartistJs/chartistJs.component.ts @@ -0,0 +1,23 @@ +import {Component, ViewEncapsulation} from 'angular2/core'; +import {BaCard} from '../../../../theme'; + +import {ChartistJsService} from "./chartistJs.service"; + +require('chartist'); + +@Component({ + selector: 'chartist-js', + pipes: [], + providers: [ChartistJsService], + encapsulation: ViewEncapsulation.None, + styles: [require('./chartistJs.scss')], + directives: [BaCard], + template: require('./chartistJs.html'), +}) +export class ChartistJs { + + + + constructor(private _chartistJsService:ChartistJsService) { + } +} diff --git a/src/app/pages/charts/components/chartistJs/chartistJs.html b/src/app/pages/charts/components/chartistJs/chartistJs.html new file mode 100644 index 00000000..9811f560 --- /dev/null +++ b/src/app/pages/charts/components/chartistJs/chartistJs.html @@ -0,0 +1,43 @@ +
+
+
+
+
Simple line chart
+
+
Line chart with area
+
+
Bi-polar line chart with area only
+
+
+
+ +
+
+
Simple bar chart
+
+
Multi-line labels bar chart
+
+
Stacked bar chart
+
+
+
+
+ +
+
+
+
+
Simple Pie
+
+
+
Pie with labels
+
+
+
Donut
+
+
+
+
+
+
+
diff --git a/src/app/pages/charts/components/chartistJs/chartistJs.scss b/src/app/pages/charts/components/chartistJs/chartistJs.scss new file mode 100644 index 00000000..e6598ee4 --- /dev/null +++ b/src/app/pages/charts/components/chartistJs/chartistJs.scss @@ -0,0 +1,49 @@ +.chart-legend, +.bar-legend, +.line-legend, +.pie-legend, +.radar-legend, +.polararea-legend, +.doughnut-legend { + list-style-type: none; + margin-top: 5px; + text-align: center; + /* NOTE: Browsers automatically add 40px of padding-left to all lists, so we should offset that, otherwise the legend is off-center */ + -webkit-padding-start: 0; + /* Webkit */ + -moz-padding-start: 0; + /* Mozilla */ + padding-left: 0; + /* IE (handles all cases, really, but we should also include the vendor-specific properties just to be safe) */ +} +.chart-legend li, +.bar-legend li, +.line-legend li, +.pie-legend li, +.radar-legend li, +.polararea-legend li, +.doughnut-legend li { + display: inline-block; + white-space: nowrap; + position: relative; + margin-bottom: 4px; + border-radius: 5px; + padding: 2px 8px 2px 28px; + font-size: smaller; + cursor: default; +} +.chart-legend li span, +.bar-legend li span, +.line-legend li span, +.pie-legend li span, +.radar-legend li span, +.polararea-legend li span, +.doughnut-legend li span { + display: block; + position: absolute; + left: 0; + top: 0; + width: 20px; + height: 20px; + border-radius: 5px; +} diff --git a/src/app/pages/charts/components/chartistJs/chartistJs.service.ts b/src/app/pages/charts/components/chartistJs/chartistJs.service.ts new file mode 100644 index 00000000..73c5539b --- /dev/null +++ b/src/app/pages/charts/components/chartistJs/chartistJs.service.ts @@ -0,0 +1,6 @@ +import {Injectable} from 'angular2/core'; + +@Injectable() +export class ChartistJsService { + +} diff --git a/src/app/pages/charts/components/chartistJs/index.ts b/src/app/pages/charts/components/chartistJs/index.ts new file mode 100644 index 00000000..28513673 --- /dev/null +++ b/src/app/pages/charts/components/chartistJs/index.ts @@ -0,0 +1 @@ +export * from './chartistJs.component'; diff --git a/src/app/theme/sidebar/sidebar.service.ts b/src/app/theme/sidebar/sidebar.service.ts index c63981f8..6c4cdf34 100644 --- a/src/app/theme/sidebar/sidebar.service.ts +++ b/src/app/theme/sidebar/sidebar.service.ts @@ -64,6 +64,10 @@ export class SidebarService { title: 'Chart Js', name: 'ChartJs', }, + { + title: 'ChartistJs', + name: 'ChartistJs', + }, ] }, {