Skip to main content
RSS feed Subscribe to feed

 

Skip Navigation LinksHome  Extending the Spotfire Platform  Common Tasks and Idioms  Spotfire Visualization  Creating a Parallel Coordinate Plot

©Spotfire 2011

Creating a Parallel Coordinate Plot

Code example explaining how to set up parallel coordinate plot.

Refer to What is a Parallel Coordinate Plot? for a parallel coordinate plot presentation.

Create and Configure a Parallel Coordinate Plot

public static void CreateParallelCoordinatePlot(AnalysisApplication application)
{
    // Add a parallel coordinate plot to the page
    ParallelCoordinatePlot parallelCoordinatePlot = 
        application.Document.ActivePageReference.Visuals.AddNew<ParallelCoordinatePlot>();
    parallelCoordinatePlot.Title = "Basic Parallel Coordinate Plot";

    // Connect the parallel coordinate plot to data
    DataManager dataManager = application.Document.Data;
    parallelCoordinatePlot.Data.DataTableReference = dataManager.Tables.DefaultTableReference;

    // Set filtering for the visualization
    parallelCoordinatePlot.Data.UseActiveFiltering = true;

    // Set marking for the visualization
    parallelCoordinatePlot.Data.MarkingReference = dataManager.Markings.DefaultMarkingReference;

    // Set one line per row in the dataset
    parallelCoordinatePlot.LineByAxis.Expression = "<baserowid()>";

    // Add columns to show
    parallelCoordinatePlot.Columns.AddRange(new ParallelCoordinatePlotColumn[]
    {
        new ParallelCoordinatePlotColumn("Sales"),
        new ParallelCoordinatePlotColumn("Cost"),
        new ParallelCoordinatePlotColumn("Category"),
        new ParallelCoordinatePlotColumn("Type")
    });
}