Jump to content

Combination Chart - displaying lines for series


Ruddy LEFEBVRE

Recommended Posts

Hello !

I need some help again ...I've got a combination with theseexpressions :

YAxis :Sum([sales]) as [sales], count() as [CNT]

XAxis :

ColorAxis :

I want to change the SerieType only for the CNT so here is the script that work :

from Spotfire.Dxp.Application.Visuals import CombinationChart,CombinationChartSeriesType

vc = visual.As[CombinationChart]()

vc.SeriesType = CombinationChartSeriesType.Bar

vc.IndexedSeriesType.Item["CNT"] = CombinationChartSeriesType.Line

Now harder, i want to compare with the last month that is filtered, so i change this expression :

ColorAxis :

It seems to work because i can see in the legend :

(bars) Sales >> September

(bars) Sales >> October

(line) CNT >> September

(line) CNT >> October

but the combination chart doesn't update and it displays only bars

I Have to click on "Line" that is already checked in the series properties to see the change.

Do you have the solution

Thanks

Link to comment
Share on other sites

Hi - I think the problem is that the chart is getting a bit confused. After you change the axis, the chart will create a new series and autoconfigure that (in the UI) but you need to tell it what you want to do with the series when you're using the API.

Please try changing the series to line type using the API again after updating the axis:

vc.IndexedSeriesType.Item["CNT"] = CombinationChartSeriesType.Line

I hope that makes sense and please post back to tell me if it works.

Andrew (TIBCO Data Science)

Link to comment
Share on other sites

I change the ColorAxis expression first then i change the serie to line type with the script below :from Spotfire.Dxp.Application.Visuals import CombinationChart,CombinationChartSeriesTypevc = visual.As[CombinationChart]()

vc.SeriesType =  CombinationChartSeriesType.Bar

vc.ColorAxis.Expression = "<[Axis.Default.Names] NEST [MONTH]>"

vc.IndexedSeriesType.Item["CNT"] = CombinationChartSeriesType.LineBut there is still no lines displaying in the combination chart.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi - I'm sorry it's taken so long for me to get back to you. I have been extremely busy!

I've investigated this as much as I am able and suspect it's a bug. Do you have a Support Account

https://support.tibco.com

I think the problem is potentially caused by the different Category Keys (e.g. Count >> Feb), but unfortunately there's no easy way of enumerating them all and setting the series to lines.

Here's my code, but it causes Spotfire to hang.

 

from Spotfire.Dxp.Application.Visuals import CombinationChart,CombinationChartSeriesType, CategoryKey

from System import Array

 

strArray = Array[str](["Count", "Feb"])

 

ck = CategoryKey(strArray)

 

vc = visual.As[CombinationChart]()

vc.SeriesType = CombinationChartSeriesType.Bar

vc.ColorAxis.Expression = ''

vc.IndexedSeriesType.Item["Count"] = CombinationChartSeriesType.LineI have also attached a DXP. If at all possible, I suggest submitting it along with the support request, and pointing them to this Question/Answer page.

Thanks!

Andrew (TIBCO Data Science)

Link to comment
Share on other sites

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...