2017 © Pedro PelĂĄez
 

library svg-charts

SVG Charts Generator for Laravel & DOMPDF

image

dpodsiadlo/svg-charts

SVG Charts Generator for Laravel & DOMPDF

  • Tuesday, January 16, 2018
  • by Daniel PodsiadƂo
  • Repository
  • 1 Watchers
  • 4 Stars
  • 127 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 27 % Grown

The README.md

SVG Charts

A package for Laraver to generate SVG charts compatible with DOMPDF., (*1)

Installation

Via Composer, (*2)

``` bash $ composer require dpodsiadlo/svg-charts, (*3)


### Configuration (only if you have auto discovery disabled) Once installed, register Laravel service provider, in your `config/app.php`: ```php 'providers' => [ ... DPodsiadlo\SvgCharts\Providers\SvgChartsProvider::class, ]

Customize

To customize the chart you can publish the view to /resources/views/vendor/svg-charts:, (*4)

 php artisan vendor:publish --provider="DPodsiadlo\SvgCharts\Providers\SvgChartsProvider" 

Basic Usage

Line chart

Line chart example, (*5)

Blade template implementation:, (*6)

@inject('svgCharts', '\DPodsiadlo\SvgCharts\SvgCharts')     {{-- Injecting the service --}}

<img style="width: 174mm; height: 80mm"
     src="{{$svgCharts->lineChart([
            'labels' => [
                'Monday',
                'Tuesday',
                'Wednesday',
                'Thursday',
                'Friday',
                'Saturday',
                'Sunday'
            ],
            'data' => [
                [4,1,22,3,4,55,1],                          // First dataset
                [1,3,2,4,1,2,6]                             // Second dataset

            ]
         ],[
        'colors' => ['#32638e','#f00000'],                  // Colors for datasets
        'fillColor' => ['#32638e','#f00000'],                  
        'stroke' => 1,                  
        'axisColor' => '#4a4a4c',
        'axisWidth' => 2,
        'gridColor' => '#9c9c9b',
        'gridWidth' => 1,
        'valueGroups' => 5,
        'width' => 1600,
        'height' => 900,
        'valueFormatter' => function($value){               // Closure for formatting values
            return money_format("%.2n", $value);            // Used setlocale(LC_MONETARY, 'en_US.UTF-8') for this example
        }
     ])->toImgSrc()}}"/>

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

16/01 2018

dev-master

9999999-dev

SVG Charts Generator for Laravel & DOMPDF

  Sources   Download

MIT

The Requires

 

laravel svg charts

16/01 2018

v1.0.3

1.0.3.0

SVG Charts Generator for Laravel & DOMPDF

  Sources   Download

MIT

The Requires

 

laravel svg charts

14/11 2016

v1.0.2

1.0.2.0

SVG Charts Generator for Laravel & DOMPDF

  Sources   Download

MIT

The Requires

 

laravel svg charts

14/11 2016

v1.0.1

1.0.1.0

SVG Charts Generator for Laravel & DOMPDF

  Sources   Download

MIT

The Requires

 

laravel svg charts

27/07 2016

v1.0.0

1.0.0.0

SVG Charts Generator for Laravel & DOMPDF

  Sources   Download

MIT

The Requires

 

laravel svg charts