• Stars
    star
    223
  • Rank 178,458 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Laravel wrapper for apex charts

Larapex Charts

MadeWithLaravel.com shield

Latest Stable Version

Total Downloads

GitHub Actions

License

A Laravel wrapper for apex charts library Check the documentation on: Larapex Chart Docs.

Installation

Use composer.

composer require arielmejiadev/larapex-charts

Usage

Basic example

In your controller add:

$chart = (new 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 = (new 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

Support the project

Hey 👋 thanks for considering making a donation, with these donations I can continue working to contribute to opensource projects.

To do for version 4

  • Add blade directive @apexchartscdn
  • Add blade directive @script($chart)
  • Add a command to generate a blade component with the boilerplate directives just to include it on any blade file.
  • Add a command to generate a vue component with all the boilerplate to just pass a chart prop and include the component on any vue component.

More Repositories

1

json-api-auth

Laravel package to add authentication scaffold for Json APIs.
PHP
27
star
2

jetbar

Laravel package to add sidebar layout and basic componentes to make even easier development process on Jetstream with Livewire & Inertia stacks.
Vue
16
star
3

inertiajs-error-page

Package to add Laravel 5.7 beautiful error pages with a Vue error component & TailwindCSS.
Vue
9
star
4

SNIPPET_Laravel-charts

A sample code example that use Laravel chart package for Medium and Dev.to post
PHP
8
star
5

filament-printable

PHP
7
star
6

pagalogt

package to implement PagaloGT payments on Laravel apps.
PHP
4
star
7

laravel-query-class

it generates query classes to handle requests with multiple filters, sorts and includes.
PHP
3
star
8

laravel-vue-commands

This package adds artisan commands to create VueJS components and InertiaJS components.
PHP
3
star
9

commentable

It is a Laravel & VueJS application with inertia to show polymorphic relationships for a blog comments based system
PHP
1
star
10

NOTES_Laravel

This repo contains notes, warnings, tricks and tips from my development experience with Laravel.
1
star
11

COURSE_Dart-Basics

Dart
1
star
12

Inertia-Todolist

Laravel & InertiaJS SPA
PHP
1
star
13

meetup-testing-june-2021

PHP
1
star
14

trending-topic-chatbot-for-whatsapp

a chatbot for whatsapp to get the top trending topics around the world
PHP
1
star
15

laravel-ci-test

PHP
1
star
16

recaudar.github.io

Legacy landing page of recaudar.com
CSS
1
star
17

Larapex-Charts-Example

Here an example of Larapex charts usage with Laravel and TailwindCSS
PHP
1
star
18

Laravel-notifications-practice

Repo with Laravel notifications on db and email to test all notification features.
PHP
1
star
19

project-sample

Sample project with sample, TDD, traits, macros, Dependency Injections
PHP
1
star
20

filament-printable-demo

A Laravel + Filament App Demo to add Print button in Lists, Create and Update Views
PHP
1
star