データ可視化コンポーネントのサンプルコード

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:1分
  • イベントがトリガーされたときのアクションを定義するためのサンプルコードが用意されています。コンポーネントを Web ページに埋め込む前に、ユースケースのサンプルコードを更新します。

    サンプルコード

    { 
    
    'NOW_VIS_WRAPPER#PROPERTY_OVERRIDE' : (e) => { 
    
    // Dispatched when the visualization overrides its property. For example when the user selects a different group by from the alternative group by selection 
    
    var {properties} = e.detail.payload; 
    
    console.log(properties); 
    
    }, 
    
    'NOW_VIS_WRAPPER#SELECTED' : (e) => { 
    
    // Dispatched when the user selects/de-selects element on data visualizations, typically to filter other content on the page 
    
    var {title, type, isSelected, params, data} = e.detail.payload; 
    
    console.log(title, type, isSelected, params, data); 
    
    }, 
    
    'NOW_VIS_WRAPPER#CLICKED' : (e) => { 
    
    // Dispatched when the visualization is clicked 
    
    var {title, type, params, data} = e.detail.payload; 
    
    console.log(title, type, params, data); 
    
    }