cancel
Showing results for 
Search instead for 
Did you mean: 

Makit Column Chart - Two Values per Category

Former Member
0 Kudos

Hey guys!

We are developing a mobile ui5 application based on a desktop application. With VIZ we easily define two measures within a column chart and the result is two columns per "dimension". With makit it is a little bit different and i thought this will do it:

var oChart = new sap.makit.Chart("Chart_r1",{

                  height: "100%",

                  width: "100%",

                  type : sap.makit.ChartType.Column,

                  showRangeSelector : false,

                  category : new sap.makit.Category({ column : "regionCategory", displayName : "Region" }),

                  values : [new sap.makit.Value({ expression : "revenueValue", format : "currency", displayName : "Availability" }),

                            new sap.makit.Value({ expression : "lossValue", format : "currency", displayName : "Loss"}) ],

                  categoryAxis : new sap.makit.CategoryAxis({ displayLastLabel: true }),

                  valueBubble : new sap.makit.ValueBubble({

                                style: sap.makMaiit.ValueBubbleStyle.Top,

                                showCategoryText: true

                   }),

              });

                    oChart.addColumn(new sap.makit.Column({name:"regionCategory", value:"{REGION}"}));

                    oChart.addColumn(new sap.makit.Column({name:"revenueValue", value:"{AVAILABILITY}", type:"number"}));

                    oChart.addColumn(new sap.makit.Column({name:"lossValue", value:"{LOSS}", type:"number"}));

                    oChart.setModel(oModel);

However, it only shows the first column (revenue) and i have no clue why. Further, i didn't found an example for a column chart with two columns expect the "Multi-Series Chart" but i can't adapt it to our case.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Manu Schmitt,

Please see the below example.

Best Regards,

Bibhas Das

Former Member
0 Kudos

Hey Bibhas

thanks for your answer. You used the series functionality by "iterating" over the years, but my data looks like this:

var testDate = { mycollection : [ {year : 2007, revenue : 900000, loss: 15000},

                                 {year : 2008, revenue : 500000, loss: 12000},

                                 {year : 2009, revenue : 1200000, loss: 40000},

                                 {year : 2010, revenue : 850000, loss: 30000},

                                 {year : 2011, revenue : 920000, loss: 50000},

                                 {year : 2012, revenue : 860000, loss: 10000},

                   ]

If there is no other option, we need to change the data format and use the series functionality like you did... but i hope i can avoid this step