Working with Cross-Plot data
Note: you will need to include CrossPlot in your Module Dependencies list.
A cross-plot data object is a simple data structure that holds a reference for 2 or 3 other data objects. The first two references are for the X and Y components of the cross-plot. The third reference is for the the optional z value that can be used to color the points. The data you specify must implement interface import com.interactive.intviewerapi.data.IXpMember. Currently this interface is implemented for IHorizonData, ISeismicData and IPointSetData.
import com.interactive.intviewerapi.data.IXpData;
....
IXpData xpData = IXpData.factory.createNewInstance(xdata, ydata, null);
Some data sources may have multiple attributes (horizons, pointset, etc.) and so it may be necessary to specify which attribute you want to use for the cross-plot. For example, if you have an horizon dataset with two attributes, "R0" and "R1" you could build the data source to cross-plot R0 vs R1 as follows:
IHorizonData hdata = ...
IXpData xpData = IXpData.factory.createNewInstance(hdata, hdata, null);
xpData.setXAttribute("R0");
xpData.setYAttribute("R1");
If you don't specify an attribute, the default one will be used.
To create the crossplot window, follow this template:
NamedProps props = new NamedProps();
String hdata = data.getDataName();
props.putProperty(IXpLayer.DISPLAY_NAME, lname);
props.putProperty(IXpLayer.COLOR_MODE, IXpLayer.COLOR_MONO);
IXpWindow lw = IXpWindow.factory.createWindow();
IXpLayer layer = IXpLayer.factory.createLayer(lw, data, props, false);
layer.select(...); // required for display, parameter can be null or a query