I changed the font to 300 for both of them. I use a white background with my charts, so I changed the color of the first one to white and the second to dark grey. I then offset the first one to line up with the beginning of the comment display and the second to be slightly offset from the first. The final effect is what looks like a floating window with a shadow. I know, I know, time well spent.
The code:
Code: Select all
ObjectCreate("LabelBox1", OBJ_LABEL, 0, 0, 0); ObjectSetText("LabelBox1","g",300,"Webdings",DarkGray); ObjectSet("LabelBox1", OBJPROP_XDISTANCE, 90); ObjectSet("LabelBox1", OBJPROP_YDISTANCE, 25); ObjectSet("LabelBox1",OBJPROP_BACK,0);
ObjectCreate("LabelBox2", OBJ_LABEL, 0, 0, 0); ObjectSetText("LabelBox2","g",300,"Webdings",White); ObjectSet("LabelBox2", OBJPROP_XDISTANCE, 86); ObjectSet("LabelBox2", OBJPROP_YDISTANCE, 21); ObjectSet("LabelBox2",OBJPROP_BACK,0);
Enjoy! ;>
youcrazykids wrote:Hi all
Although nothing startling, I've found a way of displaying comments and screen messages, without them being obscured by bars on the chart.
To do this, in the init() function, I add two text labels to the chart, at coordinates 0,0. The Webdings character set contains a solid block, which you can scale up to 150pts, to create a "box". So, a couple of these stacked vertically, then coloured black, does the trick. The comment text sits atop these, and they both stay fixed relative to the window, not the scrolling chart.
Here's the code, and a screenshot. Feel free to adopt/adapt/ridicule it as you wish
CheersCode: Select all
ObjectCreate("LabelBox1", OBJ_LABEL, 0, 0, 0); ObjectSetText("LabelBox1","g",150,"Webdings",Black); ObjectSet("LabelBox1", OBJPROP_XDISTANCE, 0); ObjectSet("LabelBox1", OBJPROP_YDISTANCE, 13); ObjectSet("LabelBox1",OBJPROP_BACK,0); ObjectCreate("LabelBox2", OBJ_LABEL, 0, 0, 0); ObjectSetText("LabelBox2","g",150,"Webdings",Black); ObjectSet("LabelBox2", OBJPROP_XDISTANCE, 0); ObjectSet("LabelBox2", OBJPROP_YDISTANCE, 213); ObjectSet("LabelBox2",OBJPROP_BACK,0); Comment("","\ntext text text text text text text text text text");
youcrazykids[/size]