JSFiddle - React, Tailwind, and code Playground
by dennismadsen
HTML
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="//code.highcharts.com/highcharts.src.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="//rawgit.com/ManifestWebDesign/angular-gridster/master/src/angular-gridster.js"></script>
<script src="//rawgithub.com/pablojim/highcharts-ng/master/src/highcharts-ng.js"></script>
<link rel="stylesheet" href="//rawgit.com/ManifestWebDesign/angular-gridster/master/dist/angular-gridster.min.css">
<div ng-controller="myCtrl">
<div gridster="gridsterOptions">
<ul>
<li gridster-item="item" ng-repeat="item in standardItems">
<highchart id="chart1" config="chartConfig" class="chart"></highchart>
</li>
</ul>
</div>
</div>
CSS
body {
color: #858584;
background-color: #e0e0e0;
}
.gridster .gridster-item {
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
color: #004756;
background: #ffffff;
padding: 10px;
}
.chart {
border:1px #000 solid;
}
JavaScript
var myApp = angular.module('myApp', ['gridster', 'highcharts-ng']);
myApp.controller('myCtrl', function ($scope) {
$scope.gridsterOptions = {
margins: [20, 20],
columns: 4,
rowHeight: 300,
pushing: true,
floating: true,
swapping: true,
resizable: {
enabled: true
},
draggable: {
enabled: true
}
};
$scope.standardItems = [{
sizeX: 2,
sizeY: 1
}, {
sizeX: 2,
sizeY: 1
}];
$scope.chartConfig = {
options: {
chart: {
type: 'bar'
}
},
series: [{
data: [10, 15]
}],
title: {
text: 'Hello'
},
loading: false
};
});