====== jLine ====== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControls.jLine.html|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 [[jcontrols:fills_and_borders:index|fill, border]], and [[jcontrols:gloss_and_dropshadow:index#dropshadow_property|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: | {{jline_example.png}} | {{jline_example_properties.png}} | At runtime use the [[https://api.comfiletech.com/csharp/api/ComfileTech.jControls.jLine.YCoordinates.html#ComfileTech_jControlsNF4_jLine_YCoordinates|YCoordinates]] property to add ([[https://api.comfiletech.com/csharp/api/ComfileTech.jControls.IQueue-1.Enqueue.html#ComfileTech_jControlsNF4_IQueue_1_Enqueue__0_|Enqueue]]) a point, remove ([[https://api.comfiletech.com/csharp/api/ComfileTech.jControls.IQueue-1.Dequeue.html#ComfileTech_jControlsNF4_IQueue_1_Dequeue|Dequeue]]) a point, or both ([[https://api.comfiletech.com/csharp/api/ComfileTech.jControls.IQueue-1.DequeueAndEnqueue.html#ComfileTech_jControls_IQueue_1_DequeueAndEnqueue__0_|DequeueAndEnqueue]]). Using those methods to periodically add/remove items from the YCoordinates in a timer, one can create a trend graph as illustrated below: {{ https://downloads.comfiletech.com/jControls/videos/jline_trend_graph.mp4?614x462 }} 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.