new dashboard charts
This commit is contained in:
		@@ -75,74 +75,11 @@
 | 
			
		||||
                </ul>
 | 
			
		||||
 | 
			
		||||
                <div class="tab-content no-padding">
 | 
			
		||||
                    <div class="chart tab-pane active" id="daily-chart" style="position: relative; height: 300px;">
 | 
			
		||||
                        <div class="row">
 | 
			
		||||
                            <div class="chart">
 | 
			
		||||
                                <canvas id="cash_flow_daily" style="height: 246px; width: 1069px;" height="246" width="1069"></canvas>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
 | 
			
		||||
                        <div class="row daily-footer">
 | 
			
		||||
                            <div class="col-md-2">
 | 
			
		||||
                                <div class="row">
 | 
			
		||||
                                    <div class="col-md-4">
 | 
			
		||||
                                        <div id="sale"></div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="col-md-8 scp">
 | 
			
		||||
                                        {{ trans_choice('general.incomes', 1) }}
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="col-md-2">
 | 
			
		||||
                                <div class="row">
 | 
			
		||||
                                    <div class="col-md-4">
 | 
			
		||||
                                        <div id="cost"></div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="col-md-8 scp">
 | 
			
		||||
                                        {{ trans_choice('general.expenses', 1) }}
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="col-md-2">
 | 
			
		||||
                                <div class="row">
 | 
			
		||||
                                    <div class="col-md-4">
 | 
			
		||||
                                        <div id="profit"></div>
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                    <div class="col-md-8 scp">
 | 
			
		||||
                                        {{ trans_choice('general.profits', 1) }}
 | 
			
		||||
                                    </div>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    <div class="chart tab-pane active" id="daily-chart" style="position: relative; height: 310px;">
 | 
			
		||||
                        {!! $line_daily->render() !!}
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="chart tab-pane" id="monthly-chart" style="position: relative; height: 300px;">
 | 
			
		||||
                        @if ($cash_flow['monthly'])
 | 
			
		||||
                            <div class="col-md-2">
 | 
			
		||||
                                <div style="margin : 7px 0px; border-left: 3px solid #00c0ef; padding-left: 10px;">
 | 
			
		||||
                                    <p style="font-size: 16px; margin: 0px;">
 | 
			
		||||
                                        @money($total_incomes['total'], setting('general.default_currency'), true)
 | 
			
		||||
                                    </p>
 | 
			
		||||
                                    {{ trans_choice('general.incomes', 1) }}
 | 
			
		||||
                                </div>
 | 
			
		||||
                                <div style="margin : 7px 0px; border-left: 3px solid #C9302C; padding-left: 10px;">
 | 
			
		||||
                                    <p style="font-size: 16px; margin: 0px;">
 | 
			
		||||
                                        @money($total_expenses['total'], setting('general.default_currency'), true)
 | 
			
		||||
                                    </p>
 | 
			
		||||
                                    {{ trans_choice('general.expenses', 1) }}
 | 
			
		||||
                                </div>
 | 
			
		||||
                                <div style="margin : 7px 0px; border-left: 3px solid #00a65a; padding-left: 10px;">
 | 
			
		||||
                                    <p style="font-size: 16px; margin: 0px;">
 | 
			
		||||
                                        @money($total_incomes['total'] - $total_expenses['total'], setting('general.default_currency'), true)
 | 
			
		||||
                                    </p>
 | 
			
		||||
                                    {{ trans_choice('general.profits', 1) }}
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                            <div class="col-md-10">
 | 
			
		||||
                                <div id="cash_flow_monthly" style="min-width: 800px; height: 300px; margin: 0 auto"></div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        @else
 | 
			
		||||
                            <h5 class="text-center">{{ trans('dashboard.no_profit_loss') }}</h5>
 | 
			
		||||
                        @endif
 | 
			
		||||
                    <div class="chart tab-pane" id="monthly-chart" style="position: relative; height: 310px;">
 | 
			
		||||
                        {!! $line_monthly->render() !!}
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -162,20 +99,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="box-body">
 | 
			
		||||
                    <div class="row">
 | 
			
		||||
                        <div class="col-md-8">
 | 
			
		||||
                            <div class="chart-responsive">
 | 
			
		||||
                                <canvas id="income_category" height="155" width="328" style="width: 328px; height: 155px;"></canvas>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-md-4">
 | 
			
		||||
                            <ul class="chart-legend clearfix">
 | 
			
		||||
                                @foreach ($incomes as $item)
 | 
			
		||||
                                    <li><i class="fa fa-circle" style="color:{{ $item['color'] }};"></i> {{ $item['amount'] . ' ' . $item['label'] }}</li>
 | 
			
		||||
                                @endforeach
 | 
			
		||||
                            </ul>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    {!! $donut_incomes->render() !!}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
@@ -190,20 +114,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="box-body">
 | 
			
		||||
                    <div class="row">
 | 
			
		||||
                        <div class="col-md-8">
 | 
			
		||||
                            <div class="chart-responsive">
 | 
			
		||||
                                <canvas id="expense_category" height="155" width="328" style="width: 328px; height: 155px;"></canvas>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-md-4">
 | 
			
		||||
                            <ul class="chart-legend clearfix">
 | 
			
		||||
                                @foreach ($expenses as $item)
 | 
			
		||||
                                    <li><i class="fa fa-circle" style="color:{{ $item['color'] }};"></i> {{ $item['amount'] . ' ' . $item['label'] }}</li>
 | 
			
		||||
                                @endforeach
 | 
			
		||||
                            </ul>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    {!! $donut_expenses->render() !!}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
@@ -316,151 +227,5 @@
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@push('js')
 | 
			
		||||
    <script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/chartjs/Chart.min.js') }}"></script>
 | 
			
		||||
    <script src="{{ asset('public/js/highchart/highcharts.js') }}"></script>
 | 
			
		||||
@endpush
 | 
			
		||||
 | 
			
		||||
@push('scripts')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        $(document).ready(function () {
 | 
			
		||||
            var areaChartData = {
 | 
			
		||||
                labels: {!! $cash_flow['daily']['date'] !!},
 | 
			
		||||
                datasets: [
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "{{ trans_choice('general.incomes', 1) }}",
 | 
			
		||||
                        fillColor: "#00c0ef",
 | 
			
		||||
                        strokeColor: "#00c0ef",
 | 
			
		||||
                        pointColor: "#00c0ef",
 | 
			
		||||
                        pointStrokeColor: "#00c0ef",
 | 
			
		||||
                        pointHighlightFill: "#FFF",
 | 
			
		||||
                        pointHighlightStroke: "#00c0ef",
 | 
			
		||||
                        data: {!! $cash_flow['daily']['income'] !!}
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "{{ trans_choice('general.expenses', 1) }}",
 | 
			
		||||
                        fillColor: "#F56954",
 | 
			
		||||
                        strokeColor: "#F56954",
 | 
			
		||||
                        pointColor: "#F56954",
 | 
			
		||||
                        pointStrokeColor: "#F56954",
 | 
			
		||||
                        pointHighlightFill: "#FFF",
 | 
			
		||||
                        pointHighlightStroke: "#F56954",
 | 
			
		||||
                        data: {!! $cash_flow['daily']['expense'] !!}
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        label: "{{ trans_choice('general.profits', 1) }}",
 | 
			
		||||
                        fillColor: "#6da252",
 | 
			
		||||
                        strokeColor: "#6da252",
 | 
			
		||||
                        pointColor: "#6da252",
 | 
			
		||||
                        pointStrokeColor: "#6da252",
 | 
			
		||||
                        pointHighlightFill: "#FFF",
 | 
			
		||||
                        pointHighlightStroke: "#6da252",
 | 
			
		||||
                        data: {!! $cash_flow['daily']['profit'] !!}
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            var areaChartOptions = {
 | 
			
		||||
                showScale: true,
 | 
			
		||||
                scaleShowGridLines: true,
 | 
			
		||||
                scaleGridLineColor: "rgba(0,0,0,.05)",
 | 
			
		||||
                scaleGridLineWidth: 1,
 | 
			
		||||
                scaleShowHorizontalLines: true,
 | 
			
		||||
                scaleShowVerticalLines: true,
 | 
			
		||||
                bezierCurve: true,
 | 
			
		||||
                bezierCurveTension: 0.3,
 | 
			
		||||
                pointDot: false,
 | 
			
		||||
                pointDotRadius: 4,
 | 
			
		||||
                pointDotStrokeWidth: 1,
 | 
			
		||||
                pointHitDetectionRadius: 20,
 | 
			
		||||
                datasetStroke: true,
 | 
			
		||||
                datasetStrokeWidth: 2,
 | 
			
		||||
                datasetFill: true,
 | 
			
		||||
                legendTemplate: '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].lineColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>',
 | 
			
		||||
                maintainAspectRatio: true,
 | 
			
		||||
                responsive: true
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            var cashFlowDailyCanvas = $("#cash_flow_daily").get(0).getContext("2d");
 | 
			
		||||
            var cashFlowDaily = new Chart(cashFlowDailyCanvas);
 | 
			
		||||
            var cashFlowDailyOptions = areaChartOptions;
 | 
			
		||||
 | 
			
		||||
            cashFlowDailyOptions.datasetFill = false;
 | 
			
		||||
            cashFlowDaily.Line(areaChartData, cashFlowDailyOptions);
 | 
			
		||||
 | 
			
		||||
            var income_category_canvas = $("#income_category").get(0).getContext("2d");
 | 
			
		||||
            var income_category_pie_chart = new Chart(income_category_canvas);
 | 
			
		||||
            var income_category_data = jQuery.parseJSON('{!! $income_graph !!}');
 | 
			
		||||
 | 
			
		||||
            var income_category_options = {
 | 
			
		||||
                segmentShowStroke: true,
 | 
			
		||||
                segmentStrokeColor: "#fff",
 | 
			
		||||
                segmentStrokeWidth: 1,
 | 
			
		||||
                percentageInnerCutout: 50, // This is 0 for Pie charts
 | 
			
		||||
                animationSteps: 100,
 | 
			
		||||
                animationEasing: "easeOutBounce",
 | 
			
		||||
                animateRotate: true,
 | 
			
		||||
                animateScale: false,
 | 
			
		||||
                responsive: true,
 | 
			
		||||
                maintainAspectRatio: false,
 | 
			
		||||
                legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>",
 | 
			
		||||
                tooltipTemplate: "<%=label%>"
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            income_category_pie_chart.Doughnut(income_category_data, income_category_options);
 | 
			
		||||
 | 
			
		||||
            var expense_category_canvas = $("#expense_category").get(0).getContext("2d");
 | 
			
		||||
            var expense_category_pie_chart = new Chart(expense_category_canvas);
 | 
			
		||||
            var expense_category_data = jQuery.parseJSON('{!! $expense_graph !!}');
 | 
			
		||||
 | 
			
		||||
            var expense_category_options = {
 | 
			
		||||
                segmentShowStroke: true,
 | 
			
		||||
                segmentStrokeColor: "#fff",
 | 
			
		||||
                segmentStrokeWidth: 1,
 | 
			
		||||
                percentageInnerCutout: 50, // This is 0 for Pie charts
 | 
			
		||||
                animationSteps: 100,
 | 
			
		||||
                animationEasing: "easeOutBounce",
 | 
			
		||||
                animateRotate: true,
 | 
			
		||||
                animateScale: false,
 | 
			
		||||
                responsive: true,
 | 
			
		||||
                maintainAspectRatio: false,
 | 
			
		||||
                legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>",
 | 
			
		||||
                tooltipTemplate: "<%=label%>"
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            expense_category_pie_chart.Doughnut(expense_category_data, expense_category_options);
 | 
			
		||||
 | 
			
		||||
            @if ($cash_flow['monthly'])
 | 
			
		||||
            Highcharts.chart('cash_flow_monthly', {
 | 
			
		||||
                chart: {
 | 
			
		||||
                    type: 'column'
 | 
			
		||||
                },
 | 
			
		||||
                title: {
 | 
			
		||||
                    text: ''
 | 
			
		||||
                },
 | 
			
		||||
                xAxis: {
 | 
			
		||||
                    categories: {!! $cash_flow['monthly']['date'] !!}
 | 
			
		||||
                },
 | 
			
		||||
                credits: {
 | 
			
		||||
                    enabled: false
 | 
			
		||||
                },
 | 
			
		||||
                series: [{
 | 
			
		||||
                    name: '{{ trans_choice('general.incomes', 1) }}',
 | 
			
		||||
                    data: {!! $cash_flow['monthly']['income'] !!}
 | 
			
		||||
                },{
 | 
			
		||||
                    name: '{{ trans_choice('general.expenses', 1) }}',
 | 
			
		||||
                    data: {!! $cash_flow['monthly']['expense'] !!}
 | 
			
		||||
                }, {
 | 
			
		||||
                    name: '{{ trans_choice('general.profits', 1) }}',
 | 
			
		||||
                    data: {!! $cash_flow['monthly']['profit'] !!}
 | 
			
		||||
                }]
 | 
			
		||||
            });
 | 
			
		||||
            @endif
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        jQuery(document).on( 'shown.bs.tab', 'a[data-toggle="tab"]', function () {
 | 
			
		||||
            $('#cash_flow_monthly').each(function() {
 | 
			
		||||
                $(this).highcharts().reflow();
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
@endpush
 | 
			
		||||
{!! Charts::assets() !!}
 | 
			
		||||
@endpush
 | 
			
		||||
							
								
								
									
										49
									
								
								resources/views/vendor/consoletvs/charts/chartjs/area.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								resources/views/vendor/consoletvs/charts/chartjs/area.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,49 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
@include('charts::_partials.helpers.hex2rgb')
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
 | 
			
		||||
    var data = {
 | 
			
		||||
        labels: [
 | 
			
		||||
            @foreach($model->labels as $label)
 | 
			
		||||
                "{!! $label !!}",
 | 
			
		||||
            @endforeach
 | 
			
		||||
        ],
 | 
			
		||||
        datasets: [{
 | 
			
		||||
            fill: true,
 | 
			
		||||
            @if($model->colors)
 | 
			
		||||
                backgroundColor: hex2rgba_convert("{{ $model->colors[0] }}", 50),
 | 
			
		||||
            @endif
 | 
			
		||||
            label: "{!! $model->element_label !!}",
 | 
			
		||||
            lineTension: 0.3,
 | 
			
		||||
            @if($model->colors)
 | 
			
		||||
                borderColor: "{{ $model->colors[0] }}",
 | 
			
		||||
            @endif
 | 
			
		||||
            data: [
 | 
			
		||||
                @foreach($model->values as $dta)
 | 
			
		||||
                    {{ $dta }},
 | 
			
		||||
                @endforeach
 | 
			
		||||
            ],
 | 
			
		||||
        }]
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var myLineChart = new Chart(ctx, {
 | 
			
		||||
        type: 'line',
 | 
			
		||||
        data: data,
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
                title: {
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
                }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										57
									
								
								resources/views/vendor/consoletvs/charts/chartjs/bar.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								resources/views/vendor/consoletvs/charts/chartjs/bar.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,57 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
    var myChart = new Chart(ctx, {
 | 
			
		||||
        type: 'bar',
 | 
			
		||||
        data: {
 | 
			
		||||
            labels: [
 | 
			
		||||
                @foreach($model->labels as $label)
 | 
			
		||||
                    "{!! $label !!}",
 | 
			
		||||
                @endforeach
 | 
			
		||||
            ],
 | 
			
		||||
            datasets: [
 | 
			
		||||
                {
 | 
			
		||||
                    label: "{!! $model->element_label !!}",
 | 
			
		||||
                    backgroundColor: [
 | 
			
		||||
                        @if($model->colors)
 | 
			
		||||
                            @foreach($model->colors as $color)
 | 
			
		||||
                                "{{ $color }}",
 | 
			
		||||
                            @endforeach
 | 
			
		||||
                        @else
 | 
			
		||||
                            @foreach($model->values as $dta)
 | 
			
		||||
                                "{{ sprintf('#%06X', mt_rand(0, 0xFFFFFF)) }}",
 | 
			
		||||
                            @endforeach
 | 
			
		||||
                        @endif
 | 
			
		||||
                    ],
 | 
			
		||||
                    data: [
 | 
			
		||||
                        @foreach($model->values as $dta)
 | 
			
		||||
                            {{ $dta }},
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    ],
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
            title: {
 | 
			
		||||
                display: true,
 | 
			
		||||
                text: "{!! $model->title !!}",
 | 
			
		||||
                fontSize: 20,
 | 
			
		||||
            },
 | 
			
		||||
            @endif
 | 
			
		||||
            scales: {
 | 
			
		||||
                yAxes: [{
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    ticks: {
 | 
			
		||||
                        beginAtZero: true,
 | 
			
		||||
                    }
 | 
			
		||||
                }]
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										72
									
								
								resources/views/vendor/consoletvs/charts/chartjs/donut.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								resources/views/vendor/consoletvs/charts/chartjs/donut.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,72 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
 | 
			
		||||
    var myChart = new Chart(ctx, {
 | 
			
		||||
        type: 'doughnut',
 | 
			
		||||
        data: {
 | 
			
		||||
            labels: [
 | 
			
		||||
                @foreach($model->labels as $label)
 | 
			
		||||
                    "{!! $label !!}",
 | 
			
		||||
                @endforeach
 | 
			
		||||
            ],
 | 
			
		||||
            datasets: [{
 | 
			
		||||
                data: [
 | 
			
		||||
                    @foreach($model->values as $dta)
 | 
			
		||||
                        {{ $dta }},
 | 
			
		||||
                    @endforeach
 | 
			
		||||
                ],
 | 
			
		||||
                backgroundColor: [
 | 
			
		||||
                    @if($model->colors)
 | 
			
		||||
                        @foreach($model->colors as $color)
 | 
			
		||||
                            "{{ $color }}",
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    @else
 | 
			
		||||
                        @foreach($model->values as $dta)
 | 
			
		||||
                            "{{ sprintf('#%06X', mt_rand(0, 0xFFFFFF)) }}",
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    @endif
 | 
			
		||||
                ],
 | 
			
		||||
            }]
 | 
			
		||||
        },
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            legend: {
 | 
			
		||||
                display: true,
 | 
			
		||||
                fullWidth: true,
 | 
			
		||||
                position: 'right',
 | 
			
		||||
            },
 | 
			
		||||
            tooltips: {
 | 
			
		||||
                callbacks: {
 | 
			
		||||
                    label: function(tooltipItem, data) {
 | 
			
		||||
                        var allData = data.datasets[tooltipItem.datasetIndex].data;
 | 
			
		||||
                        var tooltipLabel = data.labels[tooltipItem.index];
 | 
			
		||||
                        var tooltipData = allData[tooltipItem.index];
 | 
			
		||||
                        var total = 0;
 | 
			
		||||
 | 
			
		||||
                        var label = tooltipLabel.split(" - ");
 | 
			
		||||
 | 
			
		||||
                        for (var i in allData) {
 | 
			
		||||
                            total += allData[i];
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        var tooltipPercentage = Math.round((tooltipData / total) * 100);
 | 
			
		||||
 | 
			
		||||
                        return label[1] + ': ' + label[0] + ' (' + tooltipPercentage + '%)';
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
            title: {
 | 
			
		||||
                display: true,
 | 
			
		||||
                text: "{!! $model->title !!}",
 | 
			
		||||
                fontSize: 20,
 | 
			
		||||
            }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										46
									
								
								resources/views/vendor/consoletvs/charts/chartjs/line.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								resources/views/vendor/consoletvs/charts/chartjs/line.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
    var data = {
 | 
			
		||||
        labels: [
 | 
			
		||||
            @foreach($model->labels as $label)
 | 
			
		||||
                "{!! $label !!}",
 | 
			
		||||
            @endforeach
 | 
			
		||||
        ],
 | 
			
		||||
        datasets: [
 | 
			
		||||
            {
 | 
			
		||||
                fill: false,
 | 
			
		||||
                label: "{!! $model->element_label !!}",
 | 
			
		||||
                lineTension: 0.3,
 | 
			
		||||
                @if($model->colors)
 | 
			
		||||
                    borderColor: "{{ $model->colors[0] }}",
 | 
			
		||||
                    backgroundColor: "{{ $model->colors[0] }}",
 | 
			
		||||
                @endif
 | 
			
		||||
                data: [
 | 
			
		||||
                    @foreach($model->values as $dta)
 | 
			
		||||
                        {{ $dta }},
 | 
			
		||||
                    @endforeach
 | 
			
		||||
                ],
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var myLineChart = new Chart(ctx, {
 | 
			
		||||
        type: 'line',
 | 
			
		||||
        data: data,
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
                title: {
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
                }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										56
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/area.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/area.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
@include('charts::_partials.helpers.hex2rgb')
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
    var data = {
 | 
			
		||||
        labels: [
 | 
			
		||||
            @foreach($model->labels as $label)
 | 
			
		||||
                "{!! $label !!}",
 | 
			
		||||
            @endforeach
 | 
			
		||||
        ],
 | 
			
		||||
        datasets: [
 | 
			
		||||
            @for ($i = 0; $i < count($model->datasets); $i++)
 | 
			
		||||
                {
 | 
			
		||||
                    fill: true,
 | 
			
		||||
                    label: "{!! $model->datasets[$i]['label'] !!}",
 | 
			
		||||
                    lineTension: 0.3,
 | 
			
		||||
                    @if($model->colors and count($model->colors) > $i)
 | 
			
		||||
                        @php($c = $model->colors[$i])
 | 
			
		||||
                    @else
 | 
			
		||||
                        @php($c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)))
 | 
			
		||||
                    @endif
 | 
			
		||||
                    borderColor: "{{ $c }}",
 | 
			
		||||
                    backgroundColor: hex2rgba_convert("{{ $c }}", 50),
 | 
			
		||||
                    data: [
 | 
			
		||||
                        @foreach($model->datasets[$i]['values'] as $dta)
 | 
			
		||||
                            {{ $dta }},
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    ],
 | 
			
		||||
                },
 | 
			
		||||
            @endfor
 | 
			
		||||
        ]
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var myLineChart = new Chart(ctx, {
 | 
			
		||||
        type: 'line',
 | 
			
		||||
        data: data,
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
                title: {
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
                }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										58
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/bar.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/bar.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
    var myChart = new Chart(ctx, {
 | 
			
		||||
        type: 'bar',
 | 
			
		||||
        data: {
 | 
			
		||||
            labels: [
 | 
			
		||||
                @foreach($model->labels as $label)
 | 
			
		||||
                    "{!! $label !!}",
 | 
			
		||||
                @endforeach
 | 
			
		||||
            ],
 | 
			
		||||
            datasets: [
 | 
			
		||||
                @for ($i = 0; $i < count($model->datasets); $i++)
 | 
			
		||||
                    {
 | 
			
		||||
                        fill: true,
 | 
			
		||||
                        label: "{!! $model->datasets[$i]['label'] !!}",
 | 
			
		||||
                        lineTension: 0.3,
 | 
			
		||||
                        @if($model->colors and count($model->colors) > $i)
 | 
			
		||||
                            borderColor: "{{ $model->colors[$i] }}",
 | 
			
		||||
                            backgroundColor: "{{ $model->colors[$i] }}",
 | 
			
		||||
                        @else
 | 
			
		||||
                            $c = sprintf('#%06X', mt_rand(0, 0xFFFFFF))
 | 
			
		||||
                            borderColor: "{{ $c }}",
 | 
			
		||||
                            backgroundColor: "{{ $c }}",
 | 
			
		||||
                        @endif
 | 
			
		||||
                        data: [
 | 
			
		||||
                            @foreach($model->datasets[$i]['values'] as $dta)
 | 
			
		||||
                                {{ $dta }},
 | 
			
		||||
                            @endforeach
 | 
			
		||||
                        ],
 | 
			
		||||
                    },
 | 
			
		||||
                @endfor
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
                @if($model->title)
 | 
			
		||||
                    title: {
 | 
			
		||||
                display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
            },
 | 
			
		||||
            @endif
 | 
			
		||||
                scales: {
 | 
			
		||||
                yAxes: [{
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    ticks: {
 | 
			
		||||
                        beginAtZero: true,
 | 
			
		||||
                    }
 | 
			
		||||
                }]
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										55
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/line.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								resources/views/vendor/consoletvs/charts/chartjs/multi/line.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
    var data = {
 | 
			
		||||
        labels: [
 | 
			
		||||
            @foreach($model->labels as $label)
 | 
			
		||||
                "{!! $label !!}",
 | 
			
		||||
            @endforeach
 | 
			
		||||
        ],
 | 
			
		||||
        datasets: [
 | 
			
		||||
            @for ($i = 0; $i < count($model->datasets); $i++)
 | 
			
		||||
                {
 | 
			
		||||
                    fill: false,
 | 
			
		||||
                    label: "{!! $model->datasets[$i]['label'] !!}",
 | 
			
		||||
                    lineTension: 0.3,
 | 
			
		||||
                    @if($model->colors and count($model->colors) > $i)
 | 
			
		||||
                        @php($c = $model->colors[$i])
 | 
			
		||||
                    @else
 | 
			
		||||
                        @php($c = sprintf('#%06X', mt_rand(0, 0xFFFFFF)))
 | 
			
		||||
                    @endif
 | 
			
		||||
                    borderColor: "{{ $c }}",
 | 
			
		||||
                    backgroundColor: "{{ $c }}",
 | 
			
		||||
                    data: [
 | 
			
		||||
                        @foreach($model->datasets[$i]['values'] as $dta)
 | 
			
		||||
                            {{ $dta }},
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    ],
 | 
			
		||||
                },
 | 
			
		||||
            @endfor
 | 
			
		||||
        ]
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    var myLineChart = new Chart(ctx, {
 | 
			
		||||
        type: 'line',
 | 
			
		||||
        data: data,
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            legend: {
 | 
			
		||||
                display: true,
 | 
			
		||||
                position: 'top'
 | 
			
		||||
            },
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
                title: {
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
                }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										47
									
								
								resources/views/vendor/consoletvs/charts/chartjs/pie.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								resources/views/vendor/consoletvs/charts/chartjs/pie.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
@if(!$model->customId)
 | 
			
		||||
    @include('charts::_partials.container.canvas2')
 | 
			
		||||
@endif
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
    var ctx = document.getElementById("{{ $model->id }}")
 | 
			
		||||
 | 
			
		||||
    var myChart = new Chart(ctx, {
 | 
			
		||||
        type: 'pie',
 | 
			
		||||
        data: {
 | 
			
		||||
            labels: [
 | 
			
		||||
                @foreach($model->labels as $label)
 | 
			
		||||
                    "{!! $label !!}",
 | 
			
		||||
                @endforeach
 | 
			
		||||
            ],
 | 
			
		||||
            datasets: [{
 | 
			
		||||
                data: [
 | 
			
		||||
                    @foreach($model->values as $dta)
 | 
			
		||||
                        {{ $dta }},
 | 
			
		||||
                    @endforeach
 | 
			
		||||
                ],
 | 
			
		||||
                backgroundColor: [
 | 
			
		||||
                    @if($model->colors)
 | 
			
		||||
                        @foreach($model->colors as $color)
 | 
			
		||||
                            "{{ $color }}",
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    @else
 | 
			
		||||
                        @foreach($model->values as $dta)
 | 
			
		||||
                            "{{ sprintf('#%06X', mt_rand(0, 0xFFFFFF)) }}",
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                    @endif
 | 
			
		||||
                ],
 | 
			
		||||
            }]
 | 
			
		||||
        },
 | 
			
		||||
        options: {
 | 
			
		||||
            responsive: {{ $model->responsive || !$model->width ? 'true' : 'false' }},
 | 
			
		||||
            maintainAspectRatio: false,
 | 
			
		||||
            @if($model->title)
 | 
			
		||||
                title: {
 | 
			
		||||
                    display: true,
 | 
			
		||||
                    text: "{!! $model->title !!}",
 | 
			
		||||
                    fontSize: 20,
 | 
			
		||||
                }
 | 
			
		||||
            @endif
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
		Reference in New Issue
	
	Block a user