Arbitrary – PHP Charts & Graphs https://phpchart.com Making charts in PHP is simple again. Wed, 08 Apr 2015 08:32:44 +0000 en-US hourly 1 https://wordpress.org/?v=5.8.13 Data Series With Arbitrary Values https://phpchart.com/examples/display-data-series-with-arbitrary-text-and-value-pair/ https://phpchart.com/examples/display-data-series-with-arbitrary-text-and-value-pair/#respond Thu, 31 Oct 2013 20:25:20 +0000 http://phpchart.net/?p=979 It’s common to have series that pairs data value with arbitrary text. The key is pair both data value and text in array in the following format and include three plugins: canvasTextRenderer, CategoryAxisRenderer, and CategoryAxisRenderer. 1array(array("text 1", 3), array("another text", 4)...) Complete example: 123456789101112131415161718192021222324252627$line = array(array('Cup Holder Pinion Bob', 7), array('Generic Fog Lamp', 9), array('HDTV […]

The post Data Series With Arbitrary Values appeared first on PHP Charts & Graphs.

]]>
It’s common to have series that pairs data value with arbitrary text. The key is pair both data value and text in array in the following format and include three plugins: canvasTextRenderer, CategoryAxisRenderer, and CategoryAxisRenderer.

1
array(array("text 1", 3), array("another text", 4)...)

Complete example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$line = array(array('Cup Holder Pinion Bob', 7), array('Generic Fog Lamp', 9), array('HDTV Receiver', 15), array('8 Track Control Module', 12), array(' Sludge Pump Fourier Modulator', 3),array('Transcender/Spice Rack', 6), array('Hair Spray Danger Indicator', 18));
$pc = new C_PhpChartX(array($line),'chart_1');
$pc->add_plugins(array('canvasTextRenderer'));

//set animation
$pc->set_animate(true);
//set title
$pc->set_title(array('text'=>'Concern vs. Occurrance'));

//set series
$pc->add_series(array('renderer'=>'plugin::BarRenderer'));
//set axes
$pc->set_axes(array(
        'xaxis'  => array(
            'renderer'=>'plugin::CategoryAxisRenderer',
            'label'=>'Warranty Concern',
            'tickOptions'=>array(
                'enableFontSupport'=>true,'angle'=>-30),
            'tickRenderer'=>'plugin::CanvasAxisTickRenderer'),
        'yaxis'  => array(
            'autoscale'=>true,
            'label'=>'Occurance',
            'tickOptions'=>array('enableFontSupport'=>true,'angle'=>-30),
            'tickRenderer'=>'plugin::CanvasAxisTickRenderer')
     ));

$pc->draw(800,500);

Live demo

The post Data Series With Arbitrary Values appeared first on PHP Charts & Graphs.

]]>
https://phpchart.com/examples/display-data-series-with-arbitrary-text-and-value-pair/feed/ 0