tbapi.api.color_series
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 import ColorSeries as _ColorSeries 7from typing import Any, overload 8from abc import ABC, abstractmethod 9from tbapi.api.series import Series 10from tbapi.api.models.color import Color 11if TYPE_CHECKING: 12 from tbapi.api.plot_series import PlotSeries 13 14@tb_class(_ColorSeries) 15class ColorSeries(Series): 16 """A class representing a collection of plot colors for the .""" 17 18 @overload 19 @staticmethod 20 def new(plotSeries: PlotSeries) -> "ColorSeries": 21 """Constructor overload with arguments: plotSeries""" 22 ... 23 @overload 24 @staticmethod 25 def new(defaultColor: Color | None = None) -> "ColorSeries": 26 """Constructor overload with arguments: defaultColor""" 27 ... 28 @staticmethod 29 def new(*args, **kwargs): 30 """Generic factory method for ColorSeries. Use overloads for IDE type hints.""" 31 return ColorSeries(*args, **kwargs) 32 33 34 35 36 def __getitem__(self, index: int) -> Color: 37 result = self._value[index] 38 return Color(_existing=result) 39 40 def __setitem__(self, index: int, value: Color): 41 tmp = value 42 tmp = value._value 43 self._value[index] = tmp
22@tb_class(_ColorSeries) 23class ColorSeries(Series): 24 """A class representing a collection of plot colors for the .""" 25 26 @overload 27 @staticmethod 28 def new(plotSeries: PlotSeries) -> "ColorSeries": 29 """Constructor overload with arguments: plotSeries""" 30 ... 31 @overload 32 @staticmethod 33 def new(defaultColor: Color | None = None) -> "ColorSeries": 34 """Constructor overload with arguments: defaultColor""" 35 ... 36 @staticmethod 37 def new(*args, **kwargs): 38 """Generic factory method for ColorSeries. Use overloads for IDE type hints.""" 39 return ColorSeries(*args, **kwargs) 40 41 42 43 44 def __getitem__(self, index: int) -> Color: 45 result = self._value[index] 46 return Color(_existing=result) 47 48 def __setitem__(self, index: int, value: Color): 49 tmp = value 50 tmp = value._value 51 self._value[index] = tmp
A class representing a collection of plot colors for the .
@staticmethod
def
new(*args, **kwargs):
36 @staticmethod 37 def new(*args, **kwargs): 38 """Generic factory method for ColorSeries. Use overloads for IDE type hints.""" 39 return ColorSeries(*args, **kwargs)
Generic factory method for ColorSeries. Use overloads for IDE type hints.