WordPress.org

Ready to get started?Download WordPress

Forums

WP Statistics
[resolved] Opera mising from the Pie chart (3 posts)

  1. Greg Ross
    Member
    Plugin Author

    Posted 9 months ago #

    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/

  2. Greg Ross
    Member
    Plugin Author

    Posted 9 months ago #

    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";
    				}
    			}
    		?>
    	]
    }]
  3. Mostafa Soufi
    Member
    Plugin Author

    Posted 8 months ago #

    Was transferred to the email.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.