tbapi.api.models.chart_point
1from __future__ import annotations 2from typing import TYPE_CHECKING 3from tbapi.common.decorators import tb_class, tb_interface 4from tbapi.common.converters import to_python_datetime, to_net_datetime 5from datetime import datetime 6from Tickblaze.Scripts.Api.Models import ChartPoint as _ChartPoint 7from typing import Any, overload 8from abc import ABC, abstractmethod 9from tbapi.api.models.point import Point 10from tbapi.api.interfaces.ichart_point import IChartPoint 11 12@tb_class(_ChartPoint) 13class ChartPoint(Point, IChartPoint): 14 15 @overload 16 @staticmethod 17 def new() -> "ChartPoint": 18 """Constructor overload with arguments: """ 19 ... 20 @staticmethod 21 def new(*args, **kwargs): 22 """Generic factory method for ChartPoint. Use overloads for IDE type hints.""" 23 return ChartPoint(*args, **kwargs) 24 25 @property 26 def index(self) -> int: 27 val = self._value.Index 28 return val 29 @property 30 def time(self) -> Any: 31 val = self._value.Time 32 return val 33 @time.setter 34 def time(self, val: Any): 35 tmp = self._value 36 tmp.Time = val 37 self._value = tmp 38 @property 39 def value(self) -> Any: 40 val = self._value.Value 41 return val 42 @value.setter 43 def value(self, val: Any): 44 tmp = self._value 45 tmp.Value = val 46 self._value = tmp
@tb_class(_ChartPoint)
class
ChartPoint20@tb_class(_ChartPoint) 21class ChartPoint(Point, IChartPoint): 22 23 @overload 24 @staticmethod 25 def new() -> "ChartPoint": 26 """Constructor overload with arguments: """ 27 ... 28 @staticmethod 29 def new(*args, **kwargs): 30 """Generic factory method for ChartPoint. Use overloads for IDE type hints.""" 31 return ChartPoint(*args, **kwargs) 32 33 @property 34 def index(self) -> int: 35 val = self._value.Index 36 return val 37 @property 38 def time(self) -> Any: 39 val = self._value.Time 40 return val 41 @time.setter 42 def time(self, val: Any): 43 tmp = self._value 44 tmp.Time = val 45 self._value = tmp 46 @property 47 def value(self) -> Any: 48 val = self._value.Value 49 return val 50 @value.setter 51 def value(self, val: Any): 52 tmp = self._value 53 tmp.Value = val 54 self._value = tmp
Represents a point in a 2D space with X and Y coordinates.
@staticmethod
def
new(*args, **kwargs):
28 @staticmethod 29 def new(*args, **kwargs): 30 """Generic factory method for ChartPoint. Use overloads for IDE type hints.""" 31 return ChartPoint(*args, **kwargs)
Generic factory method for ChartPoint. Use overloads for IDE type hints.
index: int
The index of the chart point, which serves as the position identifier of the point in the chart's data series.
time: Any
The time associated with the chart point. It represents the time at which the data point occurred.