Tag Archives: Dot

Dots Only Chart with Trend Line

phpCharr dot chart

You can also render chart with dots or points only without line in between by setting “showGridLine” to false. You can further remove the grid and borders using set_grid() method. Add plugin “trendline” to show the linear approximation.

1
2
3
4
5
6
7
8
9
10
11
12
13
$pc = new C_PhpChartX(array(array(11, 9, 5, 12, 14)),'basic_chart');
$pc->add_plugins(array('trendline'));
$pc->set_defaults(array('seriesDefaults'=>array('showLine'=>false)));
// remove background, border and grid.
$pc->set_axes(array(
    'xaxis'=>array('tickOptions'=>array('showGridline'=>false)),
    'yaxis'=>array('tickOptions'=>array('showGridline'=>false))));
$pc->set_grid(array(
    'background'=>'white',
    'borderWidth'=>0,
    'borderColor'=>'#000000',
    'shadow'=>false));
$pc->draw();

Live demo

Top

Clicky