Download the PHP package mohsen-mhm/laravel-image-charts without Composer
On this page you can find all versions of the php package mohsen-mhm/laravel-image-charts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mohsen-mhm/laravel-image-charts
More information about mohsen-mhm/laravel-image-charts
Files in mohsen-mhm/laravel-image-charts
Package laravel-image-charts
Short Description Image-charts PHP library to make chart in image format
License MIT
Homepage https://github.com/Mohsen-mhm/laravel-image-charts
Informations about the package laravel-image-charts
Laravel Image Charts
Image-charts PHP library to generate charts in image format for your Laravel application.
Installation
You can install the package via Composer:
Publish the Configuration File
To publish the configuration file, use the following command:
This will create a configuration file named image-charts.php
in the config
directory.
Configuration
You can configure the package settings in the config/image-charts.php
file. The default configuration values are:
Usage
Generating a Chart URL
Here's an example of how to use the package to generate a chart URL:
or use Facade:
You can then use this URL to display the chart in your application.
Downloading the Chart Image
You can also download the generated chart image to a local file. If no path is specified, the image will be saved to the default path specified in the configuration file.
or use Facade:
This will save the image to the default path with a generated file name and return the full path to the saved image. You can also specify a custom path:
or use Facade:
Output
Full Usage Example
Output
Methods
The ImageChart class provides the following methods for configuring your chart:
setData(array $data)
: Set the data points for the chart.setLabels(array $labels)
: Set the labels for the chart.setBackgroundColor(string $color)
: Set the background color for the chart.setDatasetBackgroundColor(string $color)
: Set the background color for the dataset.setDatasetBorderColor(string $color)
: Set the border color for the dataset.setWidth(string $width)
: Set the width of the chart.setHeight(string $height)
: Set the height of the chart.setTitleText(string $title)
: Set the title text of the chart.getUrl()
: Generate and return the chart URL.getImage(string $path = null)
: Download the chart image to a specified local file path, or use the default path if not specified. Returns the full path to the saved image.getBinary()
: Generate and return the chart image in binary format.
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request on GitHub.
More chart types & features coming soon... :)
Authors
Mohsen Mohammadi - Developer For more information, please visit the GitHub repository.