Access to main chart when overlay=false - window

I have a question. I would be grateful if someone could help me:
In Pine Script, I have an indicator code whose overlay is false. Now I want to access the main chart window while it is false, what code or command should I use?
πŸŒΈπŸ™

Related

How to scroll to a particular co-ordinate in Test Complete

I have spied a notepad and text box of a notepad contains a string which will be visible only if you scroll down.
Now I am trying to perform a single click there via passing a rectangle co-ordinate to the Test Complete.So with that it is able to click if it is visible on the screen otherwise it fails saying :"there was an attempt to perform an action at a point which is beyond the screen"
Is there any way where we can scroll to the point of interaction before performing the action.
I tried with following steps to achieve that but its of no help.
testObj.setFocus()
testObj.hover()
testObject.MouseWheelScroll(an integer value)
Please try this..
testObj.scrollIntoView(true);
I'm using this code and this is working fine for me..

Processing: Creating Buttons

I'm trying to create a program that creates three buttons on the right side of the screen.
When I press a button, the entire background will change color (each button will make the background a different color). Whenever the mouse is not pressed, the background will return to white. I'm having trouble understanding how to make the three rectangles into buttons.
THIS MUST BE DONE WITHOUT A SPECIAL BUTTON METHOD/LIBRARY
You need to break your problem down into smaller pieces.
Can you create a program that just shows a single button? Don't even worry about making it interactive yet. Just show a single button at hard-coded coordinates.
Now can you detect when the user clicks in that button? Just print something to the console. Get that working perfectly before moving on.
Now can you get multiple buttons working together? Again, just print somethign to the console, and make sure it works perfectly before moving on.
Finally, can you make it so pressing each button changes the background instead of printing something to the console?
If you get stuck on a specific step, you can post a MCVE along with a specific technical question. Stack Overflow really isn't designed for general "how do I do this" type questions. It's for specific "I tried X, expected Y, but got Z instead" type questions. So please try something and post an MCVE of a specific step you're stuck on. Good luck.
Check processing's documentation for mouseClicked() and mousePressed.
The former being a method called upon a click, and the later is a boolean that is constantly updated. (So you'd check for it in your draw())
You'd then want to check the mouseX and mouseY values to see if they are in your desired button's area. (Which would be displayed on screen using rect())

display items' values in bar chart in Jpgraph

I am using jpgraph bar chart. It all works fine but there is one thing I could not really figure it out. I need to display the value of each bar on the top of that bar (column) but it seems like I am missing something that I cant do it.
I have tried using the following:
$bplot->value->Show();
But yet it does not work! Any help is GREATLY appreciated!
It is an old question, but as I had the same problem and I solved it, I'm posting this answer as a future reference.
My problem was the order of the invoked methods. You MUST call Show after addnig the plot to the graph. As an example:
$graph = new \Graph($width, $height);
[... init graph ...]
$plot = new \BarPlot($datay);
$graph->Add($plot);
$plot->value->Show();
$plot->value->SetColor("black","darkred");
$plot->value->SetFormat('%01.2f');
I hope it helps someone.
Call the Show() method after you've added the plot to the graph.
$graph->Add($plot);
$plot->value->Show();
This example shows it can be done, and it gives a complete example of how to pull it off:
http://enacit1.epfl.ch/php/jpgraph/docs/html/exframes/frame_example20.1.html
I'd be glad to look at your code and troubleshoot if you require help beyond this.
Putting the value on top of the bar:
$bplot->SetValuePos('top');
Changing the angle:
$bplot->value->SetAngle(90);
Hiding value that are 0:
$bplot->value->HideZero();

putting image and text in a "scrollable box" for use with contextmenu

I am junior i C# coding, learned things in console output.
Now i am trying to understand the forms better and trying to make an app in windows form.
My goal is to do a foreach( do enumration) loop what is pinging some hosts from file.
This part i succeeded.
Now i want to present this in a form wiht the next layout.
hostname(text) ipadress(text)
i want the line to be selectable for a contextmenu.
I tried to do it in a textbox, but no succes, so i wanted to try it in a richtextbox but i am not sure if this is the proper choice.
Does anyone know what kind of control i have to use to achieve my goal, and which methods i should use.
I am not asking for writing me the whole code, just help me to think in the right way.
Your help would be very appriciated.
thanks.

Could the notebook StyleSheet change the code behaviour?

I'd like to ask if someone had such a problem before. I have version 8.01, on windows 7, 64 bit. SP1.
I have been trying to find why I get Mathematica kernel crash when I added a Tooltip[] command to some code I am writing.
The notebook has the Wolfram Demonstration Style sheet (the Example style sheet which one uses to make demonstrations from). It is a Manipulate, all in one cell.
When I copy the code into a new notebook with default style sheet, the crash goes away! I can't reproduce the crash in the new notebook.
No code change at all. Just copied the whole cell and pasted it in a new notebook. Only difference is one has the Demonstration style sheet, and one is the default style sheet. When I change the stype sheet of the new notebook to Demostration, I notice the Tooltip does not work as well as before. When I use the Example notebook in this style, the minute I start moving the mouse with the toolstip, Kernel crashes.
To make sure, I did this few times. Same result. Once I add the Tooltip[], kernel crash right away only when the style sheet is demonstration.
My question: Has anyone seen such a behavior? I can make the two notebooks available if that is ok.
The crash I get is:
Problem signature:
Problem Event Name: BEX64
Application Name: Mathematica.exe
Application Version: 8.0.31.32201
Application Timestamp: 4d65e0e8
Fault Module Name: StackHash_2766
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 0000000000000001
Exception Code: c0000005
Exception Data: 0000000000000008
OS Version: 6.1.7601.2.1.0.768.3
Locale ID: 1033
Additional Information 1: 2766
Additional Information 2: 2766660d255034f6e73a8cd527b6f51e
Additional Information 3: 8ab7
Additional Information 4: 8ab74987ae95fade363a8e7256e3890f
I did send a bug report to WRI.
My question is: Has anyone had such a problem where a Style sheet change can make the code behave differently? Why would style sheet change cause such a problem?
Update 1:
I was able to make small example that shows part of the problem. I am working on making another small example that shows the crash itself. But this example below shows the problem, which is that Tooltip do not work the same when the style sheet is demonstration. First, here is a screen shot, side by side, same code, the left is in default style sheet, and the right is in Demonstration style
(below the image, I paste the source code, with steps how to reproduce the problem)
Manipulate[
EventHandler[Dynamic[Graphics[
{
Circle[{0,0},1],
Dynamic#Tooltip[Text[Style["O",Red,16] ,pt],Style[pt]]
},
ImageSize->250, PlotRange->{{-1,1},{-1,1}}
],ContinuousAction->True],
"MouseDragged":>
( pt=MousePosition["Graphics"] )
],
{{pt,{0,0}},ControlType->None},
TrackedSymbols:> {None},
ContinuousAction->True
]
steps:
Paste the above code in new style sheet, style default. Drag the point, you should see the coordinates display all the time, as you drag the point with the mouse.
File->New->Demonstration, and paste the same code in the Manipulate cell there replacing small template already there.
Now do the same, drag the point. You will see that the tooltip DO NOT display as the mouse is dragged. it only displays when holding the mouse steady over the point.
there is different behavior in dynamics that seems to cause this, or something else in this style.
I tried different style sheets, and the tooltip works ok there. only with Demonstration style sheet I get this problem with the tooltip.
If someone has a solution to this, it will be great. As I'd like to use tooltip in a demo.
I'll try to make an example that causes the crash also.
Update:
I've got back respsonce from WRI technical support. It is a Style sheet issue. Meanwhile, as a work around this is the suggestion From tech support:
I was able to reproduce the kernel crash. It looks like a demonstration
stylesheet issue related to imagesize fit.
At the top of the demonstration notebook there is tab called 'Tools',
clicking on it gives you an option called 'Resize Notebook to Fit'. On
resizing the notebook and saving it the kernel crash does not happen.
Thanks to WRI tech support.
update dec 2 2011
Based on John Fultz answer below, I am closing this question now. Thanks John.
(This answer is actually due to John Fultz -- see the comments under the original question. I'm turning it into an answer so that this question stops showing up on the unanswered-questions list. Clearly it's actually John who deserves any reputation points for this; John, if you post an answer here then I'll vote it up and delete mine.)
The reason why your tooltip isn't appearing in the demonstration version is that the Demonstration stylesheet puts a nonzero delay on tooltips, so that they only appear after hovering over them for a certain length of time. In particular, this means that they won't appear while dragging.
You can reverse this by setting the delay to zero on your Manipulate; do this by adding the following option to the Manipulate call.
BaseStyle -> {TooltipBoxOptions -> {TooltipDelay->0}}

Resources