@for ($i = 0; $i < sizeof($data['legend']); $i++)
@foreach($data['legend'][$i] as $key => $legend_item)
@if ($key == \App\Helpers\GraphHelper::CHART_LEGEND_MAIN)
{{ Form::label_styled(' ', null, \App\Helpers\FormComponentHelper::SIZE_SMALL, 1, null, null, 'color-div color-'.str_replace('#', '', $data['colors'][$i]).'-div') }}
{{ Form::label_styled($legend_item['text'], 'chart-legend-label', \App\Helpers\FormComponentHelper::SIZE_SMALL) }}
@if (isset($legend_item[\App\Helpers\GraphHelper::CHART_DATA_TOOLTIP]))
@include('shared.forms._tooltip', ['tooltip_id' => $legend_item[\App\Helpers\GraphHelper::CHART_DATA_TOOLTIP]] )
@endif
@elseif ($key == \App\Helpers\GraphHelper::CHART_LEGEND_DETAILS)
{{ Form::label_styled(' ', null, \App\Helpers\FormComponentHelper::SIZE_SMALL, 1, null, null, 'color-div') }}
@if (is_array($legend_item))
{{ Form::label_styled($legend_item[\App\Helpers\GraphHelper::CHART_LABEL], 'chart-legend-label', \App\Helpers\FormComponentHelper::SIZE_SMALL) }}
{{ Form::label_styled($legend_item[\App\Helpers\GraphHelper::CHART_DELTA], 'chart-legend-label '.$legend_item[\App\Helpers\GraphHelper::CHART_DELTA_CLASS], \App\Helpers\FormComponentHelper::SIZE_SMALL) }}
@else
{{ Form::label_styled($legend_item, 'chart-legend-label', \App\Helpers\FormComponentHelper::SIZE_SMALL, 10, null, null, 'chart-legend-div') }}
@endif
@elseif ($key == \App\Helpers\GraphHelper::CHART_LEGEND_BUTTON)
{{ Form::label_styled(' ', null, \App\Helpers\FormComponentHelper::SIZE_SMALL, 1, null, null, 'color-div') }}
{{ Form::button_ex('Details', $legend_item[\App\Helpers\GraphHelper::CHART_DATA_ON_CLICK], null, 'report-details-btn') }}
@endif
@endforeach
@endfor