Permalink
Browse files

fixed show_query graph plot

  • Loading branch information...
1 parent 61f8968 commit f59e2ca92b063f9546e321ef488f7a1283e2b6af Gavin Towey committed Sep 25, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 lib/Anemometer.php
View
@@ -366,9 +366,9 @@ public function show_query() {
$data['time_field_name'] = $time = $this->data_model->get_field_name('time');
$data['hostname_field_name'] = $this->data_model->get_field_name('hostname');
$data['checksum_field_name'] = $this->data_model->get_field_name('checksum');
-
+
$data['timezone_offset'] = timezone_offset_get( new DateTimeZone( ini_get('date.timezone' )), new DateTime());
-
+
$data['tables'] = $this->report_obj->get_tables();
$dimension_table = $this->report_obj->get_table_by_alias('dimension');
$data['hosts'] = $this->report_obj->get_distinct_values($dimension_table, $data['hostname_field_name']);
@@ -381,11 +381,16 @@ public function show_query() {
$data['table_fields'][$t] = $this->report_obj->get_table_fields($t);
}
$data['custom_fields'] = $this->report_obj->get_custom_fields();
-
- $this->set_search_defaults('graph_defaults');
+
+ $this->set_search_defaults('graph_defaults');
$this->report_obj->process_form_data();
+ $_GET['table_fields'][] = get_var('plot_field');
+ if (get_var('dimension-pivot-'.$data['hostname_field_name'])) {
+ $_GET['dimension-pivot-'.$data['hostname_field_name']] = get_var('plot_field');
+ $data['dimension_pivot_hostname_max'] = get_var('plot_field');
+ }
//$data = $this->setup_data_for_graph_search($data);
-
+
$_GET['table_fields'][] = get_var('plot_field');
$_GET['fact-checksum'] = $checksum;
$data['ajax_request_url'] = site_url() . '?action=api&output=json2&noheader=1&datasource=' . $data['datasource'] . '&' . $this->report_obj->get_search_uri();

0 comments on commit f59e2ca

Please sign in to comment.