承接 brendt/php-sparkline 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

brendt/php-sparkline

最新稳定版本:2.0.1

Composer 安装命令:

composer require brendt/php-sparkline

包简介

Generate sparkline SVGs in PHP

README 文档

README

Latest Version on Packagist Tests Total Downloads

PHP-Sparkline generates GitHub style sparkline graphs. Read this guide to know how to use it.

Installation

You can install the package via composer:

composer require brendt/php-sparkline

Usage

$sparkLine = new SparkLine(1, 2, 5, 10, 2);

$total = $sparkLine->getTotal();

$svg = $sparkLine->make();

To construct a sparkline, you'll have to pass in an array of values.

Customization

You can pick any amount of colors and the sparkline will automatically generate a gradient from them:

$sparkLine = (new SparkLine($days))->withColors('#4285F4', '#31ACF2', '#2BC9F4');

You can configure the stroke width:

$sparkLine = (new SparkLine($days))->withStrokeWidth(4);

As well as the dimensions (in pixels):

$sparkLine = SparkLine::new($days)->withDimensions(width: 500, height: 100);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 62.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 352
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 352
  • Watchers: 5
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-08