$chart = new Highchart(Highchart::HIGHSTOCK); $chart->chart->renderTo = "container"; $chart->chart->events->load = new HighchartJsExpr( "function(chart) { this.setTitle(null, { text: 'Built chart at '+ (new Date() - start) +'ms' }); }"); $chart->chart->zoomType = "x"; $chart->rangeSelector->buttons[] = array( 'type' => "day", 'count' => 3, 'text' => "3d" ); $chart->rangeSelector->buttons[] = array( 'type' => "week", 'count' => 1, 'text' => "1w" ); $chart->rangeSelector->buttons[] = array( 'type' => "month", 'count' => 1, 'text' => "1m" ); $chart->rangeSelector->buttons[] = array( 'type' => "month", 'count' => 6, 'text' => "6m" ); $chart->rangeSelector->buttons[] = array( 'type' => "year", 'count' => 1, 'text' => "1y" ); $chart->rangeSelector->buttons[] = array( 'type' => "all", 'text' => "All" ); $chart->rangeSelector->selected = 3; $chart->yAxis->title->text = "Temperature (°C)"; $chart->title->text = "Hourly temperatures in Vik i Sogn, Norway, 2004-2010"; $chart->subtitle->text = "Built chart at..."; $chart->series[] = array( 'name' => "Temperature", 'data' => new HighchartJsExpr("data"), 'pointStart' => new HighchartJsExpr("Date.UTC(2004, 3, 1)"), 'pointInterval' => 3600 * 1000, 'tooltip' => array( 'valueDecimals' => 1, 'valueSuffix' => "°C" ) );