Forum Stats

  • 3,770,454 Users
  • 2,253,116 Discussions
  • 7,875,462 Comments

Discussions

How to associate a chart and a table/datagrid with the same data source/collection?

2751631
2751631 Member Posts: 5
edited Dec 2, 2015 12:16PM in Oracle JET

I am working on creating a bound set of datagrid/table with a chart so that when the table gets updated, it reflects in the chart. Since there isn't yet a concept of an editable table yet, I will be using the CRUD example to update a table cell. How can I achieve one way binding between the table and the chart? I went through the discussion on "Associated Views: Cross Component Interactivity for Data Visualizations" and it gives me a hint to push the datasource to the linked components one by one, the way its supported for  each component. But want to know the proper and easier way of achieving this.

Thanks

Monika

Answers

  • Hugh Zhang-Oracle
    Hugh Zhang-Oracle Member Posts: 193 Employee
    edited Dec 2, 2015 12:16PM

    Hi Monika,

    I'd recommend using a computed observable to generate the data to pass to each component. The computed observables would depend on whatever is the source of truth for your data, and they would be updated along with the underlying data, triggering component updates. We try to keep the APIs as similar as possible between components, but the different shapes of data between components mean that we can't just take the same data structures across everything. We'll add a demo or blog post soon to make this easier going forward.

    Thanks,

    Hugh

    2751631