Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.java4less.rchart
Class ChartLoader

    java.lang.Object
      |
      +--com.java4less.rchart.ChartLoader

public class ChartLoader
extends java.lang.Object

    This class is used to create a chart using parameters instead or using the java api. For example:

    // create chart loader
    chartLoader loader=new chartLoader();
    // load paremeters
    loader.loadFromFile("file:///c:/data.txt",true);
    // change the parameters you what here, for example, provide new data to be plotted
    loader.setParameter("SERIE_DATA_1","1|34|54")
    // create chart
    Chart c=loader.build(false,false);

    or  you also change the chart once has been created:

    // create chart loader
    ChartLoader loader=new ChartLoader();
    // load paremeters
    loader.loadFromFile("file:///c:/data.txt",true);
    // create chart
    Chart c=loader.build(false,false);
    // change first serie in plotter 0
    c.plotters[0].replaceSerie(0,yourDataSerie);

Field Summary
`java.lang.String` | `fileEncoding` file encoding of the data file
`Chart` | `gChart` last created chart
`boolean` | `paintDirect` activate double buffering
`int` | `pnumSeries` number of loaded series
`boolean` | `promptForParameters` set to "true" only by RChart Visual Builder, in order to prompt for parameters in SQL statements
`DataSerie[]` | `pSeries` loaded series
`java.lang.String[]` | `pSeriesNames` names of loaded series

Constructor Summary
`ChartLoader()` to be used by java applications
`ChartLoader(java.applet.Applet ap)` to be used by the applet

Method Summary
`Chart` | `build(boolean clear, boolean reReadFile)` create chart.
`Chart` | `build(Chart currentChart, boolean clear, boolean reReadFile)` rebuild a chart chart.
`void` | `clearParams()` clear parameters
`static ChartColor` | `convertColor(java.lang.String s)`
`boolean` | `getBooleanParam(java.lang.String Param, boolean def)` get boolean parameter
`java.lang.Double` | `getDoubleParam(java.lang.String Param, java.lang.Double def)` get double parameter
`java.lang.String` | `getLoadedParameter(int i)` get parameter name
`int` | `getLoadedParametersCount()` number of loaded parameters
`java.lang.String` | `getLoadedValue(int i)` get value for parameter
`java.lang.String` | `getParameter(java.lang.String key, java.lang.String def)` Get a string parameter value
`void` | `loadFromFile(java.lang.String psFile, boolean Clear)` load paramteres from file.
`void` | `loadFromFile(java.lang.String psFile, boolean Clear, java.lang.String userpsw)` load paramteres from file.
`void` | `setDataFile(java.lang.String df)` set data file
`void` | `setParameter(java.lang.String param, java.lang.String value)`
`void` | `setSQLParameter(java.lang.String param, java.lang.String value)` sets a value for a parameter.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fileEncoding

    public java.lang.String fileEncoding

  file encoding of the data file

### gChart

    public Chart gChart

  last created chart

### paintDirect

    public boolean paintDirect

  activate double buffering

### pSeriesNames

    public java.lang.String[] pSeriesNames

  names of loaded series

### pSeries

    public DataSerie[] pSeries

  loaded series

### pnumSeries

    public int pnumSeries

  number of loaded series

### promptForParameters

    public boolean promptForParameters

  set to "true" only by RChart Visual Builder, in order to prompt for parameters in SQL statements

Constructor Detail

### ChartLoader

    public ChartLoader(java.applet.Applet ap)

  to be used by the applet

### ChartLoader

    public ChartLoader()

  to be used by java applications

Method Detail

### setSQLParameter

    public void setSQLParameter(java.lang.String param,
                                java.lang.String value)

  sets a value for a parameter. SQL stattments may ccontain parameterrs in the form of [%paramname]. For example: "Select * from table where id=[%parameter1]". Use myRJDBCSource.setParameter("Parameter1" ,value) before you run the report.

### getBooleanParam

    public boolean getBooleanParam(java.lang.String Param,
                                   boolean def)

  get boolean parameter

  Parameters:
    `Param` - name of the parameter
    `def` - default value
  Returns:

### getDoubleParam

    public java.lang.Double getDoubleParam(java.lang.String Param,
                                           java.lang.Double def)

  get double parameter

  Parameters:
    `Param` - name of the parameter
    `def` - default value
  Returns:

### getParameter

    public java.lang.String getParameter(java.lang.String key,
                                         java.lang.String def)

  Get a string parameter value

### convertColor

    public static ChartColor convertColor(java.lang.String s)

### getLoadedParametersCount

    public int getLoadedParametersCount()

  number of loaded parameters

### getLoadedParameter

    public java.lang.String getLoadedParameter(int i)

  get parameter name

### getLoadedValue

    public java.lang.String getLoadedValue(int i)

  get value for parameter

### setDataFile

    public void setDataFile(java.lang.String df)

  set data file

### build

    public Chart build(boolean clear,
                       boolean reReadFile)

  create chart. If Cleare=true all parameters will be cleared. If reReadFile=true, the original datafile will be reloaded

### build

    public Chart build(Chart currentChart,
                       boolean clear,
                       boolean reReadFile)

  rebuild a chart chart. If Clear=true all parameters will be cleared. If reReadFile=true, the original datafile will be reloaded

### clearParams

    public void clearParams()

  clear parameters

### loadFromFile

    public void loadFromFile(java.lang.String psFile,
                             boolean Clear,
                             java.lang.String userpsw)

  load paramteres from file. If clear=true, previous parameters will be cleared. Use User and password to request the file with http protocol

### loadFromFile

    public void loadFromFile(java.lang.String psFile,
                             boolean Clear)

  load paramteres from file. If clear=true, previous parameters will be cleared

### setParameter

    public void setParameter(java.lang.String param,
                             java.lang.String value)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD