Rogue Wave Views |
Rogue Wave Views Documentation Home |
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... | |
IliChartDataModel * | getDataModel () const |
Returns the data model. More... | |
const char * | getDataModelName () const |
Returns the data model name. More... | |
IliDataSource * | getDataSource (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... | |
IliErrorReporter * | getErrorReporter () 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 IliValue & | getModelPropertyValue (IliChartModelType type, const char *name) const |
Returns a model property value. More... | |
const IliValue & | getModelPropertyValue (IliChartModelType type, IlInt index) const |
Returns a model property value. More... | |
IliChartSeriesModel * | getSeriesModel () 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... | |
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:
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.
display | The display. |
bbox | The bounding box. |
palette | The palette. |
void IliChartGraphic::addColumnName | ( | const char * | name, |
IlInt | dsi = 0 |
||
) |
Adds a column name.
This function works fine when the data model allows this operation.
name | The column name. |
dsi | The data source index. |
void IliChartGraphic::addErrorSink | ( | IliErrorSink * | sink | ) |
Adds an error sink to this table gadget.
sink | The error sink to be added. |
Returns the column count.
dsi | The data source index. |
Returns a column name.
pos | The column position. |
dsi | The data source index. |
0
if the indexes are invalid. IliChartDataModel* IliChartGraphic::getDataModel | ( | ) | const |
Returns the data model.
const char* IliChartGraphic::getDataModelName | ( | ) | const |
Returns the data model name.
IliDataSource* IliChartGraphic::getDataSource | ( | IlInt | index = 0 | ) |
Returns a data source.
index | The data source index. |
0
otherwise. IlInt IliChartGraphic::getDataSourceCount | ( | ) | const |
Returns the data source count.
const char* IliChartGraphic::getDataSourceName | ( | IlInt | index = 0 | ) | const |
Returns a data source name.
index | The data source index. |
0
otherwise. IlvAbstractChartDisplayer* IliChartGraphic::getDefaultDisplayer | ( | ) | const |
Returns the default displayer.
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
.
IlInt IliChartGraphic::getModelPropertyCount | ( | IliChartModelType | type | ) | const |
Returns the model property count.
type | The model type. |
IlInt IliChartGraphic::getModelPropertyIndex | ( | IliChartModelType | type, |
const char * | name | ||
) | const |
Returns a model property index.
type | The model type. |
name | The property name. |
-1
. const char* IliChartGraphic::getModelPropertyName | ( | IliChartModelType | type, |
IlInt | index | ||
) | const |
Returns a model property name.
type | The model type. |
index | The property index. |
0
. const IliValue& IliChartGraphic::getModelPropertyValue | ( | IliChartModelType | type, |
const char * | name | ||
) | const |
Returns a model property value.
type | The model type. |
name | The property name. |
null
value. const IliValue& IliChartGraphic::getModelPropertyValue | ( | IliChartModelType | type, |
IlInt | index | ||
) | const |
Returns a model property value.
type | The model type. |
index | The property index. |
null
value otherwise. IliChartSeriesModel* IliChartGraphic::getSeriesModel | ( | ) | const |
Returns the series model.
const char* IliChartGraphic::getSeriesModelName | ( | ) | const |
Returns the series model name.
void IliChartGraphic::removeErrorSink | ( | IliErrorSink * | sink | ) |
Removes an error sink from this table gadget.
sink | The error sink to be removed. |
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.
errList | The error list. |
Sets the column count.
This function works fine when the data model allows this operation.
count | The column count. |
dsi | The data source index. |
Sets a column name.
name | The column name. |
pos | The column position. |
dsi | The data source index. |
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.
name | The model name. The predefined models are: IliChartRowDataModel, IliChartDSDataModel, IliChartColumnDataModel |
void IliChartGraphic::setDataSource | ( | IliDataSource * | ds, |
IlInt | index = 0 |
||
) |
Sets a data source.
ds | The data source. |
index | The data source index. |
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.
count | The data source count. |
void IliChartGraphic::setDataSourceName | ( | const char * | name, |
IlInt | index = 0 |
||
) |
Sets a data source name.
name | The data source name. |
index | The data source index. |
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.
disp | The default displayer. |
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.
reporter | The new error reporter. |
void IliChartGraphic::setModelPropertyValue | ( | IliChartModelType | type, |
const char * | name, | ||
const IliValue & | val | ||
) |
Sets a model property value.
type | The model type. |
name | The property name. |
val | The value. |
void IliChartGraphic::setModelPropertyValue | ( | IliChartModelType | type, |
IlInt | index, | ||
const IliValue & | val | ||
) |
Sets a model property value.
type | The model type. |
index | The property index. |
val | The value. |
void IliChartGraphic::setSeriesModelName | ( | const char * | name | ) |
Sets the series model name.
name | The model name. The predefined model is IliChartSeriesModel. |
© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.