set_style( "{font-size: 20px; color: #A2ACBA; text-align: center;}" ); $chart->set_title( $title ); $area = new area(); $area->set_colour( '#8f8fbd' ); $area->set_values( $price ); $area->set_key( 'Price', 12 ); $chart->add_element( $area ); $x_labels = new x_axis_labels(); $x_labels->set_steps( 2 ); $x_labels->set_vertical(); $x_labels->set_colour( '#A2ACBA' ); $x_labels->set_labels( $year ); // 插入数据 $x = new x_axis(); $x->set_colour( '#dadada' ); $x->set_grid_colour( '#D7E4A3' ); $x->set_offset( false ); $x->set_steps(4); // Add the X Axis Labels to the X Axis $x->set_labels( $x_labels ); $chart->set_x_axis( $x ); // // LOOK: // $x_legend = new x_legend( '1983 to 2008' ); $x_legend->set_style( '{font-size: 20px; color: #778877}' ); $chart->set_x_legend( $x_legend ); // // remove this when the Y Axis is smarter // $y = new y_axis(); $y->set_range( 0, 150, 30 ); $chart->add_y_axis( $y ); echo $chart->toPrettyString();