VisualizationRelations Class TIBCO Spotfire 7.0 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

System Object
  Spotfire.Dxp.Framework.DocumentModel Node
    Spotfire.Dxp.Framework.DocumentModel DocumentNode
      Spotfire.Dxp.Application.Visuals VisualizationRelations

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

[SerializableAttribute]
[PersistenceVersionAttribute(12, 0)]
public sealed class VisualizationRelations : DocumentNode
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: 7.0, 6.5, 6.0
See Also