JpGraph charts Library: examples and tips

Last updated:

Fill Colours

  • you must call setFillColor() and setColor() after adding a Plot to a Graph object:

    $graph = new Graph(300,200);
    $bp1 = new BarPlot(array(10,20,30,40));


(Legend class):

  • font size and number of columns

    $graph->legend->font_size = 10; //set font-size
    $graph->legend->setColumns(4);//set number of columns


  • to set a Graph Title:

    $graph->title->Set('Your new Title');

Dialogue & Discussion