VisualizationRelations Class

Spotfire 14.3 API Reference
This class is used to set which column relation to use when there are more than one column relation in the data manager that matches an expression. The ColumnRelation must exist in the ColumnRelationCollection in the data manager in order to be set as preferred.
Inheritance Hierarchy

SystemObject
  Node
    Spotfire.Dxp.Framework.DocumentModelDocumentNode
      Spotfire.Dxp.Application.VisualsVisualizationRelations

Namespace:  Spotfire.Dxp.Application.Visuals
Assembly:  Spotfire.Dxp.Application (in Spotfire.Dxp.Application.dll) Version: 65.0.19510.3242 (65.0.19510.3242)
Syntax

C#
[SerializableAttribute]
[PersistenceVersionAttribute(12, 0)]
public sealed class VisualizationRelations : DocumentNode

The VisualizationRelations type exposes the following members.

Properties

  NameDescription
Public propertyContext
Gets the context of this node.
(Inherited from DocumentNode.)
Public propertyIsAttached
Gets a value indicating whether this node is attached.
(Inherited from DocumentNode.)
Public propertyTransactions
Gets a collection of methods for executing transactions on the document.
(Inherited from DocumentNode.)
Top
Methods

  NameDescription
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodResetAllPreferred
Reset all preferred column relations and use the default column relations instead.
Public methodResetPreferred
Reset the preferred column relation and use the default column relation instead.
Public methodSetPreferred
Sets the preferred column relation. The relation must be a reference to a column relation in the data manager.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Explicit Interface Implementations

  NameDescription
Explicit interface implementationPrivate methodINodeContextGetAncestorT (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodINodeContextGetServiceT (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodINodeContextIsDescendantOf (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsBeginAggregatedTransaction (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteInvisibleTransaction (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteInvisibleTransaction2
Implements ExecuteInvisibleTransaction(Executor) for the Action Mods API.
(Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteStickyTransaction (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteStickyTransaction2
Implements ExecuteStickyTransaction(Guid, Executor) for the Action Mods API.
(Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteTransaction (Inherited from DocumentNode.)
Explicit interface implementationPrivate methodITransactionsExecuteTransaction2
Implements ExecuteTransaction(Executor) for the Action Mods API.
(Inherited from DocumentNode.)
Top
Examples

The following example shows how to use preferred column relations. The main table (CountryCapita) has two columns; Country and Capita. The second table (ExportImportAmount) has three columns; Export Country, Import Country and Amount. Add the column relations to the data manager:

var columnRelationExport = new ColumnRelation("[CountryCapita].[Country]", "[ExportImportAmount].[Export Country]");
var columnRelationImport = new ColumnRelation("[CountryCapita].[Country]", "[ExportImportAmount].[Import Country]");
dataManager.ColumnRelations.Add(columnRelationExport);
dataManager.ColumnRelations.Add(columnRelationImport);

Make a bar chart with the following expressions:

plot.XAxis.Expression = "<Country>";
plot.YAxis.Expression = "Sum([ExportImportAmount].[Amount]) / Sum([CountryCapita].[Capita]) AS [Amount per Capita]";
plot.ColorAxis.Expression = "<[Axis.Default.Names]>";

To get a plot for the amount of export per capita set columnRelationExport as the preferred.

plot.Data.Relations.SetPreferred(columnRelationExport);

To change the plot to get amount of import per capita set columnRelationImport as preferred.

plot.Data.Relations.SetPreferred(columnRelationImport);

Version Information

Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also

Reference