Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class FieldMap

java.lang.Object
  extended by com.softwarefx.chartfx.server.FieldMap

public class FieldMap
extends Object

Allows you to bind of specific field of the ResultSet to the Chart.

The FieldMap Class  allows you to configure how a specific field of the ResultSet will databinded to the Chart. The FieldMap objects are stored in the FieldMapCollection which can be access through the DataSourceSettings.getFields()property of the DataSourceSettings Class .

Use the setName(java.lang.String) property to configure the name of the corresponding field in the ResultSet. If the setDisplayName(java.lang.String) property is not configured, the chart will display the value of the setName(java.lang.String) property. The setUsage(com.softwarefx.chartfx.server.FieldUsage) property is the most important property since it allows you to configure how the column will be databind. For example, the column can represent Y values, X values, and categorical labels which will be used by the x-axis.


Constructor Summary
FieldMap()
           
FieldMap(String fieldName, FieldUsage usage)
           
 
Method Summary
 String getDisplayName()
          Gets the DisplayName.
 String getName()
          Gets the Name.
 FieldUsage getUsage()
          Gets the Usage.
 void setDisplayName(String value)
          Sets the name of the field which will be displayed by the Chart.
 void setName(String value)
          Sets the name of the ResultSet's field related to the FieldMap.
 void setUsage(FieldUsage value)
          Sets the usage of the related column of the ResultSet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldMap

public FieldMap()

FieldMap

public FieldMap(String fieldName,
                FieldUsage usage)
Method Detail

getDisplayName

public String getDisplayName()

Gets the DisplayName. For more detail see setDisplayName(java.lang.String).


getName

public String getName()

Gets the Name. For more detail see setName(java.lang.String).


getUsage

public FieldUsage getUsage()

Gets the Usage. For more detail see setUsage(com.softwarefx.chartfx.server.FieldUsage).


setDisplayName

public void setDisplayName(String value)

Sets the name of the field which will be displayed by the Chart.

Remarks:
  • Sometimes, the setName(java.lang.String) of the field as defined in the ResultSet is not very explicit. This property allows you to modify how the field's name will be displayed by the Chart. Depending on the setUsage(com.softwarefx.chartfx.server.FieldUsage) of the field, the value of the DisplayName property can be rendered as a series legend, a axis title, a label, or a key label.

  • If this property is not initialized, the Chart wil render information based on the value of the setName(java.lang.String) property.

  • See Also:
    setName(java.lang.String), setUsage(com.softwarefx.chartfx.server.FieldUsage), DataSourceSettings.getFields(), DataSourceSettings

    setName

    public void setName(String value)

    Sets the name of the ResultSet's field related to the FieldMap.

    Remarks:
  • The name is defined in the ResultSet. For example, the following query:

    SELECT Field1, Field2

    FROM DataTable1

    will produce a ResutSet which two columns, called Field1 and Field2 respectivelly. The following piece of code will create a FieldMap object, add it to the FieldMapCollection, and associate the Field2 column to the FieldMap object:

    FieldMap fieldMap = new FieldMap();

    chart1.DataSourceSettings.Field.Add(fieldMap);

    fieldMap.Name = "Field2";

  • If the setDisplayName(java.lang.String) property is not initialized, the Chart wil render information based on the value of the Name property. Depending on the setUsage(com.softwarefx.chartfx.server.FieldUsage) of the field, the value of the Name property can be rendered as a series legend, a axis title, a label, or a key label.

  • See Also:
    setUsage(com.softwarefx.chartfx.server.FieldUsage), setDisplayName(java.lang.String), DataSourceSettings.getFields(), DataSourceSettings

    setUsage

    public void setUsage(FieldUsage value)

    Sets the usage of the related column of the ResultSet.

    Remarks:
  • The Usage property should be configured BEFORE a DataSource is bound to a chart.

  • This property is used to control how Chart FX will use individual fields of a resultset. Using the supported FieldUsage enumerations, developers my specify exactly how each column of data in a dataset should be used, if used at all.

  • This property is very useful when it is required to change the default rules Chart FX applies to retrieve data from a data control. The following are the default rules:

    1) Series Legends will be taken from the numerical field names.

    2) All numerical columns will be plotted as different series and all string and/or date columns will be plotted as point legends (joined by the '-' character).

    3) All string and numerical fields specified in the SELECT statement will be plot.

  • Sometimes, the setName(java.lang.String) of the field as defined in the ResultSet is not very explicit. The setDisplayName(java.lang.String) property allows you to modify how the field's name will be displayed by the Chart. Depending on the Usage of the field, the value of the setDisplayName(java.lang.String) property can be rendered as a series legend, a axis title, a label, or a key label.

  • See the documentation of the DataSourceSettings.getFields() property of the DataSourceSettings Class for more information.

  • See Also:
    setName(java.lang.String), setDisplayName(java.lang.String), DataSourceSettings.getFields(), DataSourceSettings

    http://www.softwarefx.com

    2008 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.