Skip to content

Commit

Permalink
Trivial code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Jun 9, 2014
1 parent 74fbb41 commit d0e3147
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions includes/charts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
class WP_Stream_Reports_Charts {

public function __construct() {

// Make charts
add_filter( 'wp_stream_reports_make_chart', array( $this, 'pie_chart_coordinates' ), 10, 2 );
add_filter( 'wp_stream_reports_make_chart', array( $this, 'bar_chart_coordinates' ), 10, 2 );
add_filter( 'wp_stream_reports_make_chart', array( $this, 'line_chart_coordinates' ), 10, 2 );

}
function line_chart_coordinates( $records, $args ) {

public function line_chart_coordinates( $records, $args ) {
if ( 'line' !== $args['chart_type'] ) {
return $records;
}
Expand All @@ -30,6 +28,7 @@ function line_chart_coordinates( $records, $args ) {
}

$coordinates = array();

foreach ( $sorted as $line_name => $points ) {
$line_data = array(
'key' => $line_name,
Expand All @@ -49,10 +48,11 @@ function line_chart_coordinates( $records, $args ) {
return $coordinates;
}

function pie_chart_coordinates( $records, $args ) {
public function pie_chart_coordinates( $records, $args ) {
if ( 'pie' !== $args['chart_type'] ) {
return $records;
}

$counts = array();

foreach ( $records as $type => $items ) {
Expand All @@ -65,7 +65,7 @@ function pie_chart_coordinates( $records, $args ) {
return $counts;
}

function bar_chart_coordinates( $records, $args ) {
public function bar_chart_coordinates( $records, $args ) {
if ( 'multibar' !== $args['chart_type'] ) {
return $records;
}
Expand Down Expand Up @@ -125,6 +125,7 @@ public function count_by_field( $field, $records, $callback = '' ) {
*/
public function group_by_field( $field, $records, $callback = '' ) {
$sorted = array();

foreach ( $records as $record ) {
$key = $record->$field;

Expand Down Expand Up @@ -176,4 +177,3 @@ protected function collapse_dates( $date ) {
}

}

0 comments on commit d0e3147

Please sign in to comment.