Change metrics dinamically


#1

Hi, I have a React app, with some KPIs and bars, but what I need is to change the metrics in real time after a user action, is that possible?


#2

Hey, i think is very easy, why you don’t use a Field selector?, it allows you to change any group or metric in any visualization dynamically:

const charts = ['chart-1', 'chart-2', ....];

cf.provider('Elastic')
    .source('ticket_sales')
    .graph('Field Selector')
    .set('type', ['INTEGER', 'NUMBER', 'MONEY']) // the fields you want to include in the field selector list
    .set('charts', charts) // the charts you want to affect
    .element('v1')
    .execute()