Skip to Content
0

Issue on Graphs on sapui5 X axis value

Feb 04, 2017 at 07:31 AM

90

avatar image
Former Member

I am creating line graph on sapui5 using Viz.frame.Binding value to dimension not showing on x-axis.want to show item category on X-axis and revunue on colours.Kindly suggest

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


	 dimensions : [     
				      {axis : 1,name : 'ReportName',value : "{Zmonth}"
				    /*	  axis : 2,name : 'ReportName',value : "{myModel7>Pla_act}",*/	  
				    }     
				      
				    ],    
				    measures : [     
				      {name : 'Planed',value : '{Planed}'},    
				    {name : 'Actual',value : '{Actual}'}     
				    ],    
				    data : {path : "/results"},
});
oViz.setVizProperties({


    valueAxis: {


      label: {


        formatString: 'u'


      }


    },


    plotArea: {


      dataLabel: {


        visible: true


      }


    },


    legend: {


      title: {


        visible: true


      }


    },


    title: {


      visible: true,


      text: 'Revenue by City and Year'


    }


  });


oViz.setDataset(oDataset);
oViz.setModel(oModelJson_cha3);


var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid' : "valueAxis",
'type' : "Measure",
'values' : [ 'Planed' ]})


var feedValueAxis1 = new sap.viz.ui5.controls.common.feeds.FeedItem({
	'uid' : "valueAxis",
	'type' : "Measure",
	'values' : [ 'Actual' ]
}),
feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid' : "categoryAxis",
'type' : "Dimension",
'values' : [ 'ReportName' ]
}), 
feedColor = new sap.viz.ui5.controls.common.feeds.FeedItem({
'uid' : "color",
'type' : "Measure",
'values' : [ 'Actual' ]
});
feedColor1 = new sap.viz.ui5.controls.common.feeds.FeedItem({
	'uid' : "color",
	'type' : "Measure",
	'values' : [ 'Planed' ]
	});
/*feedColor = new sap.viz.ui5.controls.common.feeds.FeedItem({
	'uid' : "color",
	'type' : "Dimension",
	'values' : [ 'ReportName' ]
	});*/




oViz.addFeed(feedValueAxis);
oViz.addFeed(feedValueAxis1);
oViz.addFeed(feedCategoryAxis);
oViz.addFeed(feedColor);
oViz.addFeed(feedColor1);

graph.jpg (30.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Jan 05 at 03:15 AM
0

You cannot have 2 dimensions being named into the same name "ReportName" and render it to the chart. They has to be in different name.

Share
10 |10000 characters needed characters left characters exceeded