Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Text and Arrow Scaling Issue

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

    Draw Text and Arrow Scaling Issue

    Hello Support,

    I am able to draw text above arrow or below arrow by using offset of some multiple of TickSize setting, but sometime when chart is more compressed, the text become overlapped with the arrow (as the arrow size is fixed). Do you have sample code on how to do this ensuring no overlap? I read the reference on ChartScale but does not understand it, there is no sample code on the that entries. There is GetPixelsForDistance in the reference, but compiler flag error "does not exist in current context".

    Thank you.

    Best Regards,
    Mokaru Z.

    #2
    Picture is attached showing the Error flagged by NinjaScript compiler. What should I do to resolve this issue? Thanks.

    Comment


      #3
      I am making progress.
      I have this statement:

      float mychartScale = ChartScale.GetPixelsForDistance(TickSize);

      And get error as in the attached picture.

      Comment


        #4
        Hi, thanks for posting.

        Your ChartScale object is likely null in this. GetPixelsForDistance is used within OnRender where you get a chartScale object in the parameters. If you are using Draw.Arrow or Draw.Text then OnRender is not needed at all. If you do want to use OnRender, the objects must be drawn using SharpDX.

        Kind regards,
        -ChrisL

        Comment


          #5
          Hello Chris,

          Is that how the "plot execution" with text and marker achieved? When I change Y-axis scale with mouse, it was not affected. Any sample code on the use of OnRender and SharpDX?

          Thank you.

          Mokaru Z

          Comment


            #6
            Hi Mokaru, thanks for your reply.

            The text and execution markers are rendered internally with SharpDX (along with all the drawing tools). There are many examples of using SharpDX, see the "SampleCustomRender" script in the Indicators folder for a showcase of what SharpDX can do.

            Best regards,
            -ChrisL

            Comment


              #7
              Noted. Thanks Chris.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              647 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              573 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X