19 lines
481 B
Python
19 lines
481 B
Python
|
from chart import Chart
|
||
|
from pandas import Series
|
||
|
from plotly.graph_objects import Scatter
|
||
|
|
||
|
class LineChart(Chart):
|
||
|
|
||
|
def __init__(self, x: Series, y: Series, name: str):
|
||
|
self.x = x
|
||
|
self.y = y
|
||
|
self.name = name
|
||
|
|
||
|
def trace(self) -> Scatter:
|
||
|
return Scatter(
|
||
|
x = self.x,
|
||
|
y = self.y,
|
||
|
name = self.name,
|
||
|
mode = 'lines',
|
||
|
line=dict(color = 'yellow') # TODO: Make this configurable.
|
||
|
)
|