Best Approach to Draw a Single Arrow Head on a Line Series
Posted: Thu Apr 13, 2017 10:46 pm
Hello All,
I have been searching the .NET forum and have a possible approach. Let me explain what is intended on the Chart user interface, and then list some code that could accomplish that. I am looking for assistance on determining if there is a better way (or best) that I am missing.
After (or while) creating new Series and then adding them to a single Chart component, all of them need an arrow head drawn at approximately 75 percent of the traversal along each series. The arrow head points in the direction of how real life things like steam move down a pipe. Only a single point is needed for the arrow head. I am aware of the TeeChart.Styles.Arrow series and its Add method to receive two sets of x, y coordinates to draw the arrow head. The example code I have created is based on this post: TeeChart.Styles.Arrow.LinePen Issues http://www.teechart.net/support/viewtop ... ilit=arrow
To see the "one point" arrowStyle appear, the button click event has to fire twice. It does not matter if is called after the line either. Two button click events will cause the one arrowStyle to appear. I am not sure if I am missing something in a property on the tChart1. It is possible.
Regardless, is there a better way to have a single arrow head appear on a line series, approximately 75 percent of the traversal along the series? For example, The above approach would mean that if there are 3000 independent line series, there would be 3000 independent single point "arrow head" TeeChart.Styles.Arrow series, for a grand total of 6000 series on a single chart.
If a single method exists within one of the series objects, it would be ideal if a single x, y coordinate can be given and the respective angle to match the line series directly beneath it. In other words, the arrow has to be pointing in the correct flow direction. The closest method I can find that is similar to the description is TeeChart.Drawing.TextShape.DrawRectRotated here: http://www.teechart.net/docs/teechart/n ... Method.htm. This special x, y coordinate and angle parameters method is definitely not a requirement. I would like to know if it exists to draw an arrow head as described above. Thank you all for your assistance.
Sincerely,
BR&E
I have been searching the .NET forum and have a possible approach. Let me explain what is intended on the Chart user interface, and then list some code that could accomplish that. I am looking for assistance on determining if there is a better way (or best) that I am missing.
After (or while) creating new Series and then adding them to a single Chart component, all of them need an arrow head drawn at approximately 75 percent of the traversal along each series. The arrow head points in the direction of how real life things like steam move down a pipe. Only a single point is needed for the arrow head. I am aware of the TeeChart.Styles.Arrow series and its Add method to receive two sets of x, y coordinates to draw the arrow head. The example code I have created is based on this post: TeeChart.Styles.Arrow.LinePen Issues http://www.teechart.net/support/viewtop ... ilit=arrow
Code: Select all
TeeChart.Styles.Arrow arrowStyle = new TeeChart.Styles.Arrow(tChart1.Chart);
arrowStyle.ArrowHeight = 20;
arrowStyle.ArrowWidth = 20;
arrowStyle.Pointer.Pen.Width = 3;
arrowStyle.Pointer.Pen.Style = System.Drawing.Drawing2D.DashStyle.Solid;
arrowStyle.Add(13, 24, 13.8, 23, Color.LimeGreen);
tChart1.Series.Add(arrowStyle);
Code: Select all
tChart1.Invalidate()
Code: Select all
tChart1.Series.Add(arrowStyle)
Regardless, is there a better way to have a single arrow head appear on a line series, approximately 75 percent of the traversal along the series? For example, The above approach would mean that if there are 3000 independent line series, there would be 3000 independent single point "arrow head" TeeChart.Styles.Arrow series, for a grand total of 6000 series on a single chart.
If a single method exists within one of the series objects, it would be ideal if a single x, y coordinate can be given and the respective angle to match the line series directly beneath it. In other words, the arrow has to be pointing in the correct flow direction. The closest method I can find that is similar to the description is TeeChart.Drawing.TextShape.DrawRectRotated here: http://www.teechart.net/docs/teechart/n ... Method.htm. This special x, y coordinate and angle parameters method is definitely not a requirement. I would like to know if it exists to draw an arrow head as described above. Thank you all for your assistance.
Sincerely,
BR&E