\n" . " $(function() {\n"; // ===== XS =================================== $string = " $('#xs_chart').highcharts(\n" . " {\n" . " chart: { zoomType: 'xy' },\n" . " title: { text: '" . "Simulated Cross Section vs " . $type_string . "' },\n" . " xAxis: [\n" . " {\n" . " categories: ["; foreach($plot_x as $value) $string .= $value . ","; $string = substr($string,0,-1); $string .= "],\n" . " title: { text: '" . $type . " " . $unit_string . "', style: { color: '#000000' } }\n" . " }],\n" . " yAxis: [\n" . " { \n" . " labels: { formatter: function() { return (this.value).toPrecision(3); }, style: { color: '#000000' } },\n" . " title: { text: '" . ($axis == 1 ? "Average " : "") . "Cross Section', style: { color: '#000000' } },\n"; if($axis == 1) { $string .= " },\n" . " {\n" . " labels: { formatter: function() { return (this.value).toPrecision(3); }, style: { color: '#000000' } },\n" . " title: { text: 'Central Cross Section', style: { color: '#000000' } },\n" . " opposite: true\n"; } $string .= " }],\n" . " tooltip: { shared: true },\n" . " series: [\n"; foreach($model as $m => $v) { $string .= " {\n" . " name: '" . $model_array[$m] . " (avg)',\n" . " color: '" . $color_array[$m] . "',\n" . " step: 'center',\n" . " marker: { enabled: false },\n" . " data: ["; foreach($avg_xs[$m] as $value) $string .= $value . ","; $string = substr($string,0,-1); $string .= "],\n" . " tooltip: { pointFormat: '{series.name}: {point.y:f}' }\n" . " },\n"; if($error == 0) { $string .= " {\n" . " name: '" . $model_array[$m] . " error',\n" . " type: 'errorbar',\n" . " data: ["; foreach($avg_xs_error[$m] as $i => $value) $string .= "[" . $avg_xs[$m][$i]*(1-$avg_xs_error[$m][$i]) . "," . $avg_xs[$m][$i]*(1+$avg_xs_error[$m][$i]) . "],"; $string = substr($string,0,-1); $string .= "],\n" . " tooltip: {\n" . " pointFormat: ' (error range: {point.low:.4f}-{point.high:.4f})
'\n" . " }\n" . " },\n"; } $string .= " {\n" . " name: '" . $model_array[$m] . " (cen)',\n" . " type: 'scatter',\n" . ($axis == 1 ? " yAxis: 1,\n" : "") . " data: ["; foreach($cen_xs[$m] as $i => $value) $string .= $value . ","; $string = substr($string,0,-1); $string .= "],\n" . " tooltip: { pointFormat: ' {point.y:f}' }\n" . " },\n"; } $string = substr($string,0,-2); $string .= " ]});\n"; echo $string; // ===== RATIO ================================ $string = " $('#ratio_chart').highcharts(\n" . " {\n" . " chart: { zoomType: 'xy' },\n" . " title: { text: '" . "Central/Average Cross Section Ratio vs " . $type_string . "' },\n" . " xAxis: [\n" . " {\n" . " categories: ["; foreach($plot_x as $value) $string .= $value . ","; $string = substr($string,0,-1); $string .= "],\n" . " title: { text: '" . $type . " " . $unit_string . "', style: { color: '#000000' } }\n" . " }],\n" . " yAxis: [\n" . " { \n" . " labels: { formatter: function() { return (this.value).toPrecision(3); }, style: { color: '#000000' } },\n" . " title: { text: 'Ratio', style: { color: '#000000' } },\n" . " }],\n" . " tooltip: { shared: true },\n" . " series: [\n"; foreach($model as $m => $v) { $string .= " {\n" . " name: '" . $model_array[$m] . " (avg)',\n" . " color: '" . $color_array[$m] . "',\n" . " step: 'center',\n" . " marker: { enabled: false },\n" . " data: ["; foreach($ratio_xs[$m] as $value) $string .= $value . ","; $string = substr($string,0,-1); $string .= "],\n" . " tooltip: { pointFormat: '{series.name}: {point.y:.4f}' }\n" . " },\n"; } $string = substr($string,0,-2); $string .= " ]});\n"; echo $string; // ===== END ================================== echo " });\n" . " \n"; ?>
Plot Variable

' . "\n"; echo ' ' . "\n"; if($type != "Model") { echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo '
Model
MAIDDMT
Sato-LeeSAID

' . "\n"; } if($type != "Kinematic") { echo ' ' . "\n"; echo' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo '
Kinematic
123
567
8 (4")8 (15")
91011
121314

' . "\n"; } if($type != "W") { echo '
W (GeV)
to

' . "\n"; } if($type != "Q2") { echo '
Q2 (GeV/c)2
to

' . "\n"; } if($type != "Theta") { echo '
θpq* (degrees)
to

' . "\n"; } if($type == "W") echo '
W Bin Width
(minimum: 0.001 GeV)

' . "\n"; if($type == "Q2") echo '
Q2 Bin Width
(minimum: 0.001 (GeV/c)2

' . "\n"; if($type == "Theta") echo '
θpq* Bin Width
(minimum: 1°)

' . "\n"; echo '
Don\'t Show Error Bars

' . "\n"; echo '
Use Separate Y-Axes

' . "\n"; echo '
' . "\n"; ?>