diff --git a/CHANGELOG.md b/CHANGELOG.md
old mode 100644
new mode 100755
index 462dde3..6c091a9
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 2.5.3 - 2017-05-17
+### Bug Fixes
+- Report chart usability and rendering improvements
+
+### Addresses Github Issues
+- #51
+
## 2.5.2 - 2017-04-20
### Added
- CRON functionality
diff --git a/organic-search-analytics/css/styles.css b/organic-search-analytics/css/styles.css
old mode 100644
new mode 100755
index 3fffafa..5bf9a9b
--- a/organic-search-analytics/css/styles.css
+++ b/organic-search-analytics/css/styles.css
@@ -212,7 +212,18 @@ table.sidebysidetable td {
font-weight: bold;
}
-#reportChartContainer { padding-bottom: 70px; }
+#reportChartContainer {
+ padding-bottom: 3%;
+}
+
+#reportchart.bar {
+ max-width: 90%;
+}
+
+#chartDataCallout {
+ height: 40px;
+ margin-left: 2%;
+}
.processing {
font-weight: bold;
@@ -238,6 +249,8 @@ table.sidebysidetable td {
.clear { clear:both; }
+.italic { font-style: italic; }
+
footer { margin-top: 50px; padding: 20px 20px 15px; background-color:#DDDDDD; }
/* Alert Box */
diff --git a/organic-search-analytics/inc/code/reports.php b/organic-search-analytics/inc/code/reports.php
old mode 100644
new mode 100755
index 861f6c1..cf8d4d3
--- a/organic-search-analytics/inc/code/reports.php
+++ b/organic-search-analytics/inc/code/reports.php
@@ -24,6 +24,9 @@ class Reports
{
+ const EMPTY_RESULT_PLACEHOLDER = "not set";
+
+
public $core;
diff --git a/organic-search-analytics/inc/html/reportSettings.php b/organic-search-analytics/inc/html/reportSettings.php
old mode 100644
new mode 100755
index cb7bbcb..d9866b1
--- a/organic-search-analytics/inc/html/reportSettings.php
+++ b/organic-search-analytics/inc/html/reportSettings.php
@@ -131,7 +131,7 @@
>
- Past 30 Days
+ Past 30 Days
diff --git a/organic-search-analytics/report.php b/organic-search-analytics/report.php
old mode 100644
new mode 100755
index 1f7c564..0163784
--- a/organic-search-analytics/report.php
+++ b/organic-search-analytics/report.php
@@ -166,63 +166,113 @@
$indexDomain = substr( $index, 0, strlen( $reportParams['domain'] ) );
if( strlen( $index ) > strlen( $indexDomain ) && $indexDomain == $reportParams['domain'] ) {
$jqData[$groupByAlias][] = substr( $index, strlen( $reportParams['domain'] ) );
+ } else {
+ $jqData[$groupByAlias][] = ( strlen( $index ) > 0 ? $index : Reports::EMPTY_RESULT_PLACEHOLDER );
}
} else {
$jqData[$groupByAlias][] = $index;
}
- $jqData['impressions'][] = $values["impressions"];
- $jqData['clicks'][] = $values["clicks"];
- $jqData['ctr'][] = ( $values["clicks"] / $values["impressions"] ) * 100;
- $jqData['avg_position'][] = $values["avg_position"];
+ if( $groupByAlias == "date" ) {
+ $jqData['impressions'][$index][] = $values["impressions"];
+ $jqData['clicks'][$index][] = $values["clicks"];
+ $jqData['ctr'][$index][] = ( $values["clicks"] / $values["impressions"] ) * 100;
+ $jqData['avg_position'][$index][] = $values["avg_position"];
+ } else {
+ $jqData['impressions'][] = $values["impressions"];
+ $jqData['clicks'][] = $values["clicks"];
+ $jqData['ctr'][] = ( $values["clicks"] / $values["impressions"] ) * 100;
+ $jqData['avg_position'][] = $values["avg_position"];
+
+ }
}
- $num = count( $jqData[$groupByAlias] );
$posString = "";
- $xAxis = "";
$posMax = 0;
- for( $c=0; $c<$num; $c++ ) {
- if( $c != 0 ) {
- $posString .= ",";
- $xAxis .= ",";
+ $labelMax = 50;
+ $labelMaxSuffix = "...";
+
+ if( $groupByAlias == "date" ) {
+ asort( $jqData[$groupByAlias] );
+ $jqData[$groupByAlias] = array_values( $jqData[$groupByAlias] );
+
+ $c = 0;
+ foreach( $jqData[$groupByAlias] as $key ) {
+ if( $c != 0 ) {
+ $posString .= ",";
+ }
+ $posString .= "['".addslashes($key)."',".$jqData['avg_position'][$key][0]."]";
+ if( $jqData['avg_position'][$key][0] > $posMax ) { $posMax = $jqData['avg_position'][$key][0]; }
+ $c+=1;
+ }
+ } else {
+ $num = count( $jqData[$groupByAlias] );
+ for( $c=0; $c<$num; $c++ ) {
+ if( $c != 0 ) {
+ $posString .= ",";
+ }
+ $posString .= "['".$jqData[$groupByAlias][$c]."',".round( $jqData['avg_position'][$c], 2 )."]";
+ if( $jqData['avg_position'][$c] > $posMax ) { $posMax = $jqData['avg_position'][$c]; }
}
- $posString .= "['".addslashes($jqData[$groupByAlias][$c])."',".$jqData['avg_position'][$c]."]";
- if( $jqData['avg_position'][$c] > $posMax ) { $posMax = $jqData['avg_position'][$c]; }
- $xAxis .= "['".addslashes($jqData[$groupByAlias][$c])."','".addslashes($jqData[$groupByAlias][$c])."']";
}
?>
-
+
+
+
+
+
+ No records found.
+
diff --git a/organic-search-analytics/version.txt b/organic-search-analytics/version.txt
old mode 100644
new mode 100755
index 21b159d..a4db534
--- a/organic-search-analytics/version.txt
+++ b/organic-search-analytics/version.txt
@@ -1 +1 @@
-2.5.2
\ No newline at end of file
+2.5.3
\ No newline at end of file