Skip to content

InvalidChartDataError(chart_name, setting_name, data_name, needs_setting) Source

Bases: NumdaplotError

Raised when a chart misses a column setting a Table needs, or has one an Array does not use.

A Table needs the y columns of a chart, while an Array draws each of its columns and takes no column name.

Added in version 0.1.0

Parameters:

  • chart_name (str)

    Name of the chart class, such as LineChart.

  • setting_name (str)

    Name of the setting, such as y.

  • data_name (str)

    The data drawn: a Table or an Array.

  • needs_setting (bool)

    True when the setting is missing, False when it is given but not used.

Attributes:

  • chart_name

    Name of the chart class, such as LineChart.

  • setting_name

    Name of the setting, such as y.

  • data_name

    The data drawn: a Table or an Array.

  • needs_setting

    True when the setting is missing, False when it is given but not used.

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5])
chart = ndp.LineChart(y=["price"])
try:
    ndp.Plot.line(prices, chart)
except ndp.InvalidChartDataError as error:
    print(error)
# LineChart takes no y for an Array.