Skip to content

Commit

Permalink
Merge pull request #64 from ArielMejiaDev/grid-syntax-issue
Browse files Browse the repository at this point in the history
fix confusing syntax on set grid method
  • Loading branch information
ArielMejiaDev authored Sep 18, 2022
2 parents 8063273 + cc0b240 commit 88ddc1a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .idea/larapex-charts.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions src/LarapexChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,13 @@ public function setXAxis(array $categories) :LarapexChart
return $this;
}

public function setGrid($transparent = true, $color = '#e5e5e5', $opacity = 0.1) :LarapexChart
public function setGrid($color = '#e5e5e5', $opacity = 0.1) :LarapexChart
{
if($transparent) {
$this->grid = json_encode(['show' => true]);
return $this;
}

$this->grid = json_encode([
'show' => true,
'row' => [
'colors' => [$color, 'transparent'],
'opacity' => $opacity ? $opacity : 0.5
'opacity' => $opacity,
],
]);

Expand Down
7 changes: 3 additions & 4 deletions tests/Unit/ChartsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

use ArielMejiaDev\LarapexCharts\LarapexChart;
use ArielMejiaDev\LarapexCharts\Tests\TestCase;
use Illuminate\Support\Facades\Artisan;

class ChartsTest extends TestCase
{
/** @test */
public function it_tests_larapex_charts_install_add_chart_stubs()
{
Artisan::call('vendor:publish --all');

$chartTypes = collect([
'PieChart',
'DonutChart',
Expand All @@ -34,10 +37,6 @@ public function it_tests_larapex_charts_install_add_chart_stubs()
file_exists(base_path("stubs/charts/Json/{$chart}.stub"))
);
});

$this->assertTrue(
file_exists(app_path('Console/Commands/ChartMakeCommand.php'))
);
}

/** @test */
Expand Down

0 comments on commit 88ddc1a

Please sign in to comment.