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 8826305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:06:11+00:00 2026-06-14T07:06:11+00:00

I am having difficulties in completing a task which requires to display lines as

  • 0

I am having difficulties in completing a task which requires to display lines as animations in a web app.

The lines data is stored in a database and consists of x, y and time information. The x and y coordinates specify the position of the drawn points whereas time represents the timestamps (in milliseconds) of the respective points.

For instance,
point 1 (x=10, y=23, t=152)
point 2 (x=21, y=29, t=385)
point 3 (x=15, y=20, t=506)
…
…

So, the task is to display these points in a web app based on the given timestamps.

My problem is first that I do not know what kind of graphical plugin to use and then how to implement it (that is how to use timers, how to do the animation, etc).

I would appreciate any help from you! Please let me know in case you need more information about this task. I would gladly provide it.

Kind regards,
Frida

  • 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-14T07:06:12+00:00Added an answer on June 14, 2026 at 7:06 am

    I think I would use Raphaël for something like this. It is easy to use and has support for all major browsers. The animated line drawing can be a little troublesome because you have to generate each step as a seperate path, but it shouldn’t be to hard.

    Here is a very simple example

    var points = [
        { x: 0, y: 0, t: 0 },
        { x: 100, y: 230, t: 1520 },
        { x: 210, y: 290, t: 3850 },
        { x: 150, y: 200, t: 5060 },
    ];
    
    var paths = [];
    
    // build paths
    points.forEach(function (p, idx) {
        if (idx === 0) {
            paths.push('M ' + p.x + ' ' + p.y);
        } else {
            paths.push(paths[idx - 1] + ' L ' + p.x + ' ' + p.y);
        }
    });
    
    var paper = Raphael(10, 10, 300, 300);
    var line = paper.path(paths[0]);
    
    var next = 1;
    
    function animate() {
        if (paths[next]) {  
            duration = points[next].t - points[next - 1].t        
            line.animate({ path: paths[next] }, duration, 'linear', animate);
            next++;
        }
    }
    animate();
    

    And here is a fiddle where you can see it in action: http://jsfiddle.net/toxicsyntax/FLPdr/ ​
    UPDATE

    Here is a complete HTML page that uses the above code. It is still a simplified example, but you should be able to work your way from that.

    <!DOCTYPE html>
    <html>
        <head>
            <title>Raphael Play</title>
            <script type="text/javascript" src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js"></script>
            <script type="text/javascript">
                function drawLine(points) {
    
                    var paths = ['M ' + points[0].x + ' ' + points[0].y];
    
                    // build paths
                    for (var i = 1; i < points.length; i++) {
                        var p = points[i];
                        paths.push(paths[i - 1] + ' L ' + p.x + ' ' + p.y);
                    }
    
                    // get drawing surface
                    var paper = new Raphael(document.getElementById('canvas_container'), 500, 500);  
    
                    // draw line
                    var line = paper.path(paths[0]);
                    var next = 1;
    
                    function animate() {
                        if (paths[next]) {  
                            duration = points[next].t - points[next - 1].t        
                            line.animate({ path: paths[next] }, duration, 'linear', animate);
                            next++;
                        }
                    }
                    animate();
                }
            </script>
            <style type="text/css">
                #canvas_container {
                    width: 500px;
                    border: 1px solid #aaa;
                }
            </style>
        </head>
        <body>
            <div id="canvas_container"></div>
            <script type="text/javascript">
                window.onload = function () {
                    // the points here should be generated by your ASP.NET application
                    drawLine([
                        // the points here should be generated by your ASP.NET application
                        { x: 0, y: 0, t: 0 },
                        { x: 100, y: 230, t: 1520 },
                        { x: 210, y: 290, t: 3850 },
                        { x: 150, y: 200, t: 5060 },
                    ]);
                }
            </script>
        </body>
    </html>
    

    The points are at the end of the HTML page, and in your application you could generate those from your model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having difficulties to display data from mysql database to PHP generated table. Interesting
I'm having difficulties in writing tests for a page which loads a google maps.
I'm having difficulties removing the lineStyle lines in JTrees using Netbeans. In a standalone
I'm having difficulties starting the AudioQueue when my app is in the background with
I'm having difficulties reading an app.config using the ConfigurationManager. I have a custom section,
Im having difficulties trying to get a connection to my sqlserver database. The database
I'm having difficulties to add a custom class to my app. It's a class
I am having difficulties because of the database structure on a game website similar
I am having difficulties importing a script from a directory that is not stored
I am having difficulties with the different clocks which can be accessed by clock_gettime

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.