Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:16:53+00:00 2026-06-12T03:16:53+00:00

Tutorial : http://thecodeplayer.com/walkthrough/make-gauge-charts-using-canvas-and-javascript Customised (Working) : http://jsfiddle.net/lewisgoddard/JyGkQ/29/ View (Not Working) : http://gamesforubuntu.org/review/review/show/hedgewars On the

  • 0

Tutorial : http://thecodeplayer.com/walkthrough/make-gauge-charts-using-canvas-and-javascript Customised (Working) : http://jsfiddle.net/lewisgoddard/JyGkQ/29/
View (Not Working) : http://gamesforubuntu.org/review/review/show/hedgewars

On the like i close my script on (in the finished page), Chrome throws the error:

Uncaught SyntaxError: Unexpected token ILLEGAL 

I literally have no idea what is going wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:16:54+00:00Added an answer on June 12, 2026 at 3:16 am

    There was an invisible character between </script> and your last closing bracket. Take a look at the last line:

    <script type="text/javascript" language="javascript">
    window.onload = function(){
      // Canvas Initialization
        var canvas = document.getElementById("Performance"); // Get the canvas by ID
        var ctx = canvas.getContext("2d"); // Make it Flat
        // Dimensions
        var W = canvas.width; // Get the Width
        var H = canvas.height; // Get the Height
        //Variables
        var degrees = 0; // Start Position
        var percent = 93; // End Position
        var new_degrees = Math.round((percent+1)*360/100); // Figure out how far to go
        var difference = 0; // Set the Default Difference
    
    //   Blue     19B6EE   BAE9FA
    //   Green    38B44A   C3E8C9
    //   Yellow   EFB73E   FAE9C5
    //   Red      DF382C   F5C3C0
        if (percent<30) {
            var color = "#DF382C"; // Red
            var bgcolor = "#F5C3C0"; 
        } else if (percent<60) {
            var color = "#EFB73E"; // Yellow
            var bgcolor = "#FAE9C5";
        } else if (percent<90) {
            var color = "#38B44A"; // Green
            var bgcolor = "#C3E8C9";
        } else {
            var color = "#19B6EE"; // Blue
            var bgcolor = "#BAE9FA";
        }
    
        var text;
        var animation_loop, redraw_loop;
    
        function init()
        {
            //Clear the canvas everytime a chart is drawn
            ctx.clearRect(0, 0, W, H);
    
            //Background 360 degree arc
            ctx.beginPath();
            ctx.strokeStyle = bgcolor;
            ctx.lineWidth = 30;
            ctx.arc(W/2, H/2, 100, 0, Math.PI*2, false); //you can see the arc now
            ctx.stroke();
    
            //gauge will be a simple arc
            //Angle in radians = angle in degrees * PI / 180
            var radians = degrees * Math.PI / 180;
            ctx.beginPath();
            ctx.strokeStyle = color;
            ctx.lineWidth = 30;
            //The arc starts from the rightmost end. If we deduct 90 degrees from the angles
            //the arc will start from the topmost end
            ctx.arc(W/2, H/2, 100, 0 - 90*Math.PI/180, radians - 90*Math.PI/180, false); 
            //you can see the arc now
            ctx.stroke();
    
            //Lets add the text
            ctx.fillStyle = color;
            ctx.font = "50px";
            text = Math.floor(degrees/360*100) + "%";
            //Lets center the text
            //deducting half of text width from position x
            text_width = ctx.measureText(text).width;
            //adding manual value to position y since the height of the text cannot
            //be measured easily. There are hacks but we will keep it manual for now.
            ctx.fillText(text, W/2 - text_width/2, H/2 + 15);
        }
    
        function draw()
        {
            //Cancel any movement animation if a new chart is requested
            if(typeof animation_loop != undefined) clearInterval(animation_loop);
    
            //random degree from 0 to 360
            difference = new_degrees - degrees;
            //This will animate the gauge to new positions
            //The animation will take 1 second
            //time for each frame is 1sec / difference in degrees
            animation_loop = setInterval(animate_to, 1000/difference);
        }
    
        //function to make the chart move to new degrees
        function animate_to()
        {
            //clear animation loop if degrees reaches to new_degrees
            if(degrees == new_degrees) 
                clearInterval(animation_loop);
    
            if(degrees < new_degrees)
                degrees++;
            else
                degrees--;
    
            init();
        }
    
        draw();
    }
    <- Here was your enemy!</script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm following this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/uploading-files-with-ajax/comment-page-1/#comments to learn how to upload multiple files via ajax.
using this tutorial http://railscasts.com/episodes/57-create-model-through-text-field need to make it work in my app, was on
I'm using this tutorial: http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-drop-down-nav-menu-with-html5-css3-and-jquery/ This is my site: http://billcaffery.dnsd.me I'm trying to get
I implemented tree rendering based on this excellent tutorial: http://thecodeplayer.com/walkthrough/css3-family-tree But for large trees,
I am following the tutorial: http://www.tutorialspoint.com/ruby/ruby_socket_programming.htm and using it to set up the Simple
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I am following this tutorial http://wicket.wordpress.com/2010/01/08/template-for-building-authenticated-webapplication/ in order to learn how to make login
I am using following tutorial: http://framework.zend.com/manual/en/learning.quickstart.create-model.html When I try to insert record in database
I am using this tutorial: http://developers.facebook.com/docs/opengraph/tutorial/ And I now need to define an action

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.