ChartMouseEventArgs
class cAlgo.API
DesktopCLICloud
Provides data for the mouse related routed events.
Environment behaviour
CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).
Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (ChartArea.MouseDown, ChartArea.MouseEnter, ChartArea.MouseLeave and more).
Definition
public class ChartMouseEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
using cAlgo.API;
namespace cAlgo
{
// This example shows how to use the Chart ChartMouseEventArgs
public partial class ChartMouseEventArgsSample : Indicator
{
protected override void Initialize()
{
Chart.MouseMove += Chart_MouseMove;
}
private void Chart_MouseMove(ChartMouseEventArgs obj)
{
var text = string.Format("Mouse Location: ({0}, {1})", obj.MouseX, obj.MouseY);
Chart.DrawStaticText("mouse", text, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);
}
public override void Calculate(int index)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
api.Chart.MouseMove += self.on_chart_mouse_move
def on_chart_mouse_move(self, args):
text = f"Mouse Location: ({args.MouseX}, {args.MouseY})"
api.Chart.DrawStaticText("mouse", text, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Properties
| Name | Description |
|---|---|
AltKeyDesktopCLICloudbool | Defines whether the Alt key is pressed during the mouse event. |
BarIndexDesktopCLIClouddouble | Gets the exact bar index of the mouse event. |
ChartDesktopCLICloudChart | Gets the chart. |
ChartAreaDesktopCLICloudChartArea | Gets the chart area. |
CtrlKeyDesktopCLICloudbool | Defines whether the Ctrl key is pressed during the mouse event. |
MouseXDesktopCLIClouddouble | Gets the X-axis value of the mouse event. |
MouseYDesktopCLIClouddouble | Gets the Y-axis value of the mouse event. |
ShiftKeyDesktopCLICloudbool | Defines whether the Shift key is pressed during the mouse event. |
TimeValueDesktopCLICloudDateTime | Gets the time value on the X-axis where the mouse event occurs. |
YValueDesktopCLIClouddouble | Gets the Y-axis value of the mouse event. |