PHP Classes

APEXCharts Laravel Charts Library: Display charts on a page using APEXCharts library

Recommend this page to a friend!
  Info   Documentation   Demos   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 50 All time: 10,720 This week: 62Up
Version License PHP version Categories
larapex-charts 1.0.4Custom (specified...7.0PHP 5, Graphics
Description 

Author

This package can be used to display charts on a page using APEXCharts library.

It provides a fluent interface to define the type and properties to configure a given chart.

The class can return an URL to a CDN Web server where the APEXCharts JavaScript library is hosted, so the library is loaded and renders the configured chart on a Web page where the chart is embedded.

Picture of Ariel Mejia Dev
Name: Ariel Mejia Dev <contact>
Classes: 1 package by
Country: Guatemala Guatemala

 

Documentation

Larapex Charts

A Laravel wrapper for apex charts library.

Installation

Use composer.

composer require arielmejiadev/larapex-charts

Usage

Basic example

In your controller add:

$chart = LarapexChart::setTitle('Posts')
                   ->setDataset([150, 120])
                   ->setLabels(['Published', 'No Published']);

Remember to import the Facade to your controller with

use ArielMejiaDev\LarapexCharts\Facades\LarapexChart

Or importing the LarapexChart class:

use ArielMejiaDev\LarapexCharts\LarapexChart;

Then in your view (Blade file) add:

 <!doctype html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport"
           content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>Chart Sample</title>
 </head>
 <body>
 
     {!! $chart->container() !!}
 
     <script src="{{ $chart->cdn() }}"></script>
 
     {{ $chart->script() }}
 </body>
 </html>

More complex example

$chart = LarapexChart::setType('area')
        ->setTitle('Total Users Monthly')
        ->setSubtitle('From January to March')
        ->setXAxis([
            'Jan', 'Feb', 'Mar'
        ])
        ->setDataset([
            [
                'name'  =>  'Active Users',
                'data'  =>  [250, 700, 1200]
            ]
        ]);

You can create a variety of charts including: Line, Area, Bar, Horizantal Bar, Heatmap, pie, donut and Radialbar.

More examples

Check the documentation on: Larapex Chart Docs

Contributing

The author Ariel Mejia Dev.

License

MIT


  Larapex Charts DocsExternal page  

Open in a separate window

Screenshots (1)  
  • Untitled.png
  Files folder image Files (23)  
File Role Description
Files folder image.idea (7 files)
Files folder imageconfig (1 file)
Files folder imagepublic (1 file)
Files folder imageresources (1 directory)
Files folder imagesrc (2 files, 1 directory)
Files folder imagetests (1 file, 2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 95%
Total:50
This week:0
All time:10,720
This week:62Up