from __future__ import annotations
from enum import Enum
[docs]class ChartBaseTypeEnum(str, Enum):
def __str__(self) -> str:
return str(self.value)
[docs] def to_namespace(self) -> str:
raise NotImplementedError
[docs]class ChartTemplateBase(ChartBaseTypeEnum):
"""
Base Enum for all enums found in :py:class:`~.chart2_types.ChartTypes`
Example:
:py:attr:`.Chart2.ChartLookup` is an alias of :py:class:`~.chart2_types.ChartTypes`
.. code-block:: python
Chart2.has_categories(diagram_name=Chart2.ChartLookup.Bar.TYPE_PERCENT.BAR_DEEP_3D)
See Also:
:py:meth:`.Chart2.has_categories`
"""
def to_namespace(self) -> str:
return f"com.sun.star.chart2.template.{self.value}"
[docs]class ChartTypeNameBase(ChartBaseTypeEnum):
def to_namespace(self) -> str:
return f"com.sun.star.chart2.{self.value}"
[docs]class ColumnStackedKind(ChartTemplateBase):
COLUMN = "Column"
STACKED_COLUMN = "StackedColumn"
PERCENT_STACKED_COLUMN = "PercentStackedColumn"
[docs]class ColumnPercentKind(ChartTemplateBase):
COLUMN_DEEP_3D = "ThreeDColumnDeep"
COLUMN_FLAT_3D = "ThreeDColumnFlat"
[docs]class Column3dKind(ChartTemplateBase):
STACKED_3D_COLUMN_FLAT = "StackedThreeDColumnFlat"
PERCENT_STACKED_3D_COLUMN_FLAT = "PercentStackedThreeDColumnFlat"
[docs]class BarStackedKind(ChartTemplateBase):
BAR = "Bar"
STACKED_BAR = "StackedBar"
PERCENT_STACKED_BAR = "PercentStackedBar"
[docs]class BarPercentKind(ChartTemplateBase):
BAR_DEEP_3D = "ThreeDBarDeep"
BAR_FLAT_3D = "ThreeDBarFlat"
[docs]class Bar3dKind(ChartTemplateBase):
STACKED_3D_BAR_FLAT = "StackedThreeDBarFlat"
PERCENT_STACKED_3D_BAR_FLAT = "PercentStackedThreeDBarFlat"
[docs]class PieDonutKind(ChartTemplateBase):
PIE = "Pie"
DONUT = "Donut"
[docs]class PieExplodeKind(ChartTemplateBase):
PIE_ALL_EXPLODED = "PieAllExploded"
DONUT_ALL_EXPLODED = "DonutAllExploded"
[docs]class Pie3dKind(ChartTemplateBase):
PIE_3D = "ThreeDPie"
PIE_ALL_EXPLODED_3D = "ThreeDPieAllExploded"
DONUT_3D = "ThreeDDonut"
DONUT_ALL_EXPLODED_3D = "ThreeDDonutAllExploded"
[docs]class AreaStackedKind(ChartTemplateBase):
AREA = "Area"
STACKED_AREA = "StackedArea"
PERCENT_STACKED_AREA = "PercentStackedArea"
[docs]class AreaPercentKind(ChartTemplateBase):
AREA_3D = "ThreeDArea"
STACKED_AREA_3D = "StackedThreeDArea"
[docs]class Area3dKind(ChartTemplateBase):
PERCENT_STACKED_AREA_3D = "PercentStackedThreeDArea"
[docs]class LineSymbolKind(ChartTemplateBase):
LINE = "Line"
SYMBOL = "Symbol"
LINE_SYMBOL = "LineSymbol"
[docs]class LineStackedKind(ChartTemplateBase):
STACKED_LINE = "StackedLine"
STACKED_SYMBOL = "StackedSymbol"
STACKED_LINE_SYMBOL = "StackedLineSymbol"
[docs]class LinePercentKind(ChartTemplateBase):
PERCENT_STACKED_LINE = "PercentStackedLine"
PERCENT_STACKED_SYMBOL = "PercentStackedSymbol"
[docs]class Line3dKind(ChartTemplateBase):
PERCENT_STACKED_LINE_SYMBOL = "PercentStackedLineSymbol"
LINE_3D = "ThreeDLine"
LINE_DEEP_3D = "ThreeDLineDeep"
STACKED_LINE_3D = "StackedThreeDLine"
PERCENT_STACKED_LINE_3D = "PercentStackedThreeDLine"
[docs]class XYLineKind(ChartTemplateBase):
SCATTER_SYMBOL = "ScatterSymbol"
SCATTER_LINE = "ScatterLine"
SCATTER_LINE_SYMBOL = "ScatterLineSymbol"
[docs]class XY3dKind(ChartTemplateBase):
SCATTER_3D = "ThreeDScatter"
[docs]class BubbleKind(ChartTemplateBase):
BUBBLE = "Bubble"
[docs]class NetLineKind(ChartTemplateBase):
NET = "Net"
NET_LINE = "NetLine"
NET_SYMBOL = "NetSymbol"
FILLED_NET = "FilledNet"
[docs]class NetSymbolKind(ChartTemplateBase):
STACKED_NET = "StackedNet"
STACKED_NET_LINE = "StackedNetLine"
[docs]class NetFilledKind(ChartTemplateBase):
STACKED_NET_SYMBOL = "StackedNetSymbol"
STACKED_FILLED_NET = "StackedFilledNet"
[docs]class NetStackedKind(ChartTemplateBase):
PERCENT_STACKED_NET = "PercentStackedNet"
PERCENT_STACKED_NET_LINE = "PercentStackedNetLine"
PERCENT_STACKED_NET_SYMBOL = "PercentStackedNetSymbol"
[docs]class NetPercentKind(ChartTemplateBase):
PERCENT_STACKED_FILLED_NET = "PercentStackedFilledNet"
[docs]class StockOpenKind(ChartTemplateBase):
STOCK_LOW_HIGH_CLOSE = "StockLowHighClose"
[docs]class StockVolumeKind(ChartTemplateBase):
STOCK_OPEN_LOW_HIGH_CLOSE = "StockOpenLowHighClose"
STOCK_VOLUME_LOW_HIGH_CLOSE = "StockVolumeLowHighClose"
STOCK_VOLUME_OPEN_LOW_HIGH_CLOSE = "StockVolumeOpenLowHighClose"
[docs]class ColumnAndLineStackedKind(ChartTemplateBase):
COLUMN_WITH_LINE = "ColumnWithLine"
STACKED_COLUMN_WITH_LINE = "StackedColumnWithLine"
[docs]class NamedColumnKind(ChartTypeNameBase):
COLUMN_CHART = "ColumnChartType"
[docs]class NamedBarKind(ChartTypeNameBase):
BAR_CHART = "BarChartType"
[docs]class NamedPieKind(ChartTypeNameBase):
PIE_CHART = "PieChartType"
[docs]class NamedAreaKind(ChartTypeNameBase):
AREA_CHART = "AreaChartType"
[docs]class NamedLineKind(ChartTypeNameBase):
LINE_CHART = "LineChartType"
[docs]class NamedXYKind(ChartTypeNameBase):
SCATTER_CHART = "ScatterChartType"
[docs]class NamedBubbleKind(ChartTypeNameBase):
BUBBLE_CHART = "BubbleChartType"
[docs]class NamedNetKind(ChartTypeNameBase):
NET_CHART = "NetChartType"
FILLED_NET_CHART = "FilledNetChartType"
[docs]class NamedStockKind(ChartTypeNameBase):
CANDLE_STICK_CHART = "CandleStickChartType"
[docs]class ChartTypes:
"""
Class for convenient lookup of chart type names.
"""
[docs] class Column:
DEFAULT = ColumnStackedKind.COLUMN
NAMED = NamedColumnKind
TEMPLATE_3D = Column3dKind
TEMPLATE_PERCENT = ColumnPercentKind
TEMPLATE_STACKED = ColumnStackedKind
[docs] class ColumnAndLine:
DEFAULT = ColumnAndLineStackedKind.COLUMN_WITH_LINE
TEMPLATE_STACKED = ColumnAndLineStackedKind
[docs] class Bar:
DEFAULT = BarStackedKind.BAR
NAMED = NamedBarKind
TEMPLATE_3D = Bar3dKind
TEMPLATE_PERCENT = BarPercentKind
TEMPLATE_STACKED = BarStackedKind
[docs] class Pie:
DEFAULT = PieDonutKind.PIE
NAMED = NamedPieKind
TEMPLATE_3D = Pie3dKind
TEMPLATE_DONUT = PieDonutKind
TEMPLATE_EXPLODE = PieExplodeKind
[docs] class Area:
DEFAULT = AreaStackedKind.AREA
NAMED = NamedAreaKind
TEMPLATE_3D = Area3dKind
TEMPLATE_PERCENT = AreaPercentKind
TEMPLATE_STACKED = AreaStackedKind
[docs] class Line:
DEFAULT = LineSymbolKind.LINE
NAMED = NamedLineKind
TEMPLATE_3D = Line3dKind
TEMPLATE_PERCENT = LinePercentKind
TEMPLATE_STACKED = LineStackedKind
TEMPLATE_SYMBOL = LineSymbolKind
[docs] class XY:
DEFAULT = XYLineKind.SCATTER_SYMBOL
NAMED = NamedXYKind
TEMPLATE_3D = XY3dKind
TEMPLATE_LINE = XYLineKind
[docs] class Bubble:
DEFAULT = NamedBubbleKind.BUBBLE_CHART
NAMED = NamedBubbleKind
TEMPLATE_BUBBLE = BubbleKind
[docs] class Net:
DEFAULT = NetLineKind.NET_SYMBOL
NAMED = NamedNetKind
TEMPLATE_FILLED = NetFilledKind
TEMPLATE_LINE = NetLineKind
TEMPLATE_PERCENT = NetPercentKind
TEMPLATE_STACKED = NetStackedKind
TEMPLATE_SYMBOL = NetSymbolKind
[docs] class Stock:
DEFAULT = StockOpenKind.STOCK_LOW_HIGH_CLOSE
NAMED = NamedStockKind
TEMPLATE_OPEN = StockOpenKind
TEMPLATE_VOLUME = StockVolumeKind