User Tools

Site Tools


jcontrols:jline:index

jLine

The jLine control draws a polyline (i.e. a series of line segments connected on after the other). The polyline forms a shape that can be styled like other shapes using the fill, border, and drop shadow features.

YCoordinateArray & YCoordinates Property

The points that define the polyline can be specified at design time using the YCoordinateArray. The items in the array are evenly spaced across the X axis, and each value is a percentage of the jLine control's height. The following provides and illustrative example:

At runtime use the YCoordinates property to add (Enqueue) a point, remove (Dequeue) a point, or both (DequeueAndEnqueue). Using those methods to periodically add/remove items from the YCoordinates in a timer, one can create a trend graph as illustrated below:

void timer1_Tick(object sender, EventArgs e)
{
    // Append each slider value to the end of its corresponding line.
    Invoke(new Action(() =>
    {
        _greenLine.YCoordinates.DequeueAndEnqueue(_greenSlider.Value);
        _yellowLine.YCoordinates.DequeueAndEnqueue(_yellowSlider.Value);
    }));
}

Use the YCoordinatesArray property at design time, and YCoordinates property at run time to add or remove points.

jcontrols/jline/index.txt · Last modified: by 127.0.0.1