Chung-Kan Huang Posted June 17, 2019 Share Posted June 17, 2019 Hi, I have a combination chart currently setup using Series with follow custom expression The numbers of series could change depend on the filter configuration. I want to write a script that could loop through the series in a combination chart and set those data with Axis.Default.Names equal to "Obs" to Lines and "Model" to Bars. Would it be possible Thanks, Kan Link to comment Share on other sites More sharing options...
Donald Johnson Posted June 22, 2019 Share Posted June 22, 2019 What TIBCO product are you referring to Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted September 13, 2019 Share Posted September 13, 2019 You can setup ironpython script as below ## import the necessary namespaces from Spotfire.Dxp.Application.Visuals import * #visual is a script parameter that contains your combination chart. vc = visual.As[CombinationChart]() vc.IndexedSeriesType.Clear() vc.IndexedSeriesType.Item["Obs"]= CombinationChartSeriesType.Line vc.IndexedSeriesType.Item["Model"]= CombinationChartSeriesType.Bar Link to comment Share on other sites More sharing options...
Janos Novits Posted June 16, 2020 Share Posted June 16, 2020 For me unfortunately it doesnt work. IT doesnt change the type on the viz, but only on the legend. Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted June 19, 2020 Share Posted June 19, 2020 Hi Janos, A slightly different code worked for me: ## import the necessary namespaces from Spotfire.Dxp.Application.Visuals import CombinationChart,CombinationChartSeriesType #visual is a script parameter that contains your combination chart. vc = visual.As[CombinationChart]() vc.SeriesType = CombinationChartSeriesType.Bar vc.IndexedSeriesType.Item["Sales"]= CombinationChartSeriesType.Bar vc.IndexedSeriesType.Item["Share"]= CombinationChartSeriesType.Line But you have to make sure (at least that was the case for me) that your Y axis columns are only one word. I had to rename my Class Sales column to Sales in order to have it work. Kind regards, David Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now