ReadJAVAScriptChartFile(); Read JAVA Script Chart File |
|
WriteJAVAScriptChartFile(); Write JAVA Script Chart File |
This function is used to read a JAVA Script file into PGSDK. The JAVA script file must have been generated by the Three |D| Graphics Perspective for Java product. |
|||||
Syntax: |
PUBLIC INT16 |
||||
Input: |
pGraph: Pointer to the graph object created by AllocGraphPtr(). The graph object must be allocated before the ReadJAVAScriptChartFile() function is called. |
||||
pDE: Pointer to a draw environment created by AllocDrawEnvPtr() or NULL. If NULL is used, functionality to set the draw environment background rectangle will not be operational. |
|||||
pszFullPathName; Full path name identifying the name and location of the Java script file to read. It must be "C" style string containing the full pathname of the Javascript file to read from. |
|||||
Return: |
INT16; |
||||
kREADJAVASCRIPTFILE_ERRORNONE |
0 |
Success |
|||
kREADJAVASCRIPTFILE_ERROROPENINGFILE |
100 |
Error opening file |
|||
kREADJAVASCRIPTFILE_ERRORFEATURENOTENABLED |
200 |
Feature not enabled |
|||
kREADJAVASCRIPTFILE_ERRORFEATURENOTENABLED indicates the current version of PGSDK does not support the Read/Write to JAVA script feature. This feature is enabled based on specific customer request. Contact Three |D| Graphics for details. |
|||||
Example: |
// CGraph::LoadChartFromJAVAScriptFile |
||||
Notes: |
1. |
See the Perspective for Java Programmer's Manual for details about each Attribute and corresponding Javascript "set" function. |
|||
2. |
See the PGSDK-to-JavaScript Cross-Reference the PGSDK Programmer's Manual for a complete list of PGSDK objects, attributes, and API functions that can be translated to Java script. |
||||
3. |
The following JavaScript commands are translated by ReadJAVAScriptChartFile(): |
||||
> |
setAutofit |
||||
> |
setAxisAssignment |
||||
> |
setBorderColor |
||||
> |
setColorMode |
||||
> |
setData, setDataRange |
||||
> |
setDataTextDisplay, setDataTextFormat, & setDataTextPosition |
||||
> |
setDepthAngle, setDepthRadius |
||||
> |
setDisplay |
||||
> |
setDisplay3DFloor, setDisplay3DLeftWall, & setDisplay3DRightWall |
||||
> |
setDisplayBarAsPictograph |
||||
> |
setDualAxisLineDisplay |
||||
> |
setFillColor |
||||
> |
setFontName, setFontSizeVC, setFontStyle |
||||
> |
setFootnoteDisplay, setFootnoteString |
||||
> |
setFrameDisplay |
||||
> |
setGraphType |
||||
> |
setGroupLabel |
||||
> |
setGrid3DFloorDisplayX, setGrid3DFloorDisplayZ |
||||
> |
setGrid3DLeftWallDisplayY, setGrid3DLeftWallDisplayZ |
||||
> |
setGrid3DRightWallDisplayX, setGrid3DRightWallDisplayY |
||||
> |
setGrid3DRiserDisplayX, setGrid3DRiserDisplayY, setGrid3DRiserDisplayZ |
||||
> |
setGroupLabelArray |
||||
> |
setLegendAutomatic, setLegendDisplay, setLegendRect |
||||
> |
setLineWidth |
||||
> |
setMarkerShape, setMarkerSize |
||||
> |
setO1AxisLineDisplay, setO1AxisSide, setO1LabelAutofit, setO1LabelDisplay, setO1LabelStagger, setO1MajorGridDisplay, setO1MinorGridDisplay |
||||
> |
setO2LabelAutofit, setO2LabelDisplay |
||||
> |
setPieDepth, setPieFeelerTextDisplay, setPieRingSize, setPieRingTotalDisplay, setPieRingTotalFormat, setPieRotate, setPieSliceDelete, setPiesPerRow, setPieTilt |
||||
> |
setQuadrantLineCountX, setQuadrantLineCountY, setQuadrantLineValueX, setQuadrantLineValueY |
||||
> |
setRect |
||||
> |
setReverseSeries |
||||
> |
setRiser3DThicknessY, setRiserBarGroupSpacing, setRiserWidth |
||||
> |
setScaleFromZero |
||||
> |
setSeriesAreRows, setSeriesLabel, setSeriesLabelArray |
||||
> |
setSquareMarkers |
||||
> |
setStockCloseTicksDisplay, setStockOpenTicksDisplay |
||||
> |
setSubtitleDisplay, setSubtitleString |
||||
> |
setTextString, setTextRotation |
||||
> |
setTitleDisplay, setTitleString |
||||
> |
setTransparentBorderColor, setTransparentFillColor |
||||
> |
setX1AxisDescending, setX1AxisLineDisplay, setX1AxisSide, setX1LabelAutofit, setX1LabelDisplay, setX1LabelFormat, setX1LabelStagger, setX1LogScale, setX1MajorGridDisplay, setX1MajorGridStepAuto, setX1MajorGridStyle, setX1MinorGridDisplay, setX1MinorGridStepAuto, setX1MinorGridStyle, setX1MustIncludeZero, setX1OffScaleDisplay, setX1ScaleMax, setX1ScaleMaxAuto, setX1ScaleMin, setX1ScaleMinAuto, setX1TitleDisplay, setX1TitleString, setX1ZeroLineDisplay |
||||
> |
setY1AxisDescending, setY1AxisLineDisplay, setY1AxisSide, setY1LabelAutofit, setY1LabelDisplay, setY1LabelFormat, setY1LabelStagger, setY1LogScale, setY1MajorGridDisplay, setY1MajorGridStepAuto, setY1MajorGridStyle, setY1MinorGridDisplay, setY1MinorGridStepAuto, setY1MinorGridStyle, setY1MustIncludeZero, setY1OffScaleDisplay, setY1ScaleMax, setY1ScaleMaxAuto, setY1ScaleMin, setY1ScaleMinAuto, setY1TitleDisplay, setY1TitleString, setY1ZeroLineDisplay |
||||
> |
setY2AxisDescending, setY2AxisLineDisplay, setY2AxisSide, setY2LabelAutofit, setY2LabelDisplay, setY2LabelFormat, setY2LabelStagger, setY2LogScale, setY2MajorGridDisplay, setY2MajorGridStepAuto, setY2MajorGridStyle, setY2MinorGridDisplay, setY2MinorGridStepAuto, setY2MinorGridStyle, setY2MustIncludeZero, setY2OffScaleDisplay, setY2ScaleMax, setY2ScaleMaxAuto, setY2ScaleMin, setY2ScaleMinAuto, setY2TitleDisplay, setY2TitleString |
||||
4. |
The following JavaScript data objects are translated by ReadJAVAScriptChartFile(): |
||||
> |
getChartBackground |
||||
> |
getCubeFloor, getCubeLeftWall, getCubeRightWall |
||||
> |
getDataText, getFootnote, getFrame, getGroup |
||||
> |
getLegendArea, getLegendLine, getLegendMarker, getLegendText |
||||
> |
getO1MajorGrid, getO2MajorGrid, getO1Label, getO2Axis |
||||
> |
getPieLabel |
||||
> |
getQuadrantLine |
||||
> |
getSeries |
||||
> |
getSubtitle, getTitle |
||||
> |
getX1Title, getY1Axis, getY1Label, getY1MajorGrid, getY1Title |
||||
> |
getY2Label, getY2Title |
||||
Also See: |
|||||
This function saves a graph as JavaScript code that is compatible with the Three |D| Graphics Perspective for Java product. This function can be used to save a chart from the PGSDK into a JavaScript file. This JavaScript file can be loaded in Perspective for Java with or without Chart Data. An option is present to output a JavaScript file as an HTML file to be viewed by a network browser. |
|||||
Syntax: |
PUBLIC INT16 |
||||
Input: |
pGraph: Pointer to the graph object created by AllocGraphPtr() |
||||
pszOutFullPathName; Full path name identifying the name and location of the Java script file to write. |
|||||
bExportData; True/False flag to export data or just the graph "Look". |
|||||
TRUE = |
Export Data and Graph |
||||
FALSE = |
Export graph only |
||||
This flag is normally turned off (FALSE) since the "Look" of the graph is most important. Data is denoted by any of the following. |
|||||
> |
Title, SubTitle, Footnote |
||||
> |
Y1Title, Y2Title, X1Title |
||||
> |
SeriesGroupLabels |
||||
> |
Data (example, setData(0,1,2.6) where 0 is the series and 1 is the group and 2.6 is the value.) |
||||
> |
DataRange |
||||
bOutputAsHTML; True/False |
|||||
TRUE = |
Output in HTML format with Header/Trailer |
||||
FALSE = |
Output in Java script format only |
||||
This flag is useful to save a chart into an HTML file to be viewed by a network browser such as Netscape Navigator or Internet Explorer. Note that Perspective for Java must be setup correctly in the directory where the HTML file exists in order for a chart to properly load. |
|||||
Return: |
INT16; |
||||
kWRITEJAVASCRIPTFILE_ERRORNONE |
0 |
Success |
|||
kWRITEJAVASCRIPTFILE_ERROROPENINGFILE |
100 |
Error opening file |
|||
kWRITEJAVASCRIPTFILE_ERRORFEATURENOTENABLED |
200 |
Feature not enabled |
|||
kREADJAVASCRIPTFILE_ERRORFEATURENOTENABLED indicates the current version of PGSDK does not support the Read/Write to JAVA script feature. This feature is enabled based on specific customer request. Contact Three |D| Graphics for details. |
|||||
Example: |
int CGraph::TestJavaScriptExporter( |
||||
The following Perspective for Java functions are an example output of an area chart from this function with bExportData enabled: |
|||||
setGraphType(32); |
|||||
Notes: |
1. |
Any changes to InitLook in Perspective.java may affect the functionality of this code. There are basic assumptions of attributes being set to states prior to inporting a file. |
|||
2. |
See the Perspective for Java Programmer's Manual for details about each Attribute and corresponding Javascript "set" function. |
||||
3. |
See the PGSDK-to-JavaScript Cross-Reference in the PGSDK Programmer's Manual for a complete list of PGSDK objects, attributes, and API functions that can be translated to Java script. |
||||
Also See: |