cancel
Showing results for 
Search instead for 
Did you mean: 

Data model for charts and tables

Former Member
0 Kudos

Hi,

I have the following model for rendering an horizontal stacked bar chart.


{

    "Scenarios": [

    {

        "Scenario": "Managed System",

        "Type"    : "Undefined",

        "ManagedObjects"  : 25

    },

    {

        "Scenario": "Managed System",

        "Type"    : "Success",

        "ManagedObjects"  : 10

    }

    ]

}

Here for the scenario Managed System I will have one bar with two values: 25 and 10.

And on the same screen I have to display details of Managed Objects at the same time : 25 lines of Managed Object with Type Undefined and 10 lines with Type Success.

So I would need this kind of model to match the table:


{

    "Scenarios": [

    {

        "Scenario": "Managed System",

        "Type"    : "Undefined",

        "ManagedObject"  : "FA7~ABAP"

    },

    {

        "Scenario": "Managed System",

        "Type"    : "Undefined",

        "ManagedObject"  : "SD7~ABAP"

    },

    {

        "Scenario": "Managed System",

        "Type"    : "Undefined",

        "ManagedObject"  : "FQ7~ABAP"

    },

    ...

    {

        "Scenario": "Managed System",

        "Type"    : "Success",

        "ManagedObject"  : "HY5~JAVA"

    },

    {

        "Scenario": "Managed System",

        "Type"    : "Success",

        "ManagedObject"  : "FT5~JAVA"

    }

    ...

    ]

}

There is a Filter bar common to the chart and the table.

How could I managed to have the same model working for the graph and the table using the filtering capabilities?

Thanks,

Serge.

Accepted Solutions (0)

Answers (1)

Answers (1)

saivellanki
Active Contributor
0 Kudos

Hi Serge,

Not sure, whether this is what you're expecting / not? - http://embed.plnkr.co/U0Bc7PJl1tLTGalXsTQi/preview

Testing Steps -

  • Stacked Bar chart is plotted with Scenario/Type dimensions. Click on either of the bar Success/Undefined.
  • You can see the table items icon bar getting expanded with filtered details displayed on table. And at the same time bar icon bar gets minimized.
  • If you want to change the selection, click on 'Reset Data' button which is placed at table header bar, where the chart appears again.
  • You can click on any bar again, so the corresponding details will be displayed on table.

Please correct me, if my understanding was wrong.

Regards,

Sai Vellanki.

Former Member
0 Kudos

Hi Sai,

I think you got it well and thanks for your reply!

But is it possible to plot the graph with only one model and then use it for both the graph and the list?

Then we let the graph do the aggregation on its own and apply filtering on only one model.

Let me know.

Cheers,

Serge.

saivellanki
Active Contributor
0 Kudos

Hi Serge,

I used the same model for both chart and table. This is the model that I used -


var dataObject = [

    "Scenarios": [ 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "SM7~ABAP" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "SD7~ABAP" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "FQ7~ABAP" 

    },   

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "FP7~ABAP" 

    },

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "NQ7~ABAP" 

    },

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "DQ7~ABAP" 

    },

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "LQ7~ABAP" 

    },

    { 

        "Scenario": "Managed System", 

        "Type"    : "Undefined", 

        "ManagedObject"  : "RQ7~ABAP" 

    },

    { 

        "Scenario": "Managed System", 

        "Type"    : "Success", 

        "ManagedObject"  : "HY5~JAVA" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Success", 

        "ManagedObject"  : "FT5~JAVA" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Success", 

        "ManagedObject"  : "PT5~JAVA" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Success", 

        "ManagedObject"  : "ST5~JAVA" 

    }, 

    { 

        "Scenario": "Managed System", 

        "Type"    : "Success", 

        "ManagedObject"  : "PT5~JAVA" 

    }

    ] 

}];        

From the above model, I'm fetching the count with type 'Success' and 'Undefined' and binding that count to chart. On click of the bar, I get the type selected and filter the model with that type and bind it to table model.

Sorry, if I understand you wrong, is this what your requirement (or) is it vice-versa ?


Regards,

Sai Vellanki.

Former Member
0 Kudos

Hi Sai,

Yes I saw that you created a new json model for the graph.

But I'd like to avoid this extra model and then post-processing to compute the graph's aggregation (count).

I'd expect the graph to do it on its own with some extra configuration.

Then I'll bind only one model for both graph and list.

Is it possible?

Regards,

Serge.