EqapSurfaceChart (version 2.0, 20.12.2011)
The EqapSurfaceChart is a part of EqapPackage and is a functional component designed to create 3D-surfaces (based on standard TChart). The EqapSurfaceChart implements data loading from standard TChart series or from data arrays, makes full-functional managing the 3D-appearance of the diagram area and 3D-surfaces, creates a 3D-surface from the pre-existing set of 2D-series.
1. Appearance
The EqapSurfaceChart (Fig. 1) contains the control panel with buttons (a), the main area to draw 3D-surfaces (b) and the tab panel (c). The latter has tabs to edit 3D-visualization parameters of diagram ("Chart visi options"), visualization parameters of 3D-surfaces ("Surface visi options"), building parameters of 3D-surfaces ("Surface calc options") and to manage data ("Data").
Fig. 1. The EqapSurfaceChart component
The control panel of EqapSurfaceChart has quick operation buttons:
- to build 3D-surfaces on the basis of existing data set;
- to load data set from a file (*.3dc file);
- to save data set to file (*.3dc file);
- to export the current content of 3D-diagram to a picture file (*.bmp file);
- to export the current data set to MS Excel 2000 or 2003 (*.xls file);
- to clear completely the current content of 3D-diagram and data set;
- to switch ON/OFF the full-screen mode (in the component window boundaries);
- to go to the tab with additional settings (3D-diagram background color, title and font, axes titles and fonts;
Use mouse to change the position and 3D-view of main area where 3D-surfaces are drawn (Fig. 1, b). Just click left button of the mouse and, holding the button pressed, move it over the component - this caused the change of position and 3D-view of the 3D-diagram. Use mouse wheel to change the diagram zoom.
The 3D-visualization parameters and basic elements of the diagram might be edited in "Chart visi options" tab (Fig. 2). This tab contains the fields to edit 3D-view of the diagram ("Zoom", "Elevation", "Rotation", "Perspective"), background color, diagram title and font of the title ("Chart color", "Show title" flag, the field to type title text, the button for font selection), titles of X-Y-Z axes ("X-axis title", "Y-axis title", "Z-axis title"), minimal and maximal values of Z-axis which should be set manually ("Z minimum" and "Z maximum"). Except two last parameters, the change of any parameter immediately results in the corresponding change of 3D-diagram.
Fig. 2. EqapSurfaceChart 3D-visualization parameters tab ("Chart visi options")
The additional parameters used to visualize the 3D-diagram are collected in "Additional chart visi options" tab (Fig. 3) which appears if the flag "Show additional chart options" (located on the control panel) is selected (see Fig. 1); switching off the flag displays "Chart visi options" tab. The left-hand list on Fig. 3 contains "Chart", "X axis", "Y axis" and "Z axis"; click to any item to display specific parameters of the corresponding 3D-diagram element. The "Chart" item contains the fields to set margins ("Left margin", "Right margin", "Top margin", "Bottom margin"), and "Fixed axes" flag. This flag determines if it is necessary to calculate real minimal and maximal values of Y-axis, that is using existing 3D-surfaces (the flag is turned off), or the minimal and maximal values of Y-axis are calculated with some indention for better visual representation (the flag is turned on).
Fig. 3. The tab of additional parameters used for visual representation of 3D-diagram ("Additional chart visi options") of EqapSurfaceChart. The field of diagram parameters is shown ("Chart" item).
The "X axis", "Y axis", and "Z axis" contains (similar) fields (see Fig. 4) to set the color and width of an axis line ("Axis color" and "Axis width"), title parameters ("Title font", "Title angle", "Title interval"), axis labels ("Show labels" flag, "Label font", "Label interval"), color and line shape of an axis grid ("Show grid" flag, "Grid color", "Grid width", "Grid style"). If "Show labels" flag is off, the corresponding field are inactive. If "Show grid" flag is off, the corresponding fields become inactive, too. The change of any parameter causes immediate change of the 3D-diagram view.
Fig. 4. The tab of additional parameters of the 3D-diagram visualization ("Additional chart visi options") of EqapSurfaceChart. The field of additional parameters of X-axis is shown; each axis has own settings.
The visualization parameters of 3D-surface are presented in "Surface visi options" tab (Fig. 5). This tab has a list of pseudo-surfaces (the surfaces are calculated on the basis of existing data set, see below) located in the left side; select any of them to display the parameters of 3D-visualization of selected surface. The "Series width" field set the line width for the single plot. The "Series border" field specifies if it is necessary to display the visual boundaries of any point of a plot. "3D dark" flag sets whether shadow should be displayed or not. The change of any of the parameters causes immediately the change of a pseudo 3D-surface. "Multicolored" flag determines whether a gradient color scheme should be used if a 3D-surface is created. If the flag is off, 3D-surface color is set in "Surface color" field (single color is used). If the flag is on, a 3D-surface color is converted from the corresponding visual element. "Points only" flag determines whether real points should be drawn only or with interpolated points between. If you turn the flag on, the corresponding fields become active (the number of points added in horizontal and vertical direction, as well as their view). Note that pseudo 3D-surface will not be updated automatically after changing of color or gradient color scheme, as well as after changing of the type of plotting points. To cause the corresponding update, reuse the command to create pseudo 3D-surface (e.g., click the leftmost button on the control panel).
Fig. 5. The tab of 3D-surface visualization ("Surface visi options") of EqapSurfaceChart
The parameter of pseudo 3D-surface calculation are presented in "Surface calc options" tab (Fig. 6). The tab also contains a list of pseudo 3D-surfaces used (the three-dimensional plots are based on raw data sets loaded into the component). Selection of a pseudo 3D-surface from the list displays the corresponding fields used to calculate this 3D-surface.
Fig. 6. The tab of parameters used to calculate a pseudo 3D-surface ("Surface calc options") ofEqapSurfaceChart
2. Properties and events
The EqapSurfaceChart inherits properties and events of TPanel except those used for text appearance (Alignment, AutoSize, Caption, Font etc.), and has own properties and events:
Properties
Options: TEqapSurfaceChartOptions - component options. Contains flag: escoShowPictureAfterSaving (determines whether a picture file should be opened after 3D-diagram exporting to the file).
VisiOptions: TChartVisiOptions - visual options of 3D-diagram. Contains subproperties BackgroundColor: TColor (diagram background color), Elevation: integer (elevation of 3D-diagram relatively Y-axis), FixedAxes: boolean (the flag determines whether exact minimal and maximal values of Y-axis should be calculated using corresponding values of series or the minimal and maximal values are calculated with extra space between the diagram edges), MarginBottom: integer (the margin between bottom edge of 3D-diagram and bottom edge of area used to display this diagram), MarginLeft: integer (the margin between left edge of 3D-diagram and left edge of area used to display this diagram), MarginRight: integer (the margin between right edge of 3D-diagram and right edge of area used to display this diagram), MarginTop: integer (the margin between top edge of 3D-diagram and top edge of area used to display this diagram), Perspective: integer (the degree of perspective view of 3D-diagram), Rotation: integer (the rotation of 3D-diagram relatively Z-axis), SeriesWidth: integer (the width of single 3D-plot line), ShowTitle: boolean (the flag determines whether 3D-diagram title should be displayed), Title: string (the title of 3D-diagram), TitleFont: TFont (font settings used to display 3D-diagram title), ZMaximum: integer (maximal value of Z-axis), ZMinimum: integer (minimal value of Z-axis), Zoom: integer (the zooming degree of area used to plotting 3D-diagram). Subproperties are XAxis, YAxis, ZAxis: TChartAxisVisiOptions (each contain visual parameters of the corresponding axis of 3D-diagram).
Events
OnBuild: TNotifyEvent - event arises after completion of 3D-surfaces calculation (based on raw data sets).
OnClear: TNotifyEvent - event arises after clearing the 3D-diagram area and deleting all raw data sets.
OnLoadFromFile: TNotifyEvent - event arises after loading the data set(s) and visual parameters of 3D-diagram from a *.3dc file.
OnSaveToFile: TNotifyEvent - event arises after saving the data and visual parameters to a *.3dc file.
OnSaveToPicture: TNotifyEvent - event arises after exporting the 3D-diagram image to a picture file.
OnSaveToExcel: TNotifyEvent - event arises after exporting the 3D-diagram data to MS Excel file.
3. The example of using
The program code with an example of use of EqapSurfaceChart and an example of data set is downloadable here. To demonstrate the component functionality just generate a new data set (clicking "Generate data set" button) or load the attached data set example using the appropriate button on the control panel.
All the software products are free for use. Any commercial using is not permitted without author's permission (o.lookin@iip.uran.ru).