cancel
Showing results for 
Search instead for 
Did you mean: 

Hi developers , while creating ui5 charts getting the below error

Former Member
0 Kudos

Uncaught [50005] - axisLabels : does not meet minimum or maximum number of feeds definition.

Below is the Code:

<!DOCTYPE HTML>

<html>

  <head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>

  <script src="resources/sap-ui-core.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.m,sap.viz"

  data-sap-ui-theme="sap_bluecrystal">

  </script>

  <!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

<script type="text/javascript">

var oModel =new sap.ui.model.json.JSONModel({

  

  data:[

      {product:"Car",country:"India",profit:"50"},

      {product:"Car",country:"China",profit:"30"},

      {product:"Car",country:"USA",profit:"40"},

      {product:"Car",country:"Japan",profit:"35"},

      {product:"Car",country:"Canada",profit:"55"},

      {product:"Car",country:"Germany",profit:"65"}

      ]

});

sap.ui.getCore().setModel(oModel);

var dataset  = new sap.viz.ui5.data.FlattenedDataset({

  dimentions:[

         {

  axis:2,

  name:"country",

  value:"{country}"

  },

  {

     axis : 2, name : 'Product', value : "{product}"

  }],

  

  measures:[{ name : 'Profit', value : '{profit}' }],

  

  data : { path : "/data" }

});

  new sap.viz.ui5.StackedColumn("oChart", {

  width : "100%",

  height : "200px",

  title : {

  visible : true,

  text : 'Test Stacked Column Chart'

  },

  dataset : dataset

  }).placeAt("content");

  sap.ui.getCore().byId("oChart").setInteraction(

  new sap.viz.ui5.types.controller.Interaction(

  {

  selectability : new sap.viz.ui5.types.controller.Interaction_selectability(

  {

  mode : sap.viz.ui5.types.controller.Interaction_selectability_mode.none

  })

  }));

  sap.ui.getCore().byId("oChart").attachBrowserEvent("click",

  chartClickHandler);

  function chartClickHandler(oEvent) {

  if (!$(oEvent.srcElement).closest('.v-m-xAxis').length)

  return;

  var xAxisLabel = $(

  $(oEvent.srcElement).next('.viz-axis-label').children(

  'text')).text();

  new sap.ui.commons.Dialog({

  title : xAxisLabel + " clicked"

  }).open();

  }

  </script>

  </head>

  <body class="sapUiBody" role="application">

  <div id="content"></div>

  </body>

</html>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Found some errors in your code.

1. It's dimensions & not dimentions

2. There are two dimensions defined as axis : 2 ? Change the first one to axis : 1

Working snippet of your code .JS Bin - Collaborative JavaScript Debugging