goat1000/svggraph

生成 SVG 图表

3.20.1 2023-10-19 09:59 UTC

README

SVGGraph 可以生成各种格式的 SVG 图表。有关示例、文档等,请参阅:http://www.goat1000.com/svggraph.php

此库根据 LGPL-3.0 许可发布。

示例用法

<?php
// if you are using composer you can skip this
require 'svggraph/autoloader.php';

// set some options
$options = [
  'graph_title' => 'A simple graph',
  'bar_space' => 20,
];

// set up an array of values
$values = [ 100, 200, 140, 130, 160, 150 ];

// use full namespace to get SVGGraph instance
$graph = new Goat1000\SVGGraph\SVGGraph(600, 400, $options);

// assign the values
$graph->values($values);

// render a bar graph
$graph->render('BarGraph');