use add_action(‘wp_head’) in a widget

You can call wp_enqueue_script() directly in your Widget output, and WordPress will enqueue the script. No need to add it to a callback. Try changing this:

else {
    add_action('wp_head', 'pieChartScripts');
    function pieChartScripts() {
        wp_register_style('piechart-css', get_template_directory_uri() . '/css/jquery.easy-pie-chart.css');
        wp_enqueue_style('piechart-css');
    }

    wp_register_script('piechart', get_template_directory_uri() . '/js/jquery.easypiechart.min.js', '', '2.0.4');
    wp_enqueue_script('piechart');

// etc
}

…to this:

else {
    wp_register_style('piechart-css', get_template_directory_uri() . '/css/jquery.easy-pie-chart.css');
    wp_enqueue_style('piechart-css');

    wp_register_script('piechart', get_template_directory_uri() . '/js/jquery.easypiechart.min.js', '', '2.0.4');
    wp_enqueue_script('piechart');

// etc
}

error code: 523