plotting/chart.py
2024-01-03 06:32:29 -08:00

19 lines
552 B
Python

from pandas import date_range, Series
from plotly.basedatatypes import BaseTraceType
from typing import List
class Chart:
x: Series = None
title: str = 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)]