fxcosta / laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library
486 stars 112 forks source link

Support for laravel 5.4 #23

Closed ghost closed 7 years ago

fxcosta commented 7 years ago

I need to look at whether there have been any changes in APIs we use but I believe it is compatible. I'll check!

koossaayy commented 7 years ago

no they are not , here's the log from the composer `composer require fx3costa/laravelchartjs Using version ^2.1 for fx3costa/laravelchartjs ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1

Installation failed, reverting ./composer.json to its original content. `

pjeutr commented 7 years ago

I guess adding || 5.4.* to composer.json wil fix it?

paulbrab commented 7 years ago

Waiting on this one also. Thanks.

fxcosta commented 7 years ago

fixed in 6c6976d59e8a84a644ba5b6ff865a92643aae3f3

pjeutr commented 7 years ago

Great it's working now

butchewing commented 7 years ago

How can I pull the corrected repo into composer?

paulbrab commented 7 years ago

Packagist version still shows 2.1.0

Thanks

fxcosta commented 7 years ago

sorry! i forgot publish new release to packagist. Its done!!

paulbrab commented 7 years ago

Great. Thanks for the fast response and excellent work.

butchewing commented 7 years ago

Thanks @fxcosta

koossaayy commented 7 years ago

Wooohooo Thank You Sir

FredLopes0203 commented 7 years ago

I'm going to draw chart in my web app. And I've found this just before. As you metioned in your readme.md, I've setup this using composer require and also added config/app.php I've added div to my example blade and also added code to my controller. But nothing displayed... what's wrong?

FredLopes0203 commented 7 years ago

This is my dashboard balde.

@extends('layouts.app')

@section('content')

Dashboard
You are logged in!
{{ $chartjs->render() }}

@endsection

FredLopes0203 commented 7 years ago

this is my dashboard controller

public function index() { $chartjs = app()->chartjs ->name('lineChartTest') ->type('line') ->element('lineChartTest') ->labels(['January', 'February', 'March', 'April', 'May', 'June', 'July']) ->datasets([ [ "label" => "My First dataset", 'backgroundColor' => "rgba(38, 185, 154, 0.31)", 'borderColor' => "rgba(38, 185, 154, 0.7)", "pointBorderColor" => "rgba(38, 185, 154, 0.7)", "pointBackgroundColor" => "rgba(38, 185, 154, 0.7)", "pointHoverBackgroundColor" => "#fff", "pointHoverBorderColor" => "rgba(220,220,220,1)", 'data' => [65, 59, 80, 81, 56, 55, 40], ], [ "label" => "My Second dataset", 'backgroundColor' => "rgba(38, 185, 154, 0.31)", 'borderColor' => "rgba(38, 185, 154, 0.7)", "pointBorderColor" => "rgba(38, 185, 154, 0.7)", "pointBackgroundColor" => "rgba(38, 185, 154, 0.7)", "pointHoverBackgroundColor" => "#fff", "pointHoverBorderColor" => "rgba(220,220,220,1)", 'data' => [12, 33, 44, 44, 55, 23, 40], ] ]) ->options([]);

    return view('dashboard', compact('chartjs'));
}
FredLopes0203 commented 7 years ago

I've added Fx3costa\LaravelChartJs\Providers\ChartjsServiceProvider::class, to my config/app.php

FredLopes0203 commented 7 years ago

Would you like to let me know how to install chart js library? As I'm new to laravel, I'm not sure what should i do. Please help me.

oyed commented 7 years ago

@FredLopes0203 If you're having an issue with the library, you need to open up a new issue.

fxcosta commented 7 years ago

@FredLopes0203 open a new issue about this problem to another devs in future. the problem probably is that you not installed the chartjs lib. you can download it via npm, cdn or whatever. you must add the chartjs lib in your template, like this:

<head>
    <title>My app</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>

I'll close this issue because your goal has already been completed.

khelilo7 commented 7 years ago

I need to format its Y axis like 1024 = 1 Mo