"""Spec to style a column series."""

from engineai.sdk.dashboard.styling.color.typing import ColorSpec
from engineai.sdk.dashboard.templated_string import TemplatedStringItem

from .base import BaseChartSeriesStyling
from .enums import MarkerSymbol


class ErrorBarSeriesStyling(BaseChartSeriesStyling):
    """Customize appearance of error bars in Chart.

    Specify styling options for an error bar series within a
    Chart widget to customize the appearance of error bars
    representing data variability or uncertainty on the chart.
    """

    def __init__(
        self,
        *,
        color_spec: ColorSpec,
        data_column: TemplatedStringItem | None = None,
        marker_symbol: MarkerSymbol = MarkerSymbol.SQUARE,
    ) -> None:
        """Constructor for ErrorBarSeriesStyling.

        Args:
            color_spec: spec for coloring columns.
            data_column: name of column in pandas dataframe(s) used for color spec if
                a gradient is used. Optional for single colors.
            marker_symbol: symbol for marker in tooltips and legends.

        Raises:
            ChartStylingMissingDataColumnError: if a data_column is not defined when
                color_spec is a ColorDiscreteMap or ColorGradient
        """
        super().__init__(
            color_spec=color_spec, data_column=data_column, marker_symbol=marker_symbol
        )
