Set multiple columns on Y Axis of line chart using selections from several multi-select list boxes

Hello,

I'm trying to create a line graph that is controlled by IronPython scripts. I am new to IronPython, so please excuse any misnomers. I have 8 multi-select list boxes where the user can choose the columns to be plotted on the Y Axis. The X-Axis will always be the same column, so we don't need to worry about that. I have the following script in a button that the user can click once they have selected the columns.

from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Data import DataPropertyClass

# Set up line graph

Vis = myLineGraph

vc = Vis.As[VisualContent]()

# Grab selected columns from the multi-select list box. This line of code worked on another visualisation where the columns on a table visualisation were populated by a multi-select list box. "Group 1" is the name of the property assigned to one of the multi-select list boxes.

selection_1 = Document.Data.Properties.GetProperty(DataPropertyClass.Document, "Group1").Value

#Set YAxis. 

vc.YAxis.Expression = selection_1

This doesn't work as the vc.YAxis.Expression expectes a string and gets a list object instead. How can I configure the Y-Axis to plot the columns selected from the multi-select list boxes? If it helps, I have illustrated what I am trying to accomplish in the screenshot. 

Thank you,

T

Attachments

AttachmentSize
Image icon spotfire_question.png30.99 KB

(1) Answer

Login