Current filter:
                                You should refresh the page.
                                  •  Hello,

                                    I have a question if there is a way how to create annotations of line sources at the end of each line in the line chart control. Please see a screenshot below. The problem is, that legend is not very suitable for certain scenarios, whre more than 10 lines are in one chart control, so better way to distinguish those lines is to draw an annotation of the line source next to the last line point.

                                    Petr 

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Petr,

                                Use Annotation elements linked to the corresponding axis coordinates (see the PaneAnchorPoint option) to generate the required chart layout.
                                Please refer to the sample project that illustrates this approach and let us know if you need further assistance.

                                UPDATE: We provide the public XYDiagram2D.DiagramToPoint method to convert diagram coordinates into screen coordinates. It is possible to use the Pane.GetBounds method to obtain the pane (default pane) size in screen coordinates.
                                This information should be useful when specifying the target annotation position at runtime.

                                Show all comments
                                • Petr Stefka 05.29.2019

                                  Hello Alex,

                                  it is almost what I need, problem is, that the anchor is not relative, ie. if the user zoom or pan the chart I need to view this "Line Title" all the time, so zoomed or unzoomed still at the end of the visible area.

                                  So I should add this manually every time when the VisibleRange changes?

                                  Petr

                                • Petr Stefka 05.29.2019

                                  Hello again,

                                  I tried to use your approach, but failed, because when the chart has scrolling/zooming that the scrollable control will clip the annotations and they are not displayed at all.

                                  Here is a sample, please feel free to modify it to achieve that goal. Actually it would be nice to have an annotation relative to the zoomed/panned area and always at the end of the visible domain.

                                  Petr

                                • Constant (DevExpress Support) 05.29.2019

                                  It is necessary to handle the XYDiagram2D.Zoom and Scroll events to update annotations. I have modified the sample project to demonstrate this approach. It also demonstrates how to use ChartAnchorPoint instead of the PaneAnchorPoint, which may be useful in certain cases.

                                • Petr Stefka 05.29.2019

                                  Hello,

                                  It is much better, but is there any way how to determinate an approximate value of the line at the edge of the visible area?

                                  Instead of using

                                  _diagram.DiagramToPoint(seriesPoint.DateTimeArgument, seriesPoint.Value);

                                  use something like

                                  _diagram.DiagramToPoint(_diagram.AxisX.VisualRange.MaxValue, ???);

                                  where ??? is a computed approximation of a value for that argument

                                  It will keep the annotions at the edge of the chart next to the line leaving the visible domain.

                                  Petr

                                • Petr Stefka 05.29.2019

                                  It also have unpleasant flickering effect while scrolling. Actually I will solve this with my own annotation if it is possible to get calculated value's coordinate for each series at the edge of visible range.

                                  Petr

                                • Petr Stefka 05.29.2019

                                  Hello,

                                  I solved that issue using internal private method XYDiagram2D.CalcDiagramToPointCoordinates.

                                  It needs a bit of tunning, but for your opinion I attached that modified sample.

                                  I still think that this kind of annotation could be one of the standard annotiation type, such LineEndAnchorPoint or so.

                                  Regards,
                                  Petr

                                • Alex (DevExpress Support) 05.29.2019

                                  Hi Petr,

                                  Thank you for the update. I should mention that we provide the public XYDiagram2D.DiagramToPoint method to convert diagram coordinates into screen coordinates.
                                  So, it should not be necessary to use the internal API to obtain this information. As for your new anchor mode idea - we will take it into account when discussing future ChartControl improvements.

                                • Petr Stefka 05.30.2019

                                  Hello Alex,

                                  I know that this method exists, but I thought it return points of existing series points only, but I tested it right now and it can be used for getting any point of diagram's surface according to any x-axis argument.

                                  Thank you,
                                  Petr  

                                • Alex (DevExpress Support) 05.30.2019

                                  Petr,

                                  Yes, this method should work correctly in your scenario. I should also mention that it is possible to use the Pane.GetBounds method to obtain the pane (default pane) size in screen coordinates. Please check the updated sample project and let us know how it works for you.

                                • Petr Stefka 05.30.2019

                                  Hello Alex,

                                  thank you for your asistance.

                                  Petr

                                • Alex (DevExpress Support) 05.30.2019

                                  You are welcome, Petr.