• ResolvedPlugin Contributor Greg Ross

    (@gregross)


    Opera is missing from the browser stat pie chart. In log.php:

    series: [{
    										type: 'pie',
    										name: '<?php _e('Browser share', 'wp_statistics'); ?>',
    										data: [
    											['<?php _e('Firefox', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Firefox'); ?>],
    											['<?php _e('IE', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('IE'); ?>],
    											['<?php _e('Ipad', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Ipad'); ?>],
    											['<?php _e('Android', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Android'); ?>],
    											['<?php _e('Chrome', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Chrome'); ?>],
    											['<?php _e('Safari', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Safari'); ?>],
    											['<?php _e('Other', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('unknown'); ?>]
    										]

    is missing the line for opera:

    series: [{
    										type: 'pie',
    										name: '<?php _e('Browser share', 'wp_statistics'); ?>',
    										data: [
    											['<?php _e('Firefox', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Firefox'); ?>],
    											['<?php _e('IE', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('IE'); ?>],
    											['<?php _e('Ipad', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Ipad'); ?>],
    											['<?php _e('Android', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Android'); ?>],
    											['<?php _e('Chrome', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Chrome'); ?>],
    											['<?php _e('Safari', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Safari'); ?>],
    											['<?php _e('Opera', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('Opera'); ?>],
    											['<?php _e('Other', 'wp_statistics'); ?>', <?php echo wp_statistics_useragent('unknown'); ?>]
    										]

    http://wordpress.org/plugins/wp-statistics/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Greg Ross

    (@gregross)

    I took a second look at the pie chart code and decided a slightly better solution would be to drop anything with a 0 value and include the count in the titles as so:

    series: [{
    	type: 'pie',
    	name: '<?php _e('Browser share', 'wp_statistics'); ?>',
    	data: [
    		<?php
    		$Browsers = array( 'Firefox', 'IE', 'Ipad', 'Android', 'Chrome', 'Safari', 'Opera', 'Unknown' );
    
    		foreach( $Browsers as $Browser )
    			{
    			$count = wp_statistics_useragent( $Browser );
    			if( $count > 0 )
    				{
    				echo "											['" . __( $Browser, 'wp_statistics' ) . " (" . $count . ")', " . $count . "],\r\n";
    				}
    			}
    		?>
    	]
    }]
    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Was transferred to the email.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Opera mising from the Pie chart’ is closed to new replies.