simple plot algorithm with autoscale
        Posted  
        
            by adrin
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by adrin
        
        
        
        Published on 2010-06-15T08:37:08Z
        Indexed on 
            2010/06/15
            8:42 UTC
        
        
        Read the original article
        Hit count: 310
        
I need to implement a simple plotting component in C#(WPF to be more precise). What i have is a collection of data samples containing time (X axis) and a value (both double types).
I have a drawing canvas of a fixed size (Width x Height) and a DrawLine method/function that can draw on it. The problem I am facing now is how do I draw the plot so that it is autoscaled? In other words how do I map the samples I have to actual pixels on my Width x Height canvas?
© Stack Overflow or respective owner