• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Chart Widget with two data fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chart Widget with two data fields

    I have a chart widget with two data fields (one label field). I'm trying to open a filtered grid based when the chart data is clicked. How do I know which data field (of the two) the user clicked on?

    The mouse-over seems to "highlight" both data bars in the column...

    2021-12-16 09_51_07-Valence 6.0.png

  • #2
    Right now you need to use the link to app variables so your app variable gets set with the series field that was clicked. Then create a custom filter that pulls in that app variable so you can determine how to filter the widget.

    In a future release we plan on making this easier within behaviors so you don't have to do a customer filter.

    forumChartClickOne.png

    forumChartClickTwo.png

    Example Customer Filter:
    Code:
    var clickedSeries = getAppVar('seriesClicked'),
        country       = getFrom('A_CCOUNTRY'),
        filter = '',
        SQ     = "'";
    
    // check which series was clicked
    //
    if (clickedSeries === 'SALES2019') {
        filter += 'CCITY = ' + SQ + 'Chicago' + SQ;
    } else {
        filter += 'CCOUNTRY = ' + SQ + country + SQ;
    }
    
    return filter;
    If you run into any issues with this please let us know

    Comment


    • #3
      Thank you!!! But first, I must upgrade my production instance. My "Link to App Variables" only has the General tab.

      Comment


      • #4
        Thanks... This works perfectly!

        Comment

        Working...
        X