cancel
Showing results for 
Search instead for 
Did you mean: 

How to swap the place of dimensions and mesures in a card?

0 Kudos

This is what I've got for now:

What I want to do is swap the graphic to a vertical mode with measures in an horizontal way, like this one:

Card Explorer

Can someone help?!

This is my code:

manifest0.setData({
                "columnsSalesOrderedByCost": {
                    "sap.app": {
                      "id": "card.explorer.stacked.column.card",
                      "type": "card",
                      "i18n": "i18n/i18n.properties"
                    },
                    "sap.card": {
                        "type": "Analytical",
                        "data": {
                            "json" : oProper
                        },
                        "header": {
                            "title": "Quantidades pedidas pelos clientes",
                            "subTitle": "Total por artigo"
                        },                
                        "content": {
                            "chartType": "StackedColumn",
                            "legend": {
                                "visible": true,
                                "position": "Bottom",
                                "alignment": "TopLeft"
                            },
                            "plotArea": {
                                "dataLabel": {
                                    "visible": false,
                                    "showTotal": true
                                },
                                "categoryAxisText": {
                                    "visible": false
                                },
                                "valueAxisText": {
                                    "visible": false
                                }
                            },
                            "title": {
                                "text": "Stacked column chart",
                                "visible": false,
                                "alignment": "Left"
                            },
                            "measureAxis": "valueAxis",
                            "dimensionAxis": "categoryAxis",
                            "data": {
                                "json": {
                                    "list": oProper
                                },
                                "path": "/list"
                            },
                            "dimensions": [
                                {
                                    "label": "Artigo",
                                    "value": "{itemName}"
                                }
                            ],
                            "measures": [
                                {
                                    "label": "Pedido",
                                    "value": "{qttOrderByCust}"
                                },
                                {
                                    "label": "Em stock",
                                    "value": "{QuantityOnStock}"
                                }
                                
                            ]
                        }
                    }
                }

            });

View Entire Topic
michal_majer
Active Participant

Hello Margarida,

Please try switch chartType from StackedColumn to StackedBar in content section

"chartType": "StackedBar"