Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Width 1.5 by code gives error

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

    Plot Width 1.5 by code gives error

    Hello,

    I can set plot width in the Properties box to 1.5 with no problem.

    However, in code, I cannot, I get errors when doing this....

    I tried
    Code:
    //get error doing this
    AddPlot(new Stroke(Brushes.Orange, 1.5), PlotStyle.Dot, "Long_EntryDisqualifyMark");
    
    // and 
    
    //get error doing this
    Plots[3].Width = 1.5;
    How do I make this work?

    #2
    Originally posted by KhaosTrader View Post
    Hello,

    I can set plot width in the Properties box to 1.5 with no problem.

    However, in code, I cannot, I get errors when doing this....

    I tried
    Code:
    //get error doing this
    AddPlot(new Stroke(Brushes.Orange, 1.5), PlotStyle.Dot, "Long_EntryDisqualifyMark");
    
    // and 
    
    //get error doing this
    Plots[3].Width = 1.5;
    How do I make this work?
    Some things are impossible in an absolute sense. You cannot specify a double for an int, unless you first cast it. If you are going to specify rather than calculate, what would be the point of casting an explicit value? Just use the correct type in your code.

    Comment


      #3
      Hello KhaosTrader,

      Thank you for your post.

      I will report that it is possible to set fractional values for integer based properties. I noticed this has no affect on the actual plot width if I set a fractional value for the property in the UI.

      Comment


        #4
        Yes that is what I mean, I can set fractional for the property in the property pages, so I was thinking perhaps that the property should be a different value type (not int) or there is some issue, because if it was truly an int, then I shouldnt be able to put in 1.5 in the property field for width UI. So either there is a problem with the UI or there is a problem of it being an int type. I would like to have more width sizing granularity, but if is truly supposed to be an int, I guess I wont get the granularity i hoped for.

        Comment


          #5
          Hello KhaosTrader,

          Thank you for your patience.

          After testing further, using fractional values in the UI for the Plot width will actually produce the desired effect. However, that effect is very small in change. Attached is an image to illustrate.

          You can also do this in code by using float values such as 1.5f.
          Attached Files

          Comment


            #6
            Ok great that is awesome... koganam, u might want to check this out also.. :P

            Comment


              #7
              Originally posted by KhaosTrader View Post
              Ok great that is awesome... koganam, u might want to check this out also.. :P
              Yup. It turns out that it was a float, not an int. That will teach me to cross-check before I open my big mouth.
              Last edited by koganam; 06-14-2016, 11:29 PM.

              Comment


                #8
                Your a good sport man, Yah, it was so funny I just couldn't resist.

                When I put it at 1.5 via the UI the dot looked bigger, but when support said no, i thought my eyes were playing tricks on me. Anyway, it is a mislabeled var type somehow..

                Anyway, looking forward to learning more about Ninjascript, and I do appreciate any and all input, so thank you buddy..

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by judysamnt7, 03-13-2023, 09:11 AM
                4 responses
                56 views
                0 likes
                Last Post DynamicTest  
                Started by ScottWalsh, Today, 06:52 PM
                4 responses
                35 views
                0 likes
                Last Post ScottWalsh  
                Started by olisav57, Today, 07:39 PM
                0 responses
                7 views
                0 likes
                Last Post olisav57  
                Started by trilliantrader, Today, 03:01 PM
                2 responses
                19 views
                0 likes
                Last Post helpwanted  
                Started by cre8able, Today, 07:24 PM
                0 responses
                8 views
                0 likes
                Last Post cre8able  
                Working...
                X