Skip to content

Commit

Permalink
fix: fix plotly line multiple y-axis extra scale
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Dec 6, 2024
1 parent d4a4d5b commit 22aadba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ckanext/charts/chart_builders/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from ckanext.charts import exception
from ckanext.charts.chart_builders.base import BaseChartBuilder, BaseChartForm

# silence SettingWithCopyWarning
pd.options.mode.chained_assignment = None


class PlotlyBuilder(BaseChartBuilder):
"""Base class for Plotly chart builders.
Expand Down Expand Up @@ -182,7 +185,6 @@ def build_line_chart(self) -> Any:
name=self.settings["y"][0],
connectgaps=not self.settings.get("break_chart"),
),
secondary_y=False,
)

if len(self.settings["y"]) > 1:
Expand All @@ -196,7 +198,6 @@ def build_line_chart(self) -> Any:
name=column,
connectgaps=not self.settings.get("break_chart"),
),
secondary_y=True,
)

if self.settings.get("split_data") and len(self.settings["years"]) > 1:
Expand Down
2 changes: 1 addition & 1 deletion ckanext/charts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _build_chart(settings: dict[str, Any], dataframe: pd.DataFrame) -> str | Non
except KeyError as e:
raise ChartBuildError(f"Missing column or field {e}") from e
except ValueError as e:
raise ChartBuildError from e
raise ChartBuildError(str(e)) from e

return chart_config

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
]
license = {text = "AGPL"}
requires-python = ">=3.8"
version = "1.1.2"
version = "1.1.21"

[project.optional-dependencies]
pyarrow = ["pyarrow>=16.0.0,<17.0.0"]
Expand Down

0 comments on commit 22aadba

Please sign in to comment.