|
Chart FX for Java 6.5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SoftwareFX.ChartFX.XMLDataProvider
public final class XMLDataProvider
Provides access to the Chart's XML Data Provider object.
XML has proven to be a very dynamic and flexible means of data storage. Chart FX has been developed with this in mind and includes an XmlDataProvider. Using the XmlDataProvider, you can pass XML data directly to your charts for display.
When passing the data using the XML data provider, the data is passed as columns and rows, the same as with a table. The following rules apply:
a) There must be a special tag indicating that the information enclosed is the column's definition. By default this tag is named <COLUMNS>. Each column will need a separate COLUMN tag. The format is:
<COLUMNS>
<COLUMN NAME="Column1_Name" TYPE="Column1_Type" DESCRIPTION="Column1_Desciption" />
<COLUMN NAME="ColumnN_Name" TYPE="ColumnN_Type" DESCRIPTION="ColumnN_Desciption" />
</COLUMNS>
The Description attribute is optional. If it is included, it will be used as a Series or Value legend. If it is not present, the configured Column Name will be assigned as a Series or Value legend instead.
b) As you can see above, each column name is configured with a type. The attribute Type is case sensitive, and the supported data types are String, Integer, Double, Short, Float, Boolean, Byte and Date.
c) Every row is then defined using the following format:
<ROW Column1_Name="Value" ... ColumnN_Name="Value"/>
Constructor Summary | |
---|---|
XMLDataProvider()
|
Method Summary | |
---|---|
java.util.Locale |
getCulture()
Gets the Culture. |
java.lang.String |
getDateFormat()
Gets the DateFormat. |
boolean |
isRowValueTag()
Gets the RowValueTag. |
void |
load(java.io.InputStream stream)
Specifies the path to the XML file. |
void |
load(java.lang.String filename)
Specifies the path to the XML file. |
void |
loadXML(java.lang.String xmlString)
Used to pass the XML as a string. |
void |
setCulture(java.util.Locale locale)
Allows you to localize data for a specific language and region. |
void |
setDateFormat(java.lang.String dateFormat)
Allows you to customize the default date format for the Chart FX XmlDataProvider. |
void |
setRowValueTag(boolean rowValueTag)
Gets or sets a value indicating if the xml will include a value tag in rows. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLDataProvider()
Method Detail |
---|
public java.util.Locale getCulture()
Gets the Culture. For more detail see setCulture(java.util.Locale)
.
public java.lang.String getDateFormat()
Gets the DateFormat. For more detail see setDateFormat(java.lang.String)
.
public boolean isRowValueTag()
Gets the RowValueTag. For more detail see setRowValueTag(boolean)
.
public void load(java.lang.String filename)
Specifies the path to the XML file.
You can pass the xml data parameter as either a string or stream using this method.
When passing the data using the XML data provider, the data is passed as columns and rows, the same as with a table. The following rules apply:
a) There must be a special tag indicating that the information enclosed is the column's definition. By default this tag is named <COLUMNS>. Each column will need a separate COLUMN tag. The format is:
<COLUMNS>
<COLUMN NAME="Column1_Name" TYPE="Column1_Type" DESCRIPTION="Column1_Desciption" />
<COLUMN NAME="ColumnN_Name" TYPE="ColumnN_Type" DESCRIPTION="ColumnN_Desciption" />
</COLUMNS>
The Description attribute is optional. If it is included, it will be used as a Series or Value legend. If it is not present, the configured Column Name will be assigned as a Series or Value legend instead.
b) As you can see above, each column name is configured with a type. The attribute Type is case sensitive, and the supported data types are String, Integer, Double, Short, Float, Boolean, Byte and Date.
c) Every row is then defined using the following format:
<ROW Column1_Name="Value" ... ColumnN_Name="Value"/>
filename
- setCulture(java.util.Locale)
,
setDateFormat(java.lang.String)
,
loadXML(java.lang.String)
public void load(java.io.InputStream stream)
Specifies the path to the XML file.
You can pass the xml data parameter as either a string or stream using this method.
When passing the data using the XML data provider, the data is passed as columns and rows, the same as with a table. The following rules apply:
a) There must be a special tag indicating that the information enclosed is the column's definition. By default this tag is named <COLUMNS>. Each column will need a separate COLUMN tag. The format is:
<COLUMNS>
<COLUMN NAME="Column1_Name" TYPE="Column1_Type" DESCRIPTION="Column1_Desciption" />
<COLUMN NAME="ColumnN_Name" TYPE="ColumnN_Type" DESCRIPTION="ColumnN_Desciption" />
</COLUMNS>
The Description attribute is optional. If it is included, it will be used as a Series or Value legend. If it is not present, the configured Column Name will be assigned as a Series or Value legend instead.
b) As you can see above, each column name is configured with a type. The attribute Type is case sensitive, and the supported data types are String, Integer, Double, Short, Float, Boolean, Byte and Date.
c) Every row is then defined using the following format:
<ROW Column1_Name="Value" ... ColumnN_Name="Value"/>
stream
- Stream as System.IOsetCulture(java.util.Locale)
,
setDateFormat(java.lang.String)
,
loadXML(java.lang.String)
public void loadXML(java.lang.String xmlString)
Used to pass the XML as a string.
This method allows you to concatenate the contents of an xml file into one string and pass that string as the XML data.
When passing the data using the XML data provider, the data is passed as columns and rows, the same as with a table. The following rules apply:
a) There must be a special tag indicating that the information enclosed is the column's definition. By default this tag is named <COLUMNS>. Each column will need a separate COLUMN tag. The format is:
<COLUMNS>
<COLUMN NAME="Column1_Name" TYPE="Column1_Type" DESCRIPTION="Column1_Desciption" />
<COLUMN NAME="ColumnN_Name" TYPE="ColumnN_Type" DESCRIPTION="ColumnN_Desciption" />
</COLUMNS>
The Description attribute is optional. If it is included, it will be used as a Series or Value legend. If it is not present, the configured Column Name will be assigned as a Series or Value legend instead.
b) As you can see above, each column name is configured with a type. The attribute Type is case sensitive, and the supported data types are String, Integer, Double, Short, Float, Boolean, Byte and Date.
c) Every row is then defined using the following format:
<ROW Column1_Name="Value" ... ColumnN_Name="Value"/>
xmlString
- setCulture(java.util.Locale)
,
setDateFormat(java.lang.String)
,
load(java.lang.String)
public void setCulture(java.util.Locale locale)
Allows you to localize data for a specific language and region.
Culture attributes set with this property will effect only selected data, to set localization attributes for the entire chart, please use the ChartCore.setCulture(java.lang.String)
property of the Chart
class.
If no attributes are set using this property or the Chart class ChartCore.setCulture(java.lang.String)
property, then Chart FX inherits the system culture.
When setting this property, you may need the Languaje Code and/or Country Code constants for the desired culture. For more information, please refer to the java.util.Locale documentation.
Example:
XMLDataProvider xmldp = new XMLDataProvider("myxmlfile.xml");
xmldp.setCulture("es-ES");
ChartCore.setCulture(java.lang.String)
,
ValueFormat.setCulture(java.lang.String)
,
Chart
,
ValueFormat
public void setDateFormat(java.lang.String dateFormat)
Allows you to customize the default date format for the Chart FX XmlDataProvider.
When dates are included in the XML file and are in a format other than "mm/dd/yyyy" (which is the default format), the DateFormat property must be used to create a mask that will instruct Chart FX how to understand the values.
TextProvider.setDateFormat(java.lang.String)
,
TextProvider
public void setRowValueTag(boolean rowValueTag)
Gets or sets a value indicating if the xml will include a value tag in rows.
Set this property to True if your XML file includes the Value tag in each row of data.
setDateFormat(java.lang.String)
,
setCulture(java.util.Locale)
,
load(java.lang.String)
,
loadXML(java.lang.String)
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |