;
Special
Features for Surface Charts
Data
Mapping
Enable
Data Refresh
Data
Points
Special Features for Surface Charts
Heat Map (API Only)Data Mapping// set the surface chart area to be of different colors depending on the
// y values.// set color spectrum, green when y < 12, yellow when 12 < y < 24,
// and red when y > 24double[] value = {12, 24};
Color[] sColor = { Color.green, Color.yellow, Color.red };
ColorSpectrum colorSpectrum = new ColorSpectrum( sColor, value );// apply color spectrum specifications to the surface chart
chart.geth3DProperties().setColorSpectrum( colorSpectrum );
Explanation:
Xvalue, YValue & Zvalue: The X-Axis refers to the x coordinate point in a plane and the Y-Axis refers to the y coordinate point in the same plane while the Z-Axis refers to the z coordinate point in the same plane. The three points together define a point represented in the plane. Each coordinate point represents the position.
// map {xValue, yValue}
int[] map = {0, 2, 1};
// ColInfo (series, map)
ColInfo sampleColInfo = new ColInfo(-1, map);
// QbChart(java.applet.Applet applet, int dimension, int chartType,
// IDatabaseInfo dbinfo, IColumnMap cmap, java.lang.String template)
QbChart chart = new QbChart( null, QbChart.VIEW3D, QbChart.SURFACE,
yourData, sampleColInfo, null);
Data
Points
For information on Data
Points, please refer to Data Points in 2D
DataPoints API.
Set ColorHyperlinks
For information on Set Color, please refer to SetColor in 2D DataPoints API.Hide Zero-Value Data Points
For information on Hide Zero-Value Data Points, please refer to Hide Zero-Value Data Points in 2D DataPoints API.
// create an IHyperLinkSet object, "hHyperLinks" that3D Property Set
// has a handle on the chart’s HyperLinks
IHyperLinkSet hHyperLinks = chart.gethHyperLinks();// links for the x = 50 & y = 50, with hint box
// new HyperLink();
HyperLink temp = new HyperLink();// createHyperLinkForSurfaceChart(java.lang.String xValue,
// java.lang.String zValue, java.lang.String link)
temp.createHyperLinkForSurfaceChart( "50", "50", "http://www.quadbase.com" );// set the hint box message
temp.setHintValue("Click Here for x=50 & z=50" );// add the hyperlink to the chart’s hyperlink set
hHyperLinks.add(temp);
// set light position
Point_3D point3D = new Point_3D(0.5f, 0.5f, 0.5f);
h3DProps.setLightPosition( point3D );
// set ambient light color
h3DProps.setAmbientLight( Color.yellow);
// set view direction of the chart,
// two 3D points define the view direction
Point_3D[] points = new Point_3D[]{ new Point_3D(0.8f, 0.5f, 0.5f),
// zooming in/out on the chart
int zoomFactor = 20; // zoom factor 0 – 100
h3DProps.setZoomFactor( zoomFactor);
// set x, y, and z scale
h3DProps.setXScale( 0.3f);
h3DProps.setYScale( 0.3f);
h3DProps.setZScale( 0.4f);
// set the appearance of bar/columns
h3DProps.setBarWidthToThicknessRatio( 0.5f );
// set the speed of animation, int between 1 to 100, in radians/frame
h3DProps.setAnimationSpeed( 20 );
// draw in the regular mode
h3DProps.setRenderMode(QbChart.FLAT);
// draw only the color wires
h3DProps.setRenderMode(QbChart.WIREFRAME);
// draw in the flat mode with black borders
h3DProps.setRenderMode(QbChart.FLAT_BORDER);
// draw in the Gouraud Shading mode with border
h3DProps.setRenderMode(QbChart.GOURAUD_BORDER);
// draw in the Gouraud Shading mode
h3DProps.setRenderMode(QbChart.GOURAUD);
// get a handle on the chart’s 3D control panel,
// so you can set the components visible/invisible
I3DControlPanel h3DControl = chart.geth3DControlPanel();
// automatically start animation when chart is opened
h3DControl.setAnimationButtonOn(true);
// set Gouraud Shading button invisible
h3DControl. setGouraudButtonVisible(false);
// disable the toggle of double clicking on the canvas to set
// 3D control panel visible/invisible
h3DControl.setToggleEnabled(false);
// set the control panel visible (default is visible)
h3DControl.setVisible(true);