Announcement

Collapse
No announcement yet.

more detail documentation on the cx and cy parameters of the drawText... functions

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

  • more detail documentation on the cx and cy parameters of the drawText... functions

    is there more detailed documentation other than the 1 liners for the cx and cy parameters of the drawTextxxx functions?

    what I'm trying to do is to draw 2 piieces of text that are adjacent to each other and I have to use 2 different function calls because both texts have different attributes. I want to be able to draw the first piece and then draw the 2nd right after the first. I can't use bar coordinates because they vary depending on the users sets his bar spacing. I would like to be able to use the pixel spacing but the documentation is rather sparse.

    Any ideas?
    thanks, Bernie

  • #2
    Answer...

    CX is based on BAR COUNTS. Thus, you will have to deal with the spacing issue. CY is price (or double) based - thus, you can control that all you want.

    I ran into the same problem trying to create a "cycle" program for another client. Until we are able to use Double values for CX, there is not much we can do.

    BTW, Double values are non-whole numbers (like 1.2 or 1.154234).

    B
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Hello Bernie,

      I've added some details about the cx and cy parameters to our Help Docs in the EFS KnowledgeBase. There is also now a detailed formula example that illustrates the usage of these parameters in the EFS Library under Help Examples. Please review the following and let me know if you have any more questions.

      EFS Function Reference: drawTextPixel()
      PixelSpacingEx.efs
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #4
        Jason:

        Thanks for the clarification, that missing documentation was really needed.

        I can see now that it won't solve my problem.

        What I really needed (and so it's probably an enhancement) is the ability to position 2 pieces of text, the first based on a x,y location (time,price) with the 2nd positioned relative to the first.

        The first would be written normally with the drawTextxxx functions at a specific location. The 2nd one would ideally use the same origin, but specifiy a pixel offset (which would be obtained from getTextWidth etc). I had thought the the cx and cy would have provided that pixel offset.

        Another solution would to have a getTextOrigin function that returns the raw pixel coordinates of the text. BTW such a function would solve many problems such as figuring out how big a chart is because you could temporarily write text at the top and bottom left and at 0, get their origins (in pixels) and have a pretty good idea of the chart size.

        Bernie

        Comment


        • #5
          Hello Bernie,

          Unfortunately, to accomplish what you've described would require some enhancements. The best thing to do is submit the details for the ideas you've outlined to [email protected]. Requests sent to this address go directly to the development team.
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment


          • #6
            Bernie:

            Assuming that you have no more than 2 text items per group, a rough workaround would be to use the text alignment flags (e.g., Text.LEFT and Text.RIGHT) to keep the 2 text items tightly aligned to one another. Select a bar offset and draw the first item using the Text.RIGHT flag and the second item using Text.LEFT. Granted, it is rough but it will do the trick nicely in certain situations.

            Chris
            Attached Files

            Comment

            Working...
            X