public final class DataSourceSettings
extends com.softwarefx.server.data.DataConsumer
Provides customization on how the data is databound to the chart.
One of the greatest features in Chart FX is the ability to read or pass data from many sources, including text files, arrays, collections, XML files, etc. The DataSourceSettings
class provides the mechanism for configuring your data source and control how Chart FX stores and plots the data.
Constructor and Description |
---|
DataSourceSettings()
Constructs a newly allocated DataSourceSettings object
|
Modifier and Type | Method and Description |
---|---|
com.softwarefx.server.data.IDataSourceProvider |
getDataSource()
Gets or sets the source containing the values used to populate the chart.
|
FieldMapCollection |
getFields()
Description goes here
|
java.lang.String |
getLabelSeparator()
Gets or sets a value defining the label separator character used when concatenating labels.
|
java.util.EnumSet<DataSourceStyles> |
getStyle()
Controls how Chart FX plots the fields in the resultset.
|
void |
resetHasDataSource()
Set the property HasDataSource to its default value.
|
void |
resetLabelSeparator()
Set the property LabelSeparator to its default value.
|
void |
resetStyle()
Set the property Style to its default value.
|
void |
setDataSource(com.softwarefx.server.data.IDataSourceProvider value)
Gets or sets the source containing the values used to populate the chart.
|
void |
setLabelSeparator(java.lang.String value)
Gets or sets a value defining the label separator character used when concatenating labels.
|
void |
setStyle(java.util.EnumSet<DataSourceStyles> value)
Controls how Chart FX plots the fields in the resultset.
|
public DataSourceSettings()
public com.softwarefx.server.data.IDataSourceProvider getDataSource()
Gets or sets the source containing the values used to populate the chart.
Once the DataSource has been configured using this method, the chart is automatically bound to the data.
This method has a shortcut called setChartDataSource
method and defined in the Chart
class.
When reading data from text files, you will need to create the TextProvider
object and use that as the DataSource:
TextProvider txtProvider; txtProvider = new TextProvider(); chart1.getDataSourceSettings().setDataSource(new TextProvider("TextFile.txt")); txtProvider.Close();
When reading data from arrays, you will need to create the ListProvider
object and use that as the DataSource:
int[] values; values = new int[] {12, 15, 10, 7, 5}; ListProvider lstProvider; lstProvider = new ListProvider(((SfxNET.System.Collections.IList)SfxNET.System.Array.Set_System_Int32_Array(values))); chart1.getDataSourceSettings().setDataSource(lstProvider);
To assign the DataSource to the Chart
:
chart1.getDataSourceSettings().setDataSource(DataSet1.getTables());
public void setDataSource(com.softwarefx.server.data.IDataSourceProvider value)
Gets or sets the source containing the values used to populate the chart.
Once the DataSource has been configured using this method, the chart is automatically bound to the data.
This method has a shortcut called setChartDataSource
method and defined in the Chart
class.
When reading data from text files, you will need to create the TextProvider
object and use that as the DataSource:
TextProvider txtProvider; txtProvider = new TextProvider(); chart1.getDataSourceSettings().setDataSource(new TextProvider("TextFile.txt")); txtProvider.Close();
When reading data from arrays, you will need to create the ListProvider
object and use that as the DataSource:
int[] values; values = new int[] {12, 15, 10, 7, 5}; ListProvider lstProvider; lstProvider = new ListProvider(((SfxNET.System.Collections.IList)SfxNET.System.Array.Set_System_Int32_Array(values))); chart1.getDataSourceSettings().setDataSource(lstProvider);
To assign the DataSource to the Chart
:
chart1.getDataSourceSettings().setDataSource(DataSet1.getTables());
value
- public FieldMapCollection getFields()
public java.lang.String getLabelSeparator()
chart1.getDataSourceSettings().setLabelSeparator("~");
resetLabelSeparator
public void setLabelSeparator(java.lang.String value)
chart1.getDataSourceSettings().setLabelSeparator("~");
value
- resetLabelSeparator
public java.util.EnumSet<DataSourceStyles> getStyle()
java.util.EnumSet<DataSourceStyles> style = chart1.getDataSourceSettings().getStyle(); style.add(DataSourceStyles.DATES_AS_LABELS); chart1.getDataSourceSettings().setStyle(style);
resetStyle
public void setStyle(java.util.EnumSet<DataSourceStyles> value)
java.util.EnumSet<DataSourceStyles> style = chart1.getDataSourceSettings().getStyle(); style.add(DataSourceStyles.DATES_AS_LABELS); chart1.getDataSourceSettings().setStyle(style);
value
- resetStyle
public void resetHasDataSource()
public void resetLabelSeparator()
setLabelSeparator
public void resetStyle()
setStyle
2014 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.