Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

dotted line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    dotted line

    Hi, I have a line defined in my Initialize section coded as follows:

    Add(new Plot(new Pen(Color.Green, 2),PlotStyle.Line, "Time1"));

    How do I set its "DashStyle"? I want it to be a solid dotted line.

    Thanks

    #2
    Hello pman777,

    Thank you for your post.

    In the Initialize() method set the following:
    Code:
            protected override void Initialize()
            {
    			Pen MyPen1 = new Pen(Color.Blue);
    			MyPen1.DashStyle = DashStyle.Dot;
    			Add(new Plot(MyPen1, PlotStyle.Line, "Time1"));

    Comment


      #3
      thanks, how do I set the default line thickness to "2" using this code?

      Comment


        #4
        pman777, your MyPen object should have a .Width as well you could set to the desired integer.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X