Solved

Technology behind Google Stock Screener page

Posted on 2008-10-02
3
1,221 Views
Last Modified: 2008-10-06
I am interested in recreating the Stock Screener page of Google Finance.  
http://finance.google.com/finance/stockscreener

I'm interested in how all of it works (AJAX and javascript?), but especially the sparklines range selector controls.  What does Google use and how would I go about making this?  Is there a control already available to use?  

I'm a beginner to web programming but have made simple pages in ASP.NET using Visual Studio.  I come from a VB6/VB.NET background.  Thanks in advance,
0
Comment
Question by:vt96
  • 2
3 Comments
 
LVL 16

Expert Comment

by:anoyes
ID: 22643132
I'm not sure exactly what controls Google uses - they're probably home-grown - but I would recommend you look into the jQuery javascript library (jquery.com).  The core of jQuery has all the AJAX stuff that you would need built in, and the UI add-on (ui.jquery.com) has several UI widgets that you'd find useful, particularly the slide control (http://ui.jquery.com/repository/latest/demos/functional/#ui.slider).  It's just a matter of styling it properly, which shouldn't be too hard.  That should give you a pretty good start to the UI.


The AJAX is just a call that gets made using JavaScript to execute server side code, and then return some new content.  In this case, AJAX is being used to update the page when you move around the sliders, sort the data grid, etc.  If you're interested in how exactly AJAX works I'd do a Google search - there's tons of information out there.  But basically you specify a URL and then (typically) do something with the data that URL returns.
0
 

Author Comment

by:vt96
ID: 22648438
Thanks a lot for the response.  The Google slide control has a distribution chart in the background...is it possible to have a slider on a dynamically-generated chart background?  That control seems pretty useful and I'm mainly looking into how to re-create that one.

The jQuery demos are pretty nice; thanks for the link.  I will check them out.
0
 
LVL 16

Accepted Solution

by:
anoyes earned 250 total points
ID: 22652623
I attached a quick sample of how this might be done.  I poked into Google a little, and they use JavaScript to build the chart background.  So what you'll most likely end up doing is making some AJAX call to a web service to get a set of values, and then loop thru each to build your chart.  I think this example will get you started - how you actually collect the data is up to you.

<script language="javascript" src="jquery.js"></script>

<script language="javascript">

  $(document).ready(function()

  {

    var arrValues = new Array();

    arrValues[0] = 12;

    arrValues[1] = 18;

    arrValues[2] = 26;

    arrValues[3] = 80;

    arrValues[4] = 60;

    arrValues[5] = 51;

    arrValues[6] = 57;

    arrValues[7] = 66;

    arrValues[8] = 45;

    arrValues[9] = 91;

    arrValues[10] = 100;

    arrValues[11] = 83;

    

    $.each(arrValues,function(i, val)

    {

      var elem = $("<div>");

      elem.css("left",i * 4 + "px");

      elem.css("width","2px");

      elem.css("background","#123456");

      elem.css("height",val + "%");

      elem.css("position","absolute");

      elem.css("bottom","0px");

      $("#divContainer").append(elem);

    })

  });

</script>
 

<div id="slider" style="z-index:20;">[] ----------------- []</div>

<div id="divContainer" style="height:20px;position:relative;top:-20px;z-index:10;"></div>

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now