Page 1 of 1
BubbleCharts
Posted: Tue May 18, 2021 4:35 pm
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?
Re: BubbleCharts
Posted: Wed May 19, 2021 10:04 am
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.
Re: BubbleCharts
Posted: Wed May 19, 2021 10:48 am
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.
Re: BubbleCharts
Posted: Thu May 20, 2021 10:23 am
by jimwatterson
This all works beautifully.
Cheers Brendan.