1414namespace CrissCross . WPF . Plot ;
1515
1616/// <summary>
17- /// Nice for continuous live data.
17+ /// Provides UI functionality for displaying and managing axis lines on a WPF plot, supporting both horizontal and
18+ /// vertical orientations with customizable appearance and reactive updates.
1819/// </summary>
19- /// <seealso cref="AxisLinesUI" />
20+ /// <remarks>AxisLinesUI enables dynamic creation and updating of axis lines on a WpfPlot, allowing integration
21+ /// with observable data sources for real-time position changes. The class supports customization of line style, color,
22+ /// label text, and axis selection. It is intended for use on Windows platforms and manages resources appropriately
23+ /// through disposal. Thread safety is considered when updating UI elements via observables.</remarks>
2024[ SupportedOSPlatform ( "windows" ) ]
2125public partial class AxisLinesUI : RxObject
2226{
@@ -36,15 +40,22 @@ public partial class AxisLinesUI : RxObject
3640 private LinePattern _linePattern1 ;
3741
3842 /// <summary>
39- /// Initializes a new instance of the <see cref="AxisLinesUI" /> class.
43+ /// Initializes a new instance of the <see cref="AxisLinesUI"/> class, configuring axis lines on the specified plot with.
44+ /// customizable orientation, appearance, and label text. Subscribes to an observable to update the axis line's
45+ /// position and name dynamically.
4046 /// </summary>
41- /// <param name="plot">if set to <c>true</c> [paused].</param>
42- /// <param name="observable">The observable.</param>
43- /// <param name="orientation">The orientation ["Horizontal"] or ["Vertical"].</param>
44- /// <param name="axis">The axis.</param>
45- /// <param name="color">The color.</param>
46- /// <param name="text">The text.</param>
47- /// <param name="linePattern">The line pattern.</param>
47+ /// <remarks>If the orientation is set to "Horizontal", a horizontal axis line is created; if set to
48+ /// "Vertical", a vertical axis line is created. The observable parameter allows the axis line's position and name
49+ /// to be updated in real time as new values are emitted. This constructor is intended for use in interactive or
50+ /// dynamic plotting scenarios where axis lines need to reflect changing data.</remarks>
51+ /// <param name="plot">The WpfPlot control on which the axis lines will be rendered.</param>
52+ /// <param name="observable">An observable sequence that provides updates for the axis line's name and position. Each tuple contains an
53+ /// optional name and an optional position value.</param>
54+ /// <param name="linePattern">The line pattern to use for rendering the axis line, such as solid or dashed.</param>
55+ /// <param name="orientation">The orientation of the axis line. Specify "Horizontal" or "Vertical". Defaults to "Horizontal".</param>
56+ /// <param name="axis">The index of the axis to which the line is associated. Defaults to 0.</param>
57+ /// <param name="color">The color of the axis line. Specify a color name or value. Defaults to "Blue".</param>
58+ /// <param name="text">The label text to display alongside the axis line. Defaults to "---".</param>
4859 public AxisLinesUI (
4960 WpfPlot plot ,
5061 IObservable < ( string ? Name , double ? Position ) > observable ,
@@ -74,15 +85,20 @@ public AxisLinesUI(
7485 }
7586
7687 /// <summary>
77- /// Initializes a new instance of the <see cref="AxisLinesUI" /> class.
88+ /// Initializes a new instance of the <see cref="AxisLinesUI"/> class, adding a horizontal or vertical axis line to the specified.
89+ /// plot at the given position with customizable appearance and label.
7890 /// </summary>
79- /// <param name="plot">if set to <c>true</c> [paused].</param>
80- /// <param name="position">The position.</param>
81- /// <param name="linePattern">The line pattern.</param>
82- /// <param name="type">The type.</param>
83- /// <param name="axis">The axis.</param>
84- /// <param name="color">The color.</param>
85- /// <param name="text">The text.</param>
91+ /// <remarks>If the type parameter is set to "Horizontal", a horizontal axis line is created; if set to
92+ /// "Vertical", a vertical axis line is created. The appearance and label of the line can be customized using the
93+ /// provided parameters.</remarks>
94+ /// <param name="plot">The WpfPlot control to which the axis line will be added. Cannot be null.</param>
95+ /// <param name="position">The position, in plot coordinates, where the axis line will be drawn.</param>
96+ /// <param name="linePattern">The line pattern to apply to the axis line, such as solid or dashed.</param>
97+ /// <param name="type">The orientation of the axis line. Specify "Horizontal" to create a horizontal line or "Vertical" for a vertical
98+ /// line. Defaults to "Horizontal".</param>
99+ /// <param name="axis">The index of the axis to which the line is associated. Defaults to 0.</param>
100+ /// <param name="color">The color of the axis line. Specify a color name or value. Defaults to "Blue".</param>
101+ /// <param name="text">The label text to display with the axis line. Defaults to "---".</param>
86102 public AxisLinesUI (
87103 WpfPlot plot ,
88104 double position ,
@@ -110,53 +126,56 @@ public AxisLinesUI(
110126 }
111127
112128 /// <summary>
113- /// Gets or sets the plot.
129+ /// Gets or sets the WPF plot control used to display graphical data within the application .
114130 /// </summary>
115- /// <value>
116- /// The plot.
117- /// </value>
131+ /// <remarks>Assigning a new value to this property replaces the current plot control instance. This
132+ /// property is typically used to embed interactive plots in WPF user interfaces.</remarks>
118133 public WpfPlot Plot { get ; set ; }
119134
120135 /// <summary>
121- /// Gets or sets the streamer .
136+ /// Gets or sets the visual properties of the axis line, such as color, thickness, and style .
122137 /// </summary>
123- /// <value>
124- /// The streamer.
125- /// </value>
138+ /// <remarks>Set this property to customize the appearance of the axis line in the chart. If the value is
139+ /// <see langword="null"/>, the axis line will not be displayed.</remarks>
126140 public AxisLine ? AxisLine { get ; set ; }
127141
128142 /// <summary>
129- /// Creates the stream .
143+ /// Adds a vertical line to the plot at the specified position .
130144 /// </summary>
131- /// <param name="position">The position.</param>
145+ /// <remarks>The line's appearance, including color and width, is determined by the current chart
146+ /// settings. The line will display the label text specified by the LabelText property.</remarks>
147+ /// <param name="position">The x-coordinate at which to place the vertical line. The default value is 0.0.</param>
132148 public void CreateVerticalLine ( double position = 0.0 )
133149 {
134150 var color = ScottPlot . Color . FromColor ( System . Drawing . Color . FromName ( ChartSettings . Color ! ) ) ;
135151 AxisLine = Plot . Plot . Add . VerticalLine ( x : position , width : ( float ) ChartSettings . LineWidth , color : color ) ;
136- ////AxisLine.Text = LabelText;
137152 AxisLine . LabelText = LabelText ;
138- ////AxisLine.LabelBackgroundColor = color;
139153 }
140154
141155 /// <summary>
142- /// Creates the stream .
156+ /// Adds a horizontal line to the plot at the specified vertical position .
143157 /// </summary>
144- /// <param name="position">The position.</param>
158+ /// <remarks>The line's appearance, including color, width, label text, and alignment, is determined by
159+ /// the current chart settings. Use this method to highlight a specific value or threshold on the plot.</remarks>
160+ /// <param name="position">The vertical position, in plot coordinates, where the horizontal line will be drawn. Defaults to 0.0.</param>
145161 public void CreateHorizontalLine ( double position = 0.0 )
146162 {
147163 var color = ScottPlot . Color . FromColor ( System . Drawing . Color . FromName ( ChartSettings . Color ! ) ) ;
148164 AxisLine = Plot . Plot . Add . HorizontalLine ( y : position , width : ( float ) ChartSettings . LineWidth , color : color ) ;
149- ////AxisLine.Text = LabelText;
150165 AxisLine . LabelText = LabelText ;
151166 AxisLine . LabelAlignment = Alignment . MiddleCenter ;
152167 AxisLine . LinePattern = LinePattern1 ;
153- ////AxisLine.LabelBackgroundColor = color;
154168 }
155169
156170 /// <summary>
157- /// Updates the stream.
171+ /// Subscribes to an observable sequence that provides axis line updates and applies changes to the chart
172+ /// accordingly.
158173 /// </summary>
159- /// <param name="observable">The observable.</param>
174+ /// <remarks>Updates to the axis line position and chart name are processed on a background thread and
175+ /// applied to the UI thread. The chart is refreshed only if it is not paused. The subscription is disposed
176+ /// automatically with the object's disposables.</remarks>
177+ /// <param name="observable">An observable sequence emitting tuples containing the axis line name and its position. The name may be null or
178+ /// empty, and the position may be null; updates are only applied when both are valid.</param>
160179 public void UpdateAxisLineSubscription ( IObservable < ( string ? Name , double ? Position ) > observable ) =>
161180 observable
162181 . SubscribeOn ( RxSchedulers . TaskpoolScheduler ) // Procesa en un hilo de fondo
0 commit comments