Display only the desired labels on x-axis using Python

I am trying to show only desired labels on x-axis in the increments of 30 instead of randomly picked labels (please see picture 1 and 2) using IronPython. This is my first time trying to code IronPython in Spotfire - any suggestions? My code isn't working:

 

# Modify labels for x-axis

# Import Visuals namespace to get access to 

#VisualTypeIndentifiers enumeration

from Spotfire.Dxp.Application.Visuals import*

#Iterate over all visualizaitons on the active page to 

#get a reference to the target visualization

for visualization in Document.ActivePageReference.Visuals:

#If the visualization is called "Trend Lines" and 

#is a line chart, get the visualization reference.

    if visualization.Title == "Trend Lines" and visualization.TypeId == VisualTypeIdentifiers.LineChart:

        vis = visualization.As [LineChart]()

#Modify the x-axis.

        if [DaysSinceFirstOil]== "120"

        visualContentObject.XAxis.LabelVisibility.Marked

Attachments

AttachmentSize
Image icon capture1.png82.03 KB
Image icon script.png27.24 KB

(1) Answer

Login