lang/php

Multi-library chart PHP

C/H 2017. 5. 26. 08:30

BotMan is a framework agnostic PHP library that is designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger and WeChat.
BotMan은 Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger 및 WeChat을 비롯한 여러 메시징 플랫폼 용 혁신적인 봇을 개발하는 작업을 단순화하기 위해 설계된 프레임 워크에 무관한 PHP 라이브러리입니다

composer require consoletvs/charts:4.*
namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use Charts;

class TestController extends Controller
{
    public function index()
    {
        $chart = Charts::multi('bar', 'material')
            // Setup the chart settings
            ->title("My Cool Chart")
            // A dimension of 0 means it will take 100% of the space
            ->dimensions(0, 400) // Width x Height
            // This defines a preset of colors already done:)
            ->template("material")
            // You could always set them manually
            // ->colors(['#2196F3', '#F44336', '#FFC107'])
            // Setup the diferent datasets (this is a multi chart)
            ->dataset('Element 1', [5,20,100])
            ->dataset('Element 2', [15,30,80])
            ->dataset('Element 3', [25,10,40])
            // Setup what the values mean
            ->labels(['One', 'Two', 'Three']);

        return view('test', ['chart' => $chart]);
    }
}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>My Charts</title>

        {!! Charts::assets() !!}

    </head>
    <body>
        <center>
            {!! $chart->render() !!}
        </center>
    </body>
</html>

반응형

'lang > php' 카테고리의 다른 글

php7.1 Catching Multiple Exception Types  (0) 2017.05.31
brew php-xdebug  (0) 2017.05.29
botman PHP  (0) 2017.05.25
Rinvex Country - PHP  (0) 2017.05.24
Requests for PHP  (0) 2017.05.23