BubbleCharts

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

BubbleCharts

Post by jimwatterson »

I'm using the new Bubbblechart controls in a view and I want to process the click event so that I can display drilldown data,

The BubbleChartCategory has
BubbleChartValueR
BubbleChartValueX
BubbleChartValueY

To represent a single bubble

Each of these has a click event but I cannot work out how to access all of the values of the bubble in a single even handler.

I've looked at casting the sender as a BubbleChartValue but this only exposes a single value and I need all three

Any clues anyone?
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: BubbleCharts

Post by BrendanB »

Jim,

a quick poke around suggests that you could try the following (based on the fact that #BubbleChart is a list).

Code: Select all

Evtroutine Handling(#BubbleChartValueX.Click) Com_Sender(#Sender)

#COM_SELF.HandleClickEvent( #Sender )

Endroutine

Mthroutine Name(HandleClickEvent)
Define_Map For(*INPUT) Class(#PRIM_CHRT.BubbleChartValue) Name(#ValClicked)

Selectlist Named(#BubbleChart)

Continue If(#BubbleChartValueX.Value <> #ValClicked.Value)

#SYS_WEB.Console.Log( ('**** ' + #BubbleChartCategory.Caption) )
#SYS_WEB.Console.Log( ('**** Y= ' + #BubbleChartValueY.Value.AsString) )
#SYS_WEB.Console.Log( ('**** X= ' + #BubbleChartValueX.Value.AsString) )
#SYS_WEB.Console.Log( ('**** R= ' + #BubbleChartValueR.Value.AsString) )
Leave

Endselect

Endroutine
The definitions used were:

Code: Select all

Define_Com Class(#PRIM_CHRT.BubbleChart) Name(#BubbleChart) DisplayPosition(3) Height(349) Left(0) Parent(#COM_OWNER) TabPosition(3) TabStop(False) Top(58) Width(591) MaxSize(80)

Define_Com Class(#PRIM_CHRT.BubbleChartCategory) Name(#BubbleChartCategory) Parent(#BubbleChart) ThemeDrawStyle('Back(142,36,170,0.7)+Border(142,36,170,1)')
Define_Com Class(#PRIM_CHRT.BubbleChartValue) Name(#BubbleChartValueX) DisplayPosition(1) Parent(#BubbleChart) Description('Clients')
Define_Com Class(#PRIM_CHRT.BubbleChartValue) Name(#BubbleChartValueY) DisplayPosition(2) Parent(#BubbleChart) Description('Representatives')
Define_Com Class(#PRIM_CHRT.BubbleChartValue) Name(#BubbleChartValueR) DisplayPosition(3) Parent(#BubbleChart) Description('Revenue')
Obviously, I am not doing anything with the values (other than writing them to the console), but I would imagine this should get you started.

B.
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: BubbleCharts

Post by BrendanB »

Actually, on further reflection, just try:

Code: Select all

Evtroutine Handling(#BubbleChartValueX.Click) Com_Sender(#Sender)

#SYS_WEB.Console.Log( ('** ' + #BubbleChartCategory.Caption) )
#SYS_WEB.Console.Log( ('** Y= ' + #BubbleChartValueY.Value.AsString) )
#SYS_WEB.Console.Log( ('** X= ' + #BubbleChartValueX.Value.AsString) )
#SYS_WEB.Console.Log( ('** R= ' + #BubbleChartValueR.Value.AsString) )
#SYS_WEB.Console.Log( ('**') )

Endroutine
reason being: #BubbleChart.CurrentItem should be set by the Click event, so the values will be what they need to be.
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

Re: BubbleCharts

Post by jimwatterson »

This all works beautifully.

Cheers Brendan.
Post Reply