Hide Comments
Hide Comments

Comments (0)

The TRSDBPathChart component is the database aware version of the TRSPathChart . The TRSPathChart component is a TRSCustomChart descendant that represents a path chart. The path chart displays chart values ( TRSPathChartValue) as irregular shapes defined by paths representing groups of connected curves and lines. Every value in the chart has its own path and maintains the coordinates of geometric shapes in world coordinate space in an array of path points. Each saved point has a specific type, to identify the primitive shape it is defining. Complex shapes of a TPathData are composed of a sequence of primitive shapes like lines and curves.

The values for the chart are created by reading a dataset (database table or query) specified with the    DataSource property. Each record in the dataset provides one value for the chart, where the DataFieldX property specifies the field to use for the X property of the Value, the DataFieldY property specifies the Y property of the Value, etc.

alert_cautionImportant Note

Unlike other charts, the path chart fetches data from one record only and creates one value only; it is assumed that one field of the record will hold the entire path.

PathChartExample

In addition to using code to define your path shape, each value has a Data property which accepts a string defining the shape. This string uses the same format as the TPath FMX component, which is also the same format as the paths defined in SVG files. To show SVG shapes, copy the paths to chart values.

Namespace: RSDBCharts

expandingInheritance Hierarchy

TRSPathChart
  RSDBCharts.TRSDBPathChart
 

expandingSyntax

Delphi

type 
  TRSDBPathChart = class(TRSPathChart) 
  end;  
 

expandingConstructors

 

Name

Description

public destructor

Destroy

Represents the destructor of the TRSDBPathChart class.

Top

expandingProperties

 

Name

Description

published property

DataFieldCaption

Specifies the field name whose value is used for the  Caption property of the data-aware chart values. Use DataFieldCaption to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The DataSource property of the chart specifies the dataset that contains the data field.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g., DataFieldX specifies the field for the X property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

published property

DataFieldHeight

Specifies the field name whose value is used for the  Height property of the data-aware chart values. Use DataFieldHeight to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The DataSource property of the chart specifies the dataset that contains the data field. The field object needs to be convertable to a floating-point value.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g.,     DataFieldCaption specifies the field for the  Caption property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

published property

DataFieldPath

Specifies the field name whose value is used for the  Data property of the data-aware chart values. Use DataFieldData to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The DataSource property of the chart specifies the dataset that contains the data field. The field object needs to be convertable to a floating-point value.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g.,     DataFieldCaption specifies the field for the  Caption property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

published property

DataFieldWidth

Specifies the field name whose value is used for the  Width property of the data-aware chart values. Use DataFieldWidth to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The DataSource property of the chart specifies the dataset that contains the data field. The field object needs to be convertable to a floating-point value.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g.,     DataFieldCaption specifies the field for the  Caption property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

published property

DataFieldX

Specifies the field name whose value is used for the  X property of the data-aware chart values. Use DataFieldX to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The     DataSource property of the chart specifies the dataset that contains the data field. The field object needs to be convertable to a floating-point value.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g.,     DataFieldCaption specifies the field for the  Caption property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

published property

DataFieldY

Specifies the field name whose value is used for the  Y property of the data-aware chart values. Use DataFieldY to bind each data-aware chart value to a field object in the dataset. To fully specify a database field, both the dataset and the field within the dataset must be defined. The     DataSource property of the chart specifies the dataset that contains the data field. The field object needs to be convertable to a floating-point value.

Use the other DataFieldXXX properties to specify the field names for other properties of the chart value (e.g.,     DataFieldCaption specifies the field for the  Caption property of the value). For chart value properties that don't have a corresponding DataFieldXXX property, you can use the     OnGetChartValue event to change their values.
 

protected property

DataLink

Returns the data link that manages the mapping of chart values to field values

published property

DataSource

Identifies the link to the dataset where the data-aware chart finds its data. Use the DataSource property to set the TDataSource object where the data-aware chart should fetch its data. Each record of the dataset corresponds to one chart value item in the chart's collection.

The DataFieldXXX properties specifies which TField objects of the dataset are used to populate the corresponding properties in the chart value. Any chart value property that doesn't have a TField linked to it uses its defaults. However, you can use the     OnGetChartValue event to change any aspect of a chart value after its field values have been fetched from the dataset.
 

published property

OnGetChartValue

Occurs when the data-aware chart creates a new chart value based on the     DataSource. For each record in the dataset, the data-aware chart creates a chart value, populates it based on DataFieldXXX fields and then call this event.

Write an OnGetChartValue event handler to take action when a chart value is created by a record, either to update other information based on the chart value or to modify a chart value for each record before they are displayed in the chart.

Top

expandingMethods

 

Name

Description

protected method

GetChartValue(TObject,TRSChartValue)

Represents method GetChartValue(TObject,TRSChartValue).

protected method

InitializeChangeEvents

Represents method InitializeChangeEvents.

protected method

InitializeChart

Represents method InitializeChart.

Top

expandingExamples

To display a chart, you drop the component on a form and optionally connect its Panel property to the TRSChartPanel component where you want it to be displayed. Next, connect the DataSource property to the a TDataSource component on your form. Use the DataFieldXXX properties to connect a field to the corresponding XXX property of the chart value.

The following example links a dataset and some fields to the db-aware chart:

Delphi

begin
   RSDBPathChart1.DataSource := DataSource1;
   RSDBPathChart1.DataFieldCaption := DataSource1.DataSet.FieldByName('COMPANY');
   RSDBPathChart1.DataFieldPath := DataSource1.DataSet.FieldByName('LOGO_PATH');
 end;

expandingSee Also

Reference

TRSChartPanel
TRSPathChart

Comments (0)

RiverSoftAVG Charting Component Suite (RCCS) © 2005-2015, Thomas G. Grubb