﻿/*
// 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);

}



