plotting/chart.py

18 lines
530 B
Python
Raw Normal View History

from pandas import date_range, Series
2023-12-29 13:37:30 +00:00
from plotly.basedatatypes import BaseTraceType
from typing import List
2023-12-29 13:37:30 +00:00
class Chart:
x: Series = None
def traces(self) -> List[BaseTraceType]:
pass
def range_breaks(self) -> List[dict]:
# Assuming x is either a date or timestamp.
start_date = self.x.min()
end_date = self.x.max()
all_dates = date_range(start = start_date, end = end_date)
missing_dates = all_dates.difference(self.x)
return [dict(values = missing_dates)]