LogAxisRenderer – PHP Charts & Graphs https://phpchart.com Making charts in PHP is simple again. Wed, 19 Jul 2023 03:18:08 +0000 en-US hourly 1 https://wordpress.org/?v=5.8.13 Logarithmic Axis using LogAxisRenderer https://phpchart.com/examples/logarithmic-axis-using-logaxisrenderer/ https://phpchart.com/examples/logarithmic-axis-using-logaxisrenderer/#respond Mon, 23 Jun 2014 17:56:16 +0000 http://phpchart.org/?p=1115 Display logarithmic axis using LogAxisRenderer. Make sure the tickDistribution is set to “power” for power of 10 display on its axis. 12345678910111213141516171819202122232425<?php $line1 = array(array(100,121), array(2000,21), array(5000,35), array(6600,43)); $pc = new C_PhpChartX(array($line1),'chart_1'); $pc->add_plugins(array('canvasTextRenderer')); // curved line $pc->set_series_default(array('rendererOptions'=> array('smooth'=>true))); // Logarithm $pc->set_axes(array(     'xaxis'  => array(         'renderer'=>'plugin::LogAxisRenderer',         […]

The post Logarithmic Axis using LogAxisRenderer appeared first on PHP Charts & Graphs.

]]>
logarithm_chart

Display logarithmic axis using LogAxisRenderer. Make sure the tickDistribution is set to “power” for power of 10 display on its axis.

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
<?php
$line1 = array(array(100,121), array(2000,21), array(5000,35), array(6600,43));
$pc = new C_PhpChartX(array($line1),'chart_1');
$pc->add_plugins(array('canvasTextRenderer'));
// curved line
$pc->set_series_default(array('rendererOptions'=> array('smooth'=>true)));
// Logarithm
$pc->set_axes(array(
    'xaxis'  => array(
        'renderer'=>'plugin::LogAxisRenderer',
        'tickOptions'=>array('tickDistribution' =>"power",  // power of 10
                             'formatString'     => "%'i",
                             'showGridline'=>false),
        'labelRenderer'=>'plugin::CanvasAxisLabelRenderer',
        'min'=>0,
        'showGridline'=>false,
        'ticks'=> array(1, 10, 100, 1000, 10000)
        ),

    'yaxis'  => array(
        'autoscale'=>false,
        'tickOptions'=>array('showGridline'=>false),
        'labelRenderer'=>'plugin::CanvasAxisLabelRenderer')
));
$pc->draw(800,500);

Live demo

The post Logarithmic Axis using LogAxisRenderer appeared first on PHP Charts & Graphs.

]]>
https://phpchart.com/examples/logarithmic-axis-using-logaxisrenderer/feed/ 0