iamamirsalehi/sparkline 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

iamamirsalehi/sparkline

Composer 安装命令:

composer require iamamirsalehi/sparkline

包简介

README 文档

README

License Download GitHub stars

This is a port of fnando/sparkline. Due to the nature of PHP, it does not have many of the features that the JavaScript version does, but can still generate pretty SVG sparklines from a dataset. Here's how it works:

Usage

This is a minimum working example:

require_once('sparkline.php'); // Or whatever the path is
echo sparkline('sparkline', [1, 5, 2, 4, 8, 3, 7]);

It will output an SVG that looks like this:

API

sparkline($svgClass, $values, $lineColor, $fillColor, $options)

Parameter Default Value Description
$svgClass (Required) The CSS class for your sparkline. You can use this to style specific sparklines.
$values (Required) An array of the values to be graphed. Example: [1,2,3,4,5];
$lineColor 'red' A value that will be put into the stroke attribute of the line path. Any CSS color values work.
$fillColor 'none' A value that will be put into the fill attribute of the sparkline's fill. CSS colors work.
$options ['strokeWidth' => 3, 'width' => 100, 'height' => 30] An array of options for the sparkline.

License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固