Download the PHP package larawire-garage/larapex-livewire without Composer
On this page you can find all versions of the php package larawire-garage/larapex-livewire. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download larawire-garage/larapex-livewire
More information about larawire-garage/larapex-livewire
Files in larawire-garage/larapex-livewire
Package larapex-livewire
Short Description Laravel wrapper for ApexCharts javascript plugin advanced features with livewire
License MIT
Informations about the package larapex-livewire
Larapex Livewire
Laravel wrapper for ApexCharts javascript plugin advanced features with livewire
Installation
Publish configurations
Publish assets
Add Scripts
add @larapexScripts
blade directive end of the body tag and before other scripts in main app layout file
If you want to use chart only in sub pages or livewire component and need to push scripts to specific stack add stack name to script_section in larapex-livewire.php
config file
Make a chart
and Select a Chart Type from
- Area Chart
- Bar Chart
- Brush Chart
- Donut Chart
- Line Chart
- Pie Chart
then its generate a chart class.
Fill Data
Chart class is a normal livewire class and you can use livewire features inside the class. For example event_listeners, parse value through mount() method etc.
Add data generating code in getData()
function and use it to fill data in build()
method.
Add chart to page
add chart like any other livewire component into the blade file
Use chart class namespace in dot notation and all in slug format for chart component name in
@livewire()
blade directive.
example:
app/Http/Livewire/TestChart.php Class can use as 'test-chart'.
app/Http/Livewire/Charts/TestChart.php Class can use as 'charts.test-chart'.
Customize Chart
Can use any option except javascript callback functions as a array using set
functions
- setChart()
- setColors()
- setDataLabels()
- setFill()
- setForecastDataPoints()
- setGrid()
- setLabels()
- setLegend()
- setMarkers()
- setNoData()
- setDataset()
- setStates()
- setStroke()
- setSubtitle()
- setTheme()
- setTitle()
- setTooltip()
- setPlotOptions()
- setXAxis()
- setYAxis()
also ApexChart has few helper functions
- sparklineEnable(bool $enable)
- colors(array $colors)
- randomColors(int $limit)
- showDataLabels(bool $show)
- dataLabelsTextAnchor(string $anchor)
- dataLabelsStyles(array $styles)
- fillColors(array $colors)
- fillType(string $type)
- fillOpacity(float $opacity)
- fillSolid(array $colors)
- fillGradient(array $fromColors, array $toColors, array $others, string $shade, string $direction, array $colorStops, array $customStops)
- showGrid(bool $show)
- setGridInfo(array $info)
- labels(array $labels)
- markers(array $colors,int $width,int $hoverSize, array $others)
- noData($text, string $halign, string $valign, array $others)
- stroke(int $width, array $colors, string $curve, array $others)
- curve(string $curve)
- subtitle(string $subtitle, string $position, array $others)
- theme(string $mode, array $others)
- title(string $title, string $align, array $others)
- showTooltip(bool $show)
- tooltip(bool $show, string $theme, bool $fillSeriesColor, array $others)
- xAxis(array $categories, string $type, string $title, array $others)
- xAxisType(string $type)
- xAxisTickPlacement(string $placement)
- yAxis(bool $show, array $others)
- zoom(bool $enable, string $type, array $others)
Overwrite configs
- background(string $color)
- foreColor(string $color)
- fontFamily(string $fontFamily)
- height(string $height)
- width(string $width)
Inspiration
Highly inspired by Larapex Charts Package.
!!! :tada::tada::tada: Enjoy :tada::tada::tada: !!!