The IlvChart3DView class represents the
three-dimensional view of the chart and lets you control its visual
appearance. You can retrieve the view associated with a chart by
calling the
IlvChart.get3DView
method.
Note
The get3DView method returns a valid
IlvChart3DView
object, even if the chart is not currently displayed in 3-D. You
can thus switch between a 3-D and a 2-D representation, and still
keep the properties of the 3-D display.
Projection properties
The following properties specify how
points are projected in the chart view.
Property
|
Methods
|
Default
Value |
---|---|---|
Elevation
|
getElevation
setElevation
|
45
|
Rotation
|
getRotation
setRotation
|
35
|
Automatic
Scaling |
isAutoScaling
setAutoScaling
|
true
|
Zooming
Factor |
getZoom
setZoom
|
1
|
Projection
Type |
getProjectionType
setProjectionType
|
IlvChart3DView.ORTHOGRAPHIC
|
View angles
The elevation and rotation angles specify the location of the
eye. The elevation ranges from –90 degrees to 90 degrees. The
rotation angle ranges from –90 degrees to 90 degrees for
Cartesian charts and can take any value for Pie charts. A
dedicated interactor lets you modify these angles, as described
in the section Interactive control of the 3-D view
orientation.
Scaling factor
The scaling applied to the x- and y-coordinates during
projection is computed as follows: if the
autoScaling
property is set to
true
, the chart tries to determine the appropriate scaling factor
so that the drawing fits the rectangle of the chart area. The
computed scaling factor is then multiplied by the zooming
factor.
Projection type
Two projection types are available for
Cartesian charts:
- Orthographic projection (
IlvChart3DView.ORTHOGRAPHIC
). - Oblique projection (
IlvChart3DView.OBLIQUE
). This projection preserves the orthogonality of x- and y-axes.
Orthographic and Oblique Projections
shows the difference between the two projection types.

Orthographic and Oblique Projections
Lighting properties
The following properties specify how
lighting is shown in the chart view.
Property
|
Methods
|
Default
Value |
---|---|---|
Ambient
light intensity |
getAmbientLight
setAmbientLight
|
0.1
|
Light
latitude |
getLightLatitude
setLightLatitude
|
0
|
Light
longitude |
getLightLongitude
setLightLongitude
|
0
|
The JViews Charts library uses a simple
lighting model composed of:
- A direct light, which casts parallel rays. This light is located by spherical coordinates in the projected space. The default latitude and longitude are equal to 0, which means that the light is originally located at the eye.
- An ambient light, which illuminates all the objects of a 3-D view, independently of the orientation of the rendered faces. Changing the intensity of this light prevents some parts of the chart from being too dark. The intensity ranges from 0 (no ambient light) to 1 (maximum intensity).
Controlling depth
The following properties control depth in
the chapter view.
Property
|
Methods
|
Default
Value |
---|---|---|
Depth
|
getDepth
setDepth
|
20
|
Depth
gap |
getDepthGap
setDepthGap
|
0
|
The depth property ranges from 1 to 100 and specifies the
percentage of the chart depth relative to its width. The depth
gap lets you control the separation between two layers, as shown
in Controlling the Depth of a Chart.

Controlling the Depth of a Chart
Decorations along the depth axis
The chart can display annotations and grid lines along the z-axis
(also referred to as the depth axis).
The annotations are returned by the getZAnnotationText method. You can control
the visibility and the appearance of annotations and grid with
the following properties:
Property
|
Methods
|
Default
Value |
---|---|---|
z-annotation
visibility |
isZAnnotationVisible
setZAnnotationVisible
|
true
|
z-annotation
renderer |
getZAnnotationRenderer
setZAnnotationRenderer
|
|
z-grid
visibility |
isZGridVisible
setZGridVisible
|
true
|
z-grid
paint |
getZGridPaint
setZGridPaint
|
Paint
of x- or y-grid |
z-grid
stroke |
getZGridStroke
setZGridStroke
|
Stroke
of x- or y-grid |
Listening to property changes
The IlvChart3DView class enables you to add
listeners that are notified whenever a property is modified. The
registration and notification use the
PropertyChangeListener
and
PropertyChangeEvent
classes from the
java.beans
package. The ControlPanel3D.java
source file shows how listeners can be used to synchronize slider
controls with the values of numeric properties.