Current filter:
                                You should refresh the page.
                                0
                                  • I've databound the Value property of a ConstantLine to display the average value for a line series. I think constant lines should move when the Value property changes. As the attached screenshot shows, the line was initially bound when the Value was about -5.0, but now the Value is -0.075, but the line is still positioned at it's initial location.

                                BoundConstantLine.png
                                0

                                The code I wrote to bind the ConstantLine's Value property:

                                            ' View chart of difference between actual and normal worktime
                                            Dim vDiagram As New XYDiagram2D()
                                            Dim vArgumentDataMember As String = GetPropertyName(Function(wtd As WorkTimeDifference) wtd.Date)
                                            Dim vValueDataMember As String = GetPropertyName(Function(wtd As WorkTimeDifference) wtd.WorkTimeDifference)

                                            Dim vDisplayName As String = "Actual - normal worktime"
                                            Dim vWorkTimeDifferenceBinding As New Binding("WorkTimeDifferenceForChart")
                                            vWorkTimeDifferenceBinding.Source = Me.DataContext
                                            Dim vWorkTimeDifferenceSeries As New AreaSeries2D With {.DisplayName = vDisplayName, .ArgumentScaleType = ScaleType.DateTime, .ValueDataMember = vValueDataMember, .ArgumentDataMember = vArgumentDataMember, .Transparency = 0.4, .Label = New SeriesLabel With {.Visible = False}}
                                            vWorkTimeDifferenceSeries.SetBinding(AreaSeries2D.DataSourceProperty, vWorkTimeDifferenceBinding)
                                            vDiagram.Series.Add(vWorkTimeDifferenceSeries)

                                            Dim vAverageBinding As New Binding("AverageWorkTimeDifference")
                                            vAverageBinding.Source = Me.DataContext
                                            Dim vAverageLine As New ConstantLine()
                                            vAverageLine.SetBinding(ConstantLine.ValueProperty, vAverageBinding)
                                            vAverageLine.Brush = Brushes.Orange
                                            vAverageLine.ShowBehind = True

                                            Dim vAverageTitleBinding As New Binding("AverageWorkTimeDifference")
                                            vAverageTitleBinding.StringFormat = "({0:n3}) Average difference"
                                            Dim vAverageTitle As New ConstantLineTitle()
                                            vAverageTitle.SetBinding(ConstantLineTitle.TextProperty, vAverageTitleBinding)
                                            vAverageTitle.Foreground = Brushes.Orange
                                            vAverageTitle.Alignment = ConstantLineTitleAlignment.Far
                                            vAverageLine.Title = vAverageTitle

                                            ' Default settings
                                            vDiagram.SeriesTemplate = New LineSeries2D()
                                            vDiagram.AxisY = New AxisY2D()
                                            vDiagram.AxisX = New AxisX2D()
                                            vDiagram.AxisY.ConstantLines.Add(vAverageLine)
                                            Me.WorkTimeChartControl.Diagram = vDiagram

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.