Class CurveKind

class ooodev.utils.kind.curve_kind.CurveKind(curve, label, ns)[source]

Curve Kind Enum. Regression line types.

Usage:

# compare enums
>>> x = CurveKind.MOVING_AVERAGE
>>> y = CurveKind.MOVING_AVERAGE
>>> assert x == y

>>> print(x.curve)
5
>>> print(x.label)
Moving average
>>> print(x.name)
MOVING_AVERAGE
>>> print(CurveKind.LINEAR.to_namespace())
com.sun.star.chart2.LinearRegressionCurve
__init__(curve, label, ns)[source]
Parameters:
  • curve (int) –

  • label (str) –

  • ns (str) –

static from_str(s)[source]

Gets an CurveKind instance from string.

Parameters:

s (str) – String that represents the name of an enum Name. s is case insensitive and can be CamelCase, pascal_case , snake_case, hyphen-case, normal case.

Raises:
  • ValueError – If input string is empty.

  • AttributeError – If unable to get CurveKind instance.

Returns:

Enum instance.

Return type:

CurveKind

to_namespace()[source]

Gets the full UNO namespace value of CurveKind instance.

Returns:

String namespace such as com.sun.star.chart2.LinearRegressionCurve

Return type:

str

EXPONENTIAL = (2, 'Exponential', 'ExponentialRegressionCurve')
LINEAR = (0, 'Linear', 'LinearRegressionCurve')
LOGARITHMIC = (1, 'Logarithmic', 'LogarithmicRegressionCurve')
MOVING_AVERAGE = (5, 'Moving average', 'MovingAverageRegressionCurve')
POLYNOMIAL = (4, 'Polynomial', 'PolynomialRegressionCurve')
POWER = (3, 'Power', 'PotentialRegressionCurve')