cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 VIZ Chart Events in XML-Views

Former Member
0 Kudos

Hi,

I'm trying to attach Events to Charts via XML-Views. The Idea is to have a chart above a table and a click on a datapoint/column will highlight the corresponding data in the table.

Since I am using XML-Views I cant figure out the right way - do i have to attach the events through javascript after the view was created?

My XML-Fragment:


<core:FragmentDefinition xmlns:core="sap.ui.core"

     xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:l="sap.ui.layout"

     xmlns:v="sap.viz.ui5" xmlns:vd="sap.viz.ui5.data" xmlns:vt="sap.viz.ui5.types"

     xmlns:f="sap.ui.layout.form" controllerName="zcfs_customer.Customer"

     xmlns:html="http://www.w3.org/1999/xhtml">

<v:Column width="100%" height="300px">

     <v:dataset>

          <vd:FlattenedDataset data="{/acctAggr}">

               <vd:dimensions>

                    <vd:DimensionDefinition axis="1" value="{ACCT_NR}" name="Account"></vd:DimensionDefinition>

               </vd:dimensions>

               <vd:measures>

                    <vd:MeasureDefinition value="{NUMBER_OF_TRANS}" name="Number of Transactions"></vd:MeasureDefinition>

               </vd:measures>

           </vd:FlattenedDataset>

     </v:dataset>

     <v:interaction>

          <vtc:Interaction supportedEventNames="mouseup,mousedown,mousemove,mouseout,mouseover,touchstart">

               <vtc:selectability>

                    <vtc:Interaction_selectability mode="none"></vtc:Interaction_selectability>

               </vtc:selectability>

          </vtc:Interaction>

     </v:interaction>

</v:Column>

I tried to add handlers="chartClick" to the <vtc:Interaction>-Node but it won't find it in the Controller and states "undefined" in the console - but it is present in my Controller:


chartClick : function(evt) {

     console.log(evt);

}

Any hints?

I would like to do as much as possible through my XML-Views.

greetz

Ruven

Accepted Solutions (0)

Answers (1)

Answers (1)

santhu_gowdaz
Active Contributor
0 Kudos

Hi Ruven,

May this help you,

SAPUI5 Explored

Former Member
0 Kudos

Hi,

yeah, I "came" from there (I asked my question there too).

It uses only javascript and no XML-Views.

The event is completely decoupled - it is attached via "byId"-Call, which is not that nice for a full fletched app using xml-views - imo.

thx

Ruven