Views
Data Access Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IliChartGraphic Class Reference

A chart class. More...

#include <ilviews/dataccess/gadgets/chartgraphic.h>

Inherits IlvChartGraphic.

Public Member Functions

 IliChartGraphic (IlvDisplay *display, const IlvRect &bbox, IlvPalette *palette=0)
 Constructor of the IliChartGraphic class. More...
 
void addColumnName (const char *name, IlInt dsi=0)
 Adds a column name. More...
 
void addErrorSink (IliErrorSink *sink)
 Adds an error sink to this table gadget. More...
 
IlInt getColumnCount (IlInt dsi=0) const
 Returns the column count. More...
 
const char * getColumnName (IlInt pos, IlInt dsi=0) const
 Returns a column name. More...
 
IliChartDataModelgetDataModel () const
 Returns the data model. More...
 
const char * getDataModelName () const
 Returns the data model name. More...
 
IliDataSourcegetDataSource (IlInt index=0)
 Returns a data source. More...
 
IlInt getDataSourceCount () const
 Returns the data source count. More...
 
const char * getDataSourceName (IlInt index=0) const
 Returns a data source name. More...
 
IlvAbstractChartDisplayer * getDefaultDisplayer () const
 Returns the default displayer. More...
 
IliErrorReportergetErrorReporter () const
 Returns the error reporter that is used by the reportErrors method. More...
 
IlInt getModelPropertyCount (IliChartModelType type) const
 Returns the model property count. More...
 
IlInt getModelPropertyIndex (IliChartModelType type, const char *name) const
 Returns a model property index. More...
 
const char * getModelPropertyName (IliChartModelType type, IlInt index) const
 Returns a model property name. More...
 
const IliValuegetModelPropertyValue (IliChartModelType type, const char *name) const
 Returns a model property value. More...
 
const IliValuegetModelPropertyValue (IliChartModelType type, IlInt index) const
 Returns a model property value. More...
 
IliChartSeriesModelgetSeriesModel () const
 Returns the series model. More...
 
const char * getSeriesModelName () const
 Returns the series model name. More...
 
void removeErrorSink (IliErrorSink *sink)
 Removes an error sink from this table gadget. More...
 
void reportErrors (const IliErrorList &errList) const
 Reports the errors that are contained in a error list. More...
 
void setColumnCount (IlInt count, IlInt dsi=0) const
 Sets the column count. More...
 
void setColumnName (const char *name, IlInt pos, IlInt dsi=0)
 Sets a column name. More...
 
void setDataModelName (const char *name)
 Sets the data model name. More...
 
void setDataSource (IliDataSource *ds, IlInt index=0)
 Sets a data source. More...
 
void setDataSourceCount (IlInt count)
 Sets the data source count. More...
 
void setDataSourceName (const char *name, IlInt index=0)
 Sets a data source name. More...
 
void setDefaultDisplayer (IlvAbstractChartDisplayer *disp)
 Sets the default displayer. More...
 
void setErrorReporter (IliErrorReporter *reporter)
 Sets the error reporter. More...
 
void setModelPropertyValue (IliChartModelType type, const char *name, const IliValue &val)
 Sets a model property value. More...
 
void setModelPropertyValue (IliChartModelType type, IlInt index, const IliValue &val)
 Sets a model property value. More...
 
void setSeriesModelName (const char *name)
 Sets the series model name. More...
 

Detailed Description

A chart class.

Library: dbchart

The class defines a chart graphic which can be connected to one or several data sources. The number of data sources and columns depend on the data model. By default, three data models are provided:

However, you can define your own data model. This classes uses another model type, the series model. This model type, is used to compute the properties of the new series. The computed properties are:

Note: The inspector of this class has two limitations:

See also
IliChartDataModel, IliChartSeriesModel.

Constructor & Destructor Documentation

◆ IliChartGraphic()

IliChartGraphic::IliChartGraphic ( IlvDisplay display,
const IlvRect bbox,
IlvPalette palette = 0 
)

Constructor of the IliChartGraphic class.

Initializes an IliChartGraphic object. This class can be used to connect a data source to chart graphic.

Parameters
displayThe display.
bboxThe bounding box.
paletteThe palette.

Member Function Documentation

◆ addColumnName()

void IliChartGraphic::addColumnName ( const char *  name,
IlInt  dsi = 0 
)

Adds a column name.

This function works fine when the data model allows this operation.

Parameters
nameThe column name.
dsiThe data source index.

◆ addErrorSink()

void IliChartGraphic::addErrorSink ( IliErrorSink sink)

Adds an error sink to this table gadget.

Parameters
sinkThe error sink to be added.

◆ getColumnCount()

IlInt IliChartGraphic::getColumnCount ( IlInt  dsi = 0) const

Returns the column count.

Parameters
dsiThe data source index.
Returns
The column count.

◆ getColumnName()

const char* IliChartGraphic::getColumnName ( IlInt  pos,
IlInt  dsi = 0 
) const

Returns a column name.

Parameters
posThe column position.
dsiThe data source index.
Returns
The column name or 0 if the indexes are invalid.

◆ getDataModel()

IliChartDataModel* IliChartGraphic::getDataModel ( ) const

Returns the data model.

Returns
The data model.

◆ getDataModelName()

const char* IliChartGraphic::getDataModelName ( ) const

Returns the data model name.

Returns
The model name.

◆ getDataSource()

IliDataSource* IliChartGraphic::getDataSource ( IlInt  index = 0)

Returns a data source.

Parameters
indexThe data source index.
Returns
The data source if the parameter index is valid and 0 otherwise.

◆ getDataSourceCount()

IlInt IliChartGraphic::getDataSourceCount ( ) const

Returns the data source count.

Returns
The count.

◆ getDataSourceName()

const char* IliChartGraphic::getDataSourceName ( IlInt  index = 0) const

Returns a data source name.

Parameters
indexThe data source index.
Returns
The data source name if the parameter index is valid and 0 otherwise.

◆ getDefaultDisplayer()

IlvAbstractChartDisplayer* IliChartGraphic::getDefaultDisplayer ( ) const

Returns the default displayer.

Returns
The displayer.

◆ getErrorReporter()

IliErrorReporter* IliChartGraphic::getErrorReporter ( ) const

Returns the error reporter that is used by the reportErrors method.

When this property is NULL a default error reporter is used. Initially this property is NULL.

Returns
The error reporter.

◆ getModelPropertyCount()

IlInt IliChartGraphic::getModelPropertyCount ( IliChartModelType  type) const

Returns the model property count.

Parameters
typeThe model type.
Returns
The count.

◆ getModelPropertyIndex()

IlInt IliChartGraphic::getModelPropertyIndex ( IliChartModelType  type,
const char *  name 
) const

Returns a model property index.

Parameters
typeThe model type.
nameThe property name.
Returns
The index if found, otherwise -1.

◆ getModelPropertyName()

const char* IliChartGraphic::getModelPropertyName ( IliChartModelType  type,
IlInt  index 
) const

Returns a model property name.

Parameters
typeThe model type.
indexThe property index.
Returns
The name if index valid, otherwise 0.

◆ getModelPropertyValue() [1/2]

const IliValue& IliChartGraphic::getModelPropertyValue ( IliChartModelType  type,
const char *  name 
) const

Returns a model property value.

Parameters
typeThe model type.
nameThe property name.
Returns
The value if found otherwise a null value.

◆ getModelPropertyValue() [2/2]

const IliValue& IliChartGraphic::getModelPropertyValue ( IliChartModelType  type,
IlInt  index 
) const

Returns a model property value.

Parameters
typeThe model type.
indexThe property index.
Returns
The value if it is found and a null value otherwise.

◆ getSeriesModel()

IliChartSeriesModel* IliChartGraphic::getSeriesModel ( ) const

Returns the series model.

Returns
The series model.

◆ getSeriesModelName()

const char* IliChartGraphic::getSeriesModelName ( ) const

Returns the series model name.

Returns
The model name.

◆ removeErrorSink()

void IliChartGraphic::removeErrorSink ( IliErrorSink sink)

Removes an error sink from this table gadget.

Parameters
sinkThe error sink to be removed.

◆ reportErrors()

void IliChartGraphic::reportErrors ( const IliErrorList errList) const

Reports the errors that are contained in a error list.

This member function makes use of the error reporter returned by getErrorReporter if any. Otherwise it uses a default error reporter.

Parameters
errListThe error list.

◆ setColumnCount()

void IliChartGraphic::setColumnCount ( IlInt  count,
IlInt  dsi = 0 
) const

Sets the column count.

This function works fine when the data model allows this operation.

Parameters
countThe column count.
dsiThe data source index.

◆ setColumnName()

void IliChartGraphic::setColumnName ( const char *  name,
IlInt  pos,
IlInt  dsi = 0 
)

Sets a column name.

Parameters
nameThe column name.
posThe column position.
dsiThe data source index.

◆ setDataModelName()

void IliChartGraphic::setDataModelName ( const char *  name)

Sets the data model name.

When you change the data model name, the data source name and the column name are erased.

Parameters
nameThe model name. The predefined models are: IliChartRowDataModel, IliChartDSDataModel, IliChartColumnDataModel

◆ setDataSource()

void IliChartGraphic::setDataSource ( IliDataSource ds,
IlInt  index = 0 
)

Sets a data source.

Parameters
dsThe data source.
indexThe data source index.

◆ setDataSourceCount()

void IliChartGraphic::setDataSourceCount ( IlInt  count)

Sets the data source count.

If the data model has a data source count fixed, this function do nothing. If the data source count is changed, all columns are erased.

Parameters
countThe data source count.

◆ setDataSourceName()

void IliChartGraphic::setDataSourceName ( const char *  name,
IlInt  index = 0 
)

Sets a data source name.

Parameters
nameThe data source name.
indexThe data source index.

◆ setDefaultDisplayer()

void IliChartGraphic::setDefaultDisplayer ( IlvAbstractChartDisplayer *  disp)

Sets the default displayer.

The default displayer is used to create a displayer for new series without displayer. The default displayer is deleted by the IliChartGraphic class. The color of the default displayer is ignored by the chart graphic. It is computed by the current series model.

Parameters
dispThe default displayer.

◆ setErrorReporter()

void IliChartGraphic::setErrorReporter ( IliErrorReporter reporter)

Sets the error reporter.

Note that the table gadget will not delete the error reporter at destruction time, so the same error reporter may be safely shared by many table gadgets.

Parameters
reporterThe new error reporter.

◆ setModelPropertyValue() [1/2]

void IliChartGraphic::setModelPropertyValue ( IliChartModelType  type,
const char *  name,
const IliValue val 
)

Sets a model property value.

Parameters
typeThe model type.
nameThe property name.
valThe value.

◆ setModelPropertyValue() [2/2]

void IliChartGraphic::setModelPropertyValue ( IliChartModelType  type,
IlInt  index,
const IliValue val 
)

Sets a model property value.

Parameters
typeThe model type.
indexThe property index.
valThe value.

◆ setSeriesModelName()

void IliChartGraphic::setSeriesModelName ( const char *  name)

Sets the series model name.

Parameters
nameThe model name. The predefined model is IliChartSeriesModel.