[docs]classPolarLineSeries(SeriesWith2DLines,SeriesWithAddEventListener,GetPolarData,SolveNearestMixin,SeriesWithCursor):"""Series type for visualizing polar line data."""def__init__(self,chart:Chart,theme:Themes=Themes.Light,name:str=None,automatic_color_index:int=None,legend:Optional[LegendOptions]=None,):Series.__init__(self,chart)legend_options=build_series_legend_options(legend)payload={'chart':self.chart.id,'theme':theme.value,'name':name,'legend':legend_optionsiflegend_optionselseNone,}ifautomatic_color_indexisnotNone:payload['automaticColorIndex']=automatic_color_indexself.instance.send(self.id,'addLineSeries',payload,)
[docs]defset_data(self,data:list[dict]):"""Set the data for the series. Args: data (list[dict]): A list of dictionaries, each containing: - 'angle' (float): The angle in degrees. - 'amplitude' (float): The amplitude at that angle. Example: >>> series.set_data([ ... {'angle': 0, 'amplitude': 5}, ... {'angle': 90, 'amplitude': 10}, ... {'angle': 180, 'amplitude': 7.5}, ... {'angle': 270, 'amplitude': 3}, ... ]) Returns: The instance of the class for fluent interface. """data=convert_to_dict(data)self.instance.send(self.id,'setData',{'data':data})returnself
[docs]defset_stroke(self,thickness:int|float,color:ColorInput|None=None):"""Set Stroke style of the series. Args: thickness (int | float): Thickness of the stroke. color (Color): Color of the stroke. Use 'transparent' or None to hide. Returns: The instance of the class for fluent interface. """color=convert_color_to_hex(color)ifcolorisnotNoneelseNoneself.instance.send(self.id,'setStrokeStyle',{'thickness':thickness,'color':color},)returnself