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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:37:36+00:00 2026-05-28T16:37:36+00:00

I have this script protovis : <script type=text/javascript+protovis> var w = 600; var h

  • 0

I have this script protovis :

<script type="text/javascript+protovis">
    var w = 600;
    var h = 600;
    var img = new pv.Panel()
        .width(w)
        .height(h);

    img.add(pv.Image)
        .url("./icon/image.gif")
        .title("image");

    img.add(pv.Dot)
        .data(data)
        .left(function(d) d[0] * w)
        .bottom(function(d) d[1] * h)
        .size(function(d) d[2] * 100)
        .fillStyle("rgba(30, 120, 180, .6)")
        .strokeStyle("white");

    img.render();
</script>

data1 is declared in a Javascript file :

var data = [[.1, .1, 1], [.2, .2, 2], [.3, .3, 3]];

When i test that i have my image with 3 dots. But i don’t how to do if for example i change the data in a Javascript function then redraw the protovis with the new data.
In my case, when the user click in a menu, i recieve new data from a database and i update the data. But after i changed the data i need to redraw the image.

I was wondering how i could reload the web page in order to redraw the image with the new data. I was thinking of reload the web page passing the data in POST and retrieve the data in Javascript before drawing the image.

But i’m not sure if this solution will work and if it’s the best way to do that.

  • 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-05-28T16:37:38+00:00Added an answer on May 28, 2026 at 4:37 pm

    Your question is a bit unclear, but there are several ways to do this:

    • If you want to update the visualization without reloading the page, you can use AJAX to load the new data (probably using jQuery or another helper library). In the callback function, which will run once the new data is loaded, assign the data variable to the new data, then call img.render(). For example, using jQuery:

      // assign a handler to run when the user clicks Submit
      $('#userForm').submit(function() {
          // get new data based on form input
          $.get('/data.php?' + $(this).serialize(),
              // set the callback function to run with returned data
              function(newData) {
                  // set data to new data
                  data = newData;
                  // refresh
                  img.render();
              }
          );
      });
      
    • If you want to reload the page, you basically have two options. The first is to put your data inline in the HTML page instead of loading it separately, and then use PHP or your server-side language of choice to replace the data with new data defined by the user parameters. The second option is to make your data.js file dynamic, and pass in the new parameters when you reload the page, e.g. data.js?option=2.

    But really, unless you’re going to be changing other things on the page as well, you’re probably better off going with the AJAX option. It’s no more complex on the server side, only a tiny bit more complex on the client side, and it saves your user a page load.

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

Sidebar

Related Questions

i have this script <select> <option value=1>one<img src=star.gif height=15 width=15></img> </option> </select> but it
I have this script in index.php file: <script type=text/javascript> $(document).ready(function(){ $('#ads').load('output.php').fadeIn('slow'); }); </script> And
I have this script which is used to append: function append_place(type) { var shop_type
I have this script, it's used to fetch the width and the height of
I have this script: JsFiddle If you type something you will get Google suggestions.
I have this script that calls a .net WebService msg = $.toJSON( $.ajax({ type:
I have this script: $(#menu ul li).mouseover( function () { $(this).find(.submenu).fadeIn(slow); } ); var
I have this script: $.each($(this)[0].files, function(i, file){ if (input.files && input.files[0]) { var reader
I have this script: JsFiddle If you type something you will see Google suggestions.
I have this script: function slideSwitch() { var ae = jQuery('#featured-right a.active'); if (

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.