Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2720

Chart Color with 2 Measures

$
0
0

Hi All,

 

Please can anyone help me in this :

 

// some business data
var oModel = new sap.ui.model.json.JSONModel({

   businessData : [

  {Station :"10",takt:61, stationProgress:50},

  {Station :"20",takt:61.29, stationProgress:11}

  ]

});

 

I want below donut chart to show 2 measure for the SAME Station 10 data :

 

Blue Measure should show stationProgress

Red Measure should show TAKT

 

 

 

image.png

 

With Below code,  I am not able to to achieve this as it is showing for all 3 Stations which i DO NOT WANT:

 

 

 

 

 

 

 

 

// A Dataset defines how the model data is mapped to the chart
var oDataset = new sap.viz.ui5.data.FlattenedDataset({

 

   // a Bar Chart requires exactly one dimension (x-axis)
   dimensions : [

  {

   axis : 1, // must be one for the x-axis, 2 for y-axis
   name : 'Station',

   value : "{Station}"
   }

  ],

 

   // it can show multiple measures, each results in a new set of bars in a new color
   measures : [

   // measure 1
   {

   name : 'Progress', // 'name' is used as label in the Legend
   value : '{stationProgress}' // 'value' defines the binding for the displayed value
   }

  ],

 

   // 'data' is used to bind the whole data collection that is to be displayed in the chart
   data : {

   path : "/businessData"
   }

 

});

 

 

 

// create a Bar chart
// you also might use Combination, Line, StackedColumn100, StackedColumn or Column
// for Donut and Pie please remove one of the two measures in the above Dataset.
var oBarChart = new sap.viz.ui5.Donut({

   width : "100%",

   height : "105px",

   left: "0px",

   plotArea : {
  'colorPalette' : d3.scale.category20().range()
  },

   title : {

   visible : false,

 

  },

   dataset : oDataset
});


Viewing all articles
Browse latest Browse all 2720

Trending Articles