New Controllers added. Added Charts
This commit is contained in:
10
Laravel/resources/views/vendor/charts/plottablejs/_data/multi.blade.php
vendored
Normal file
10
Laravel/resources/views/vendor/charts/plottablejs/_data/multi.blade.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
@for($i = 0; $i < count($model->datasets); $i++)
|
||||
var s{{ $i }} = [
|
||||
@for($k = 0; $k < count($model->datasets[$i]['values']); $k++)
|
||||
{
|
||||
x: "{{ $model->labels[$k] }}",
|
||||
y: {{ $model->datasets[$i]['values'][$k] }},
|
||||
},
|
||||
@endfor
|
||||
];
|
||||
@endfor
|
11
Laravel/resources/views/vendor/charts/plottablejs/_data/one.blade.php
vendored
Normal file
11
Laravel/resources/views/vendor/charts/plottablejs/_data/one.blade.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var data = [
|
||||
@for($i = 0; $i < count($model->values); $i++)
|
||||
{
|
||||
x: "{!! $model->labels[$i] !!}",
|
||||
y: {{ $model->values[$i] }},
|
||||
@if($model->colors)
|
||||
color: "{{ $model->colors[$i] }}"
|
||||
@endif
|
||||
},
|
||||
@endfor
|
||||
];
|
37
Laravel/resources/views/vendor/charts/plottablejs/area.blade.php
vendored
Normal file
37
Laravel/resources/views/vendor/charts/plottablejs/area.blade.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.one')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.Area()
|
||||
.addDataset(new Plottable.Dataset(data))
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('stroke', "{{ $model->colors[0] }}")
|
||||
.attr('fill', "{{ $model->colors[0] }}")
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}").yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
36
Laravel/resources/views/vendor/charts/plottablejs/bar.blade.php
vendored
Normal file
36
Laravel/resources/views/vendor/charts/plottablejs/bar.blade.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.one')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.Bar()
|
||||
.addDataset(new Plottable.Dataset(data))
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('fill', function(d) { return d.color; })
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}").yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
41
Laravel/resources/views/vendor/charts/plottablejs/donut.blade.php
vendored
Normal file
41
Laravel/resources/views/vendor/charts/plottablejs/donut.blade.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.one')
|
||||
|
||||
var xScale = new Plottable.Scales.Category()
|
||||
var yScale = new Plottable.Scales.Linear()
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom')
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left')
|
||||
|
||||
var reverseMap = {};
|
||||
data.forEach(function(d) { reverseMap[d.y] = d.x;});
|
||||
|
||||
var plot = new Plottable.Plots.Pie()
|
||||
.addDataset(new Plottable.Dataset(data))
|
||||
.sectorValue(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('fill', function(d) { return d.color; })
|
||||
@endif
|
||||
.innerRadius(250, yScale)
|
||||
.outerRadius(500, yScale)
|
||||
.labelsEnabled(true)
|
||||
.labelFormatter(function(n){ return reverseMap[n] ;})
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var table = new Plottable.Components.Table([[title],[plot]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
36
Laravel/resources/views/vendor/charts/plottablejs/line.blade.php
vendored
Normal file
36
Laravel/resources/views/vendor/charts/plottablejs/line.blade.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.one')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.Line()
|
||||
.addDataset(new Plottable.Dataset(data))
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('stroke', "{{ $model->colors[0] }}")
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}").yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
39
Laravel/resources/views/vendor/charts/plottablejs/multi/area.blade.php
vendored
Normal file
39
Laravel/resources/views/vendor/charts/plottablejs/multi/area.blade.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.multi')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.Area()
|
||||
@for($i = 0; $i < count($model->datasets); $i++)
|
||||
.addDataset(new Plottable.Dataset(s{{ $i }}))
|
||||
@endfor
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('stroke', "{{ $model->colors[0] }}")
|
||||
.attr('fill', "{{ $model->colors[0] }}")
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}").yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
41
Laravel/resources/views/vendor/charts/plottablejs/multi/bar.blade.php
vendored
Normal file
41
Laravel/resources/views/vendor/charts/plottablejs/multi/bar.blade.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.multi')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.ClusteredBar()
|
||||
@for($i = 0; $i < count($model->datasets); $i++)
|
||||
.addDataset(new Plottable.Dataset(s{{ $i }}))
|
||||
@endfor
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('stroke', "{{ $model->colors[0] }}")
|
||||
.attr('fill', "{{ $model->colors[0] }}")
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}")
|
||||
.yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
38
Laravel/resources/views/vendor/charts/plottablejs/multi/line.blade.php
vendored
Normal file
38
Laravel/resources/views/vendor/charts/plottablejs/multi/line.blade.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.multi')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var plot = new Plottable.Plots.Line()
|
||||
@for($i = 0; $i < count($model->datasets); $i++)
|
||||
.addDataset(new Plottable.Dataset(s{{ $i }}))
|
||||
@endfor
|
||||
.x(function(d) { return d.x; }, xScale)
|
||||
.y(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('stroke', "{{ $model->colors[0] }}")
|
||||
@endif
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var label = new Plottable.Components.AxisLabel("{!! $model->element_label !!}").yAlignment('center').angle(270);
|
||||
|
||||
var table = new Plottable.Components.Table([[null,null, title],[label, yAxis, plot],[null, null, xAxis]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
39
Laravel/resources/views/vendor/charts/plottablejs/pie.blade.php
vendored
Normal file
39
Laravel/resources/views/vendor/charts/plottablejs/pie.blade.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
@include('charts::_partials.container.svg')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
@include('charts::plottablejs._data.one')
|
||||
|
||||
var xScale = new Plottable.Scales.Category();
|
||||
var yScale = new Plottable.Scales.Linear();
|
||||
|
||||
var xAxis = new Plottable.Axes.Category(xScale, 'bottom');
|
||||
var yAxis = new Plottable.Axes.Numeric(yScale, 'left');
|
||||
|
||||
var reverseMap = {};
|
||||
data.forEach(function(d) { reverseMap[d.y] = d.x;});
|
||||
|
||||
var plot = new Plottable.Plots.Pie()
|
||||
.addDataset(new Plottable.Dataset(data))
|
||||
.sectorValue(function(d) { return d.y; }, yScale)
|
||||
@if($model->colors)
|
||||
.attr('fill', function(d) { return d.color; })
|
||||
@endif
|
||||
.labelsEnabled(true)
|
||||
.labelFormatter(function(n){ return reverseMap[n] ;})
|
||||
.outerRadius(500, yScale)
|
||||
.animated(true);
|
||||
|
||||
var title;
|
||||
@if($model->title)
|
||||
title = new Plottable.Components.TitleLabel("{!! $model->title !!}").yAlignment('center');
|
||||
@endif
|
||||
|
||||
var table = new Plottable.Components.Table([[title],[plot]]);
|
||||
table.renderTo('svg#{{ $model->id }}');
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
table.redraw()
|
||||
})
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user