2014-10-08 12 views
0

我有一個很煩人的問題。 :)Spotfire C#SDK:爲什麼ColoringCollection對象的Remove()方法似乎不起作用?

visual = context.ActiveVisualReference;    
TablePlot tablePlot = visual.As<TablePlot>();    
colorings = tablePlot.Colorings;    
categories = colorings.GetCategories();    
coloring1 = colorings.GetColoringForCategory(categories[0]);    
coloring2 = colorings.GetColoringForCategory(categories[1]);    
coloring3 = colorings.GetColoringForCategory(categories[2]);    
category2 = categories[2];    
bool removed = colorings.Remove(coloring2); 

這是C#代碼,我在自定義工具級別上執行的,問題是,我沒有看到Web專業內的任何效果(使用5.5)刪除方法執行 。

根據文檔該方法應該從可視化中刪除自定義着色,它不。

也許需要調用一些刷新視圖的方法,但我沒有設法找到它。

請幫忙。 :)

http://stn.spotfire.com/dxp/html/M_Spotfire_Dxp_Application_Visuals_ConditionalColoring_ColoringCollection_Remove.htm

回答

1

你試過tablePlot.Colorings =色素在你的代碼的結束?代碼結尾的「已刪除」值是多少?

在IronPython的這一個工程:

from Spotfire.Dxp.Application.Visuals import TablePlot 
print myVisual.Title 
myTablePlot = myVisual.As[TablePlot](); 
print myTablePlot.Title  
myColorings = myTablePlot.Colorings;    
myCategories = myColorings.GetCategories(); 
print myCategories.Count 
myColorings.Remove(myColorings.GetColoringForCategory(myCategories[1])) 
+0

當我試圖設置tablePlot.Colorings於色素我有錯誤味精說屬性或索引「Spotfire.Dxp.Application.Visuals.TablePlot.Colorings」不能被分配到 - 它是隻讀的 – 2014-10-09 19:05:56

相關問題