Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Silverlight based AJAX line graph

, 7 Aug 2007
An article on creating real time line graphs for webpages using AJAX and Silverlight.
/*
// Free for any type of use so long as original notice remains unchanged.
// Copyrights 2007, Ashish Patil , http://ashishware.com
*/

function WPFGraph(control_id,len,max_val)
{
var values;
var wpf_control;

this.PlotValue = function (newval)
{
    var i;
   
    for(i=0;i<values.length-1;i++)
    {values[i]= values[i+1];}
     values[i] = newval;   
    /*Logic for plotting values goes here*/
    for(i=0;i<values.length;i++)
    { wpf_control.content.findName("gline"+i).y2= values[i];
      wpf_control.content.findName("gline"+(i+1)).y1= values[i];
    }
    wpf_control.content.findName("gline"+(i)).y2= values[i-1];
}

function Init(id,i,max)
{ 
    var x;
    values  = new Array(i);
    wpf_control = document.getElementById(id);
    for(x=0;x<values.length;x++)
    values[x]=max;    
}

Init(control_id,len,max_val);

}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

ashish_patil++
Web Developer
India India
Ashish is an Electronics Engineer. He loves computers and programming, and always tries to do something different. Ashish started his programming career with FoxPro 2.5 (6 years ago) .Ashish has programmed in number of languages including C\C++ , Tcl\Tk , Assembly Language , JavaScript. Currently he works with ASP.NET, C# and VB.NET. He is currently working in multinational consulting company in India.
 
He devotes much of his free time to his website: http://ashishware.com , which contains lot of cool stuff on webdevelopment and programing in general.

| Advertise | Privacy | Mobile
Web02 | 2.8.140902.1 | Last Updated 7 Aug 2007
Article Copyright 2007 by ashish_patil++
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid