QwtLegendData

class qwt.legend_data.QwtLegendData[source]

Attributes of an entry on a legend

QwtLegendData is an abstract container ( like QAbstractModel ) to exchange attributes, that are only known between to the plot item and the legend.

By overloading QwtPlotItem.legendData() any other set of attributes could be used, that can be handled by a modified ( or completely different ) implementation of a legend.

Note

The stockchart example implements a legend as a tree with checkable items

setValues(map_)[source]

Set the legend attributes

Parameters:map_ (dict) – Values

See also

values()

values()[source]
Returns:Legend attributes

See also

setValues()

hasRole(role)[source]
Parameters:role (int) – Attribute role
Returns:True, when the internal map has an entry for role
setValue(role, data)[source]

Set an attribute value

Parameters:
  • role (int) – Attribute role
  • data (QVariant) – Attribute value

See also

value()

value(role)[source]
Parameters:role (int) – Attribute role
Returns:Attribute value for a specific role

See also

setValue()

isValid()[source]
Returns:True, when the internal map is empty
title()[source]
Returns:Value of the TitleRole attribute
icon()[source]
Returns:Value of the IconRole attribute
mode()[source]
Returns:Value of the ModeRole attribute
class qwt.legend_data.QwtLegendData[source]

Attributes of an entry on a legend

QwtLegendData is an abstract container ( like QAbstractModel ) to exchange attributes, that are only known between to the plot item and the legend.

By overloading QwtPlotItem.legendData() any other set of attributes could be used, that can be handled by a modified ( or completely different ) implementation of a legend.

Note

The stockchart example implements a legend as a tree with checkable items

setValues(map_)[source]

Set the legend attributes

Parameters:map_ (dict) – Values

See also

values()

values()[source]
Returns:Legend attributes

See also

setValues()

hasRole(role)[source]
Parameters:role (int) – Attribute role
Returns:True, when the internal map has an entry for role
setValue(role, data)[source]

Set an attribute value

Parameters:
  • role (int) – Attribute role
  • data (QVariant) – Attribute value

See also

value()

value(role)[source]
Parameters:role (int) – Attribute role
Returns:Attribute value for a specific role

See also

setValue()

isValid()[source]
Returns:True, when the internal map is empty
title()[source]
Returns:Value of the TitleRole attribute
icon()[source]
Returns:Value of the IconRole attribute
mode()[source]
Returns:Value of the ModeRole attribute