Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cekisakurek authored and github-actions[bot] committed Oct 23, 2024
1 parent 2d352db commit c58da39
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 62 deletions.
15 changes: 9 additions & 6 deletions src/ChartData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

namespace Cekisakurek\LaChart;

class ChartData {
class ChartData
{
public $data = [];

public $label = 'title';

public $type = 'bar';

public $yAxisID = 'y';

public $pointRadius = 1;

public $backgroundColor = [
Expand All @@ -18,7 +21,7 @@ class ChartData {
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)'
'rgba(201, 203, 207, 0.2)',
];

public $borderColor = [
Expand All @@ -28,8 +31,8 @@ class ChartData {
'rgb(75, 192, 192)',
'rgb(54, 162, 235)',
'rgb(153, 102, 255)',
'rgb(201, 203, 207)'
'rgb(201, 203, 207)',
];

public $borderWidth = 1.0;
}
}
19 changes: 9 additions & 10 deletions src/CompositeChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@

use Livewire\Component;

class CompositeChart extends Component {


class CompositeChart extends Component
{
public $chart_id = 'la-chart-composite-chart';

private $chart_data;

public $labels = [];

public function mount() {

}
public function mount() {}

public function setChartData($chart_data) {
public function setChartData($chart_data)
{
$this->chart_data = $chart_data;
}

public function click($id) {
public function click($id)
{
dd($this);
}

Expand All @@ -28,5 +29,3 @@ public function render()
return view('lachart::livewire.compositechart', ['chart_data' => $this->chart_data]);
}
}


21 changes: 11 additions & 10 deletions src/DoughnutChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@

use Livewire\Component;

class DoughnutChart extends Component {


class DoughnutChart extends Component
{
public $chart_id = 'la-chart-doughnut-chart';

private $chart_data;

public $labels = [];

public $chart_type = 'doughnut';
public $title;

public function mount() {
public $title;

}
public function mount() {}

public function setChartData($chart_data) {
public function setChartData($chart_data)
{
$this->chart_data = $chart_data;
}

public function click($id) {
public function click($id)
{
dd($this);
}

Expand All @@ -30,5 +33,3 @@ public function render()
return view('lachart::livewire.doughnutchart', ['chart_data' => $this->chart_data]);
}
}


46 changes: 20 additions & 26 deletions src/LaChartServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@
namespace Cekisakurek\LaChart;

use Illuminate\Support\ServiceProvider;

use Livewire\Livewire;

use Cekisakurek\LaChart\LineChart;
use Cekisakurek\LaChart\CompositeChart;
use Cekisakurek\LaChart\DoughnutChart;

class LaChartServiceProvider extends ServiceProvider
{
public function register()
{
//
if ($this->app->runningInConsole()) {
// Publish views
$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/lachart'),
], 'views');


public function register()
{
//
if ($this->app->runningInConsole()) {
// Publish views
$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/lachart'),
], 'views');

}
$this->loadViewsFrom(__DIR__.'/../resources/views', 'lachart');
}
$this->loadViewsFrom(__DIR__.'/../resources/views', 'lachart');
}

public function boot()
{
//
Livewire::component('line-chart', LineChart::class);
Livewire::component('composite-chart', CompositeChart::class);
Livewire::component('composite-chart', DoughnutChart::class);
}
}
public function boot()
{
//
Livewire::component('line-chart', LineChart::class);
Livewire::component('composite-chart', CompositeChart::class);
Livewire::component('composite-chart', DoughnutChart::class);

}
}
20 changes: 10 additions & 10 deletions src/LineChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

use Livewire\Component;

class LineChart extends Component {


class LineChart extends Component
{
public $labels = [];

public $data = [];

public $title = 'title';

public $chart_id = 'la-chart-line-chart';

public $chart_type = 'bar';

public $background_colors = [
Expand All @@ -21,7 +23,7 @@ class LineChart extends Component {
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)'
'rgba(201, 203, 207, 0.2)',
];

public $border_colors = [
Expand All @@ -31,17 +33,15 @@ class LineChart extends Component {
'rgb(75, 192, 192)',
'rgb(54, 162, 235)',
'rgb(153, 102, 255)',
'rgb(201, 203, 207)'
'rgb(201, 203, 207)',
];

public $border_width = 1.0;

public function mount() {


}
public function mount() {}

public function click($id) {
public function click($id)
{
dd($this);
}

Expand Down

0 comments on commit c58da39

Please sign in to comment.