{{-- Layout Reference --}}
@extends('Limitless::Help.Layout.Master')

@section('Limitless::Content')

    @php

        // sample backend data
        $categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
        $series = ['ONC', 'APR', 'SPR', 'PHX', 'SIG', 'BRG', 'MNT', 'SDK', 'OCT'];

        $seriesData = [];
        foreach ($series as $s) {
            $data['name'] = $s;
            $dataArray = [];
            foreach ($categories as $c) {
               $dataArray[] = rand(1,100);
            }
            $data['data'] = $dataArray;
            $data['index'] = 0; //rand(0,1); on what chart index to add.
            $seriesData[] = $data;
        }

        // json string data should be valid else it will return null
        $rawData = '{
           "xAxis":{
              "type":"category",
              "boundaryGap":false,
              "data":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
           },
           "yAxis":{
              "type":"value"
           },
           "series":[
              {
                 "data":[820,932,901,934,1290,1330,1320],
                 "type":"line",
                 "areaStyle":{}
              }
           ]
        }';

    @endphp

    @Limitless::CardStart(['title' => "Basic Setup", 'icon' => 'icon-info22' ] )
        @Limitless::LineChart([
            'categories' => $categories,
            'series' => $seriesData,
        ])
    @Limitless::CardStop

    @Limitless::CardStart(['title' => "Chart 2  (raw)", 'icon' => 'icon-info22' ] )
        @Limitless::LineChart([
            'raw' => $rawData
        ])
    @Limitless::CardStop

{{--    @Limitless::CardStart(['title' => "Chart 3", 'icon' => 'icon-info22' ] )--}}
{{--        @Limitless::LineChartStart--}}
{{--        @Limitless::LineChartStop--}}
{{--    @Limitless::CardStop--}}

@stop
