diff --git a/README.md b/README.md index 8636bac..9846502 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ if __name__ == '__main__': df1 = pd.read_csv('ohlc.csv') # Columns: time | price - df2 = pd.read_csv('ticks.csv', parse_dates=['time']) + df2 = pd.read_csv('ticks.csv') chart = Chart() diff --git a/examples/3_tick_data/tick_data.py b/examples/3_tick_data/tick_data.py index 3337b65..5d3217d 100644 --- a/examples/3_tick_data/tick_data.py +++ b/examples/3_tick_data/tick_data.py @@ -7,7 +7,7 @@ if __name__ == '__main__': df1 = pd.read_csv('ohlc.csv') # Columns: time | price - df2 = pd.read_csv('ticks.csv', parse_dates=['time']) + df2 = pd.read_csv('ticks.csv') chart = Chart() diff --git a/lightweight_charts/abstract.py b/lightweight_charts/abstract.py index d2737f5..926c3b4 100644 --- a/lightweight_charts/abstract.py +++ b/lightweight_charts/abstract.py @@ -210,7 +210,10 @@ class SeriesCommon(Pane): def _single_datetime_format(self, arg): if isinstance(arg, (str, int, float)) or not pd.api.types.is_datetime64_any_dtype(arg): - arg = pd.to_datetime(arg, unit='ms') + try: + arg = pd.to_datetime(arg, unit='ms') + except ValueError: + arg = pd.to_datetime(arg) arg = self._interval * (arg.timestamp() // self._interval)+self.offset return arg diff --git a/lightweight_charts/js/table.js b/lightweight_charts/js/table.js index d684d7a..986f21c 100644 --- a/lightweight_charts/js/table.js +++ b/lightweight_charts/js/table.js @@ -18,7 +18,7 @@ if (!window.Table) { this.reSize(width, height) this.container.style.display = 'flex' this.container.style.flexDirection = 'column' - this.container.style.justifyContent = 'space-between' + // this.container.style.justifyContent = 'space-between' this.container.style.borderRadius = '5px' this.container.style.color = 'white' diff --git a/lightweight_charts/topbar.py b/lightweight_charts/topbar.py index acdfd4e..1611e08 100644 --- a/lightweight_charts/topbar.py +++ b/lightweight_charts/topbar.py @@ -43,6 +43,7 @@ class SwitcherWidget(Widget): if option not in self.options: raise ValueError(f"option '{option}' does not exist within {self.options}.") self.run_script(f'{self.id}.onItemClicked("{option}")') + self.value = option class MenuWidget(Widget):