tbapi.api.interfaces.ichart_object

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api.Interfaces import IChartObject as _IChartObject
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.enums.ztype import ZType
10from Tickblaze.Scripts.Api.Enums import ZType as _ZType
11if TYPE_CHECKING:
12    from tbapi.api.interfaces.ichart import IChart
13    from tbapi.api.interfaces.ichart_scale import IChartScale
14    from tbapi.api.interfaces.idrawing_context import IDrawingContext
15
16@tb_interface(_IChartObject)
17class IChartObject():
18    """Represents an object displayed on a chart, including its scale, and rendering behavior."""
19
20    @property
21    def chart(self) -> IChart:
22        """The chart to which this object belongs."""
23        from tbapi.api.interfaces.ichart import IChart
24        val = self._value.Chart
25        return IChart(_existing=val)
26    @property
27    def chart_scale(self) -> IChartScale:
28        """The scale used by this object on the chart."""
29        from tbapi.api.interfaces.ichart_scale import IChartScale
30        val = self._value.ChartScale
31        return IChartScale(_existing=val)
32    @property
33    def show_on_chart(self) -> bool:
34        """Indicates whether the object is visible on the chart."""
35        val = self._value.ShowOnChart
36        return val
37    @property
38    def ztype(self) -> ZType:
39        val = int(self._value.ZType)
40        return ZType(val)
41    @ztype.setter
42    def ztype(self, val: ZType):
43        tmp = self._value
44        tmp.ZType = _ZType(val.value if hasattr(val, "value") else int(val))
45        self._value = tmp
46
47    @abstractmethod
48    def on_render(self, context: IDrawingContext) -> None:
49        """Draws the chart object using the specified drawing context.            The context used for rendering."""
50        result = self._value.OnRender(context._value)
51        return result
52  
@tb_interface(_IChartObject)
class IChartObject:
22@tb_interface(_IChartObject)
23class IChartObject():
24    """Represents an object displayed on a chart, including its scale, and rendering behavior."""
25
26    @property
27    def chart(self) -> IChart:
28        """The chart to which this object belongs."""
29        from tbapi.api.interfaces.ichart import IChart
30        val = self._value.Chart
31        return IChart(_existing=val)
32    @property
33    def chart_scale(self) -> IChartScale:
34        """The scale used by this object on the chart."""
35        from tbapi.api.interfaces.ichart_scale import IChartScale
36        val = self._value.ChartScale
37        return IChartScale(_existing=val)
38    @property
39    def show_on_chart(self) -> bool:
40        """Indicates whether the object is visible on the chart."""
41        val = self._value.ShowOnChart
42        return val
43    @property
44    def ztype(self) -> ZType:
45        val = int(self._value.ZType)
46        return ZType(val)
47    @ztype.setter
48    def ztype(self, val: ZType):
49        tmp = self._value
50        tmp.ZType = _ZType(val.value if hasattr(val, "value") else int(val))
51        self._value = tmp
52
53    @abstractmethod
54    def on_render(self, context: IDrawingContext) -> None:
55        """Draws the chart object using the specified drawing context.            The context used for rendering."""
56        result = self._value.OnRender(context._value)
57        return result

Represents an object displayed on a chart, including its scale, and rendering behavior.

IChartObject(*args, **kwargs)
199        def __init__(self, *args, **kwargs):
200            pass
26    @property
27    def chart(self) -> IChart:
28        """The chart to which this object belongs."""
29        from tbapi.api.interfaces.ichart import IChart
30        val = self._value.Chart
31        return IChart(_existing=val)

The chart to which this object belongs.

32    @property
33    def chart_scale(self) -> IChartScale:
34        """The scale used by this object on the chart."""
35        from tbapi.api.interfaces.ichart_scale import IChartScale
36        val = self._value.ChartScale
37        return IChartScale(_existing=val)

The scale used by this object on the chart.

show_on_chart: bool
38    @property
39    def show_on_chart(self) -> bool:
40        """Indicates whether the object is visible on the chart."""
41        val = self._value.ShowOnChart
42        return val

Indicates whether the object is visible on the chart.

ztype: tbapi.api.enums.ztype.ZType
43    @property
44    def ztype(self) -> ZType:
45        val = int(self._value.ZType)
46        return ZType(val)
@abstractmethod
def on_render( self, context: tbapi.api.interfaces.idrawing_context.IDrawingContext) -> None:
53    @abstractmethod
54    def on_render(self, context: IDrawingContext) -> None:
55        """Draws the chart object using the specified drawing context.            The context used for rendering."""
56        result = self._value.OnRender(context._value)
57        return result

Draws the chart object using the specified drawing context. The context used for rendering.