Announcement

Collapse
No announcement yet.

How do I know which color will be applied to what line?

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

  • How do I know which color will be applied to what line?

    In experimenting to become familiar with EFS the following 3 commands worked fine in that those colors were used for the 3 studies [I may not be using the correct EFS terms here] plotted on the bar chart. It appears that the colors are applied to each succeeding study as they are introduced in the code - but I don't see any explicit handle or reference [ie] I don't see the studies explicitly labelled 0, 1 or 2?

    Is that just something I will have to live with?

    Hope this came out in English!

    setBarFgColor(Color.red,0);
    setBarFgColor(Color.green,1);
    setBarFgColor(Color.black,2);

  • #2
    jcm21
    The colors are not applied to the studies in the order in which they are declared (or "introduced to the code" to use your terminology) but in the order in which they are listed in the return array with 0 being the first element of the array, 1 the second, 2 the third, etc (arrays are always 0 based).
    Assuming you declared myStudy1, myStudy2 and myStudy3 in this order then the following code
    PHP Code:
    //other code

    setBarFgColor(Color.red,0);
    setBarFgColor(Color.green,1);
    setBarFgColor(Color.black,2); 

    //other code

    return new Array (myStudy2myStudy3myStudy1); 
    will color myStudy2 in red (because it is the first element of the array) myStudy3 in in green and myStudy1 in black.
    This will happen regardless of the order in which you have declared the studies.
    If - as you indicate - you are unfamiliar with programming in efs and are interested in learning you may want to start by reviewing the JavaScript for EFS video series and the Core JavaScript Reference Guide. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS.
    Alex


    Originally posted by jcm21
    In experimenting to become familiar with EFS the following 3 commands worked fine in that those colors were used for the 3 studies [I may not be using the correct EFS terms here] plotted on the bar chart. It appears that the colors are applied to each succeeding study as they are introduced in the code - but I don't see any explicit handle or reference [ie] I don't see the studies explicitly labelled 0, 1 or 2?

    Is that just something I will have to live with?

    Hope this came out in English!

    setBarFgColor(Color.red,0);
    setBarFgColor(Color.green,1);
    setBarFgColor(Color.black,2);

    Comment

    Working...
    X