Custom label in VixFrame scatter chat

Hello Experts,

We are trying to bring in custom labels in the chart. Below is the actual code that we are using. Can you please let us know what is that we are missing? Please note that the "riskOfLoss" field is not a numeric field.

var oNewEmployee = [{
	defaultFullName: "Thanu Krishnan",
	userId: "001",
	position: "1",
	riskOfLoss: "G2",
	username: "AAAA",
	manager: "Marcus",
	matrixManager: "Niki"
}, {
	defaultFullName: "Paul",
	userId: "002",
	position: "2",
	riskOfLoss: "G1",
	username: "AAAA",
	manager: "Marcus",
	matrixManager: "Niki"
}, {
	defaultFullName: "Biju",
	userId: "003",
	position: "3",
	riskOfLoss: "G4",
	username: "AAAA",
	manager: "Marcus",
	matrixManager: "Niki"
}];

var oJSONModel = new sap.ui.model.json.JSONModel();
oJSONModel.setProperty("/employees", oNewEmployee);
this.getView().setModel(oJSONModel, "ppModel");

var oVizFrame = this.getView().byId("idcolumn");
var oPopOver = this.getView().byId("idPopOver");

var dataset = new sap.viz.ui5.data.FlattenedDataset({
	dimension: [{
		axis: 1,
		name: 'User',
		value: "{defaultFullName}"
	}],
	measures: [{
		group: 1,
		name: 'PotentialCat',
		value: '{riskOfLoss}'
	}, {
		group: 2,
		name: 'Level',
		value: '{position}'
	}],
	data: {
		path: "/employees"
	}
});

oVizFrame.setDataset(dataset);
oVizFrame.setModel(oJSONModel);
oVizFrame.setVizType('scatter');

var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
		'uid': "valueAxis",
		'type': "Measure",
		'values': ["Level"]
	}),
	feedValueAxis2 = new sap.viz.ui5.controls.common.feeds.FeedItem({
		'uid': "valueAxis2",
		'type': "Measure",
		'values': ["PotentialCat"]
	}),
	feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
		'uid': "categoryAxis",
		'type': "Dimension",
		'values': ["User"]
	}),
	feedColor = new sap.viz.ui5.controls.common.feeds.FeedItem({
		'uid': "color",
		'type': "Dimension",
		'values': ["User"]
	});

oVizFrame.addFeed(feedValueAxis);
oVizFrame.addFeed(feedValueAxis2);
oVizFrame.addFeed(feedCategoryAxis);
oVizFrame.addFeed(feedColor);

oVizFrame.setVizProperties({
	plotArea: {
		markerSize: 32,
		colorPalette: d3.scale.category20().range()
	}
});
oPopOver.connect(oVizFrame.getVizUid());
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 05 at 03:38 AM

    Where are these "custom labels" should be shown on chart? Is it dataLabel?

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content