VizFrame Stacked Column:如何更改图例显示名称?

2020-09-19 02:51发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我想更改图例(红色正方形)的文本...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


我想更改图例(红色正方形)的文本。

例如,我希望传说中用" Residuos"代替" crResiduos"。

这是视图

 getChartAcompaniamiento:function(){


 var oVIZFrame = new sap.viz.ui5.controls.VizFrame({
 vizType:" stacked_column",
 id:this.createId(" chartAcompaniamiento"),
 宽度:" 100%"
 });


 oVIZFrame.setVizProperties({
 dataLabel:{
 可见:真
 },
 工具提示:{
 可见:真
 },
 标题:{
 文字:"Acompañamiento"
 }
 });


 返回oVIZFrame;
 }
 

这是控制器

 getChartAcompaniamiento:function(){
 var oVizFrame = this.getView()。byId(" chartAcompaniamiento");


 var aAcompaniamientoData = [{
 " rol":" Llamadas",
 " referentes":" 4",
 " reconocimiento":" 7",
 " crResiduos":" 3",
 " comSustentable":" 7",
 " alumnosEnEco":" 6",
 " accionPorElClima":" 1"
 },{
 " rol":" Visitas",
 " referentes":" 8",
 " reconocimiento":" 1",
 " crResiduos":" 4",
 " comSustentable":" 4",
 " alumnosEnEco":" 1",
 " accionPorElClima":" 3"
 }];


 var oModel = new sap.ui.model.json.JSONModel();


 oModel.setData({
 "项目":aAcompaniamientoData
 });


 oVizFrame.setModel(oModel);
 var oDataset = new sap.viz.ui5.data.FlattenedDataset({
 尺寸:[{
 名称:" rol",
 值:" {rol}"
 }],
 措施:[{
 名称:" referentes",
 值:" {referentes}"
 },{
 名称:" reconocimiento",
 值:" {reconocimiento}"
 },{
 名称:" crResiduos",
 值:" {crResiduos}"
 },{
 名称:" comSustentable",
 值:" {comSustentable}"
 },{
 名称:" alumnosEnEco",
 值:" {alumnosEnEco}"
 },{
 名称:" accionPorElClima",
 值:" {accionPorElClima}"
 }],


 数据:{
 路径:"/img/items"
 }
 });
 oVizFrame.setDataset(oDataset);


 var oFeedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":["引荐对象"]
 }),
 oFeedValueAxis1 =新的sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":[" reconocimiento"]
 }),
 oFeedValueAxis2 =新的sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":[" crResiduos"]
 }),
 oFeedValueAxis3 =新的sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":[" comSustentable"]
 }),
 oFeedValueAxis4 =新的sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":[" alumnosEnEco"]
 }),
 oFeedValueAxis5 =新的sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 "值":[" accionPorElClima"]
 }),


 oFeedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" categoryAxis",
 " type":"维度",
 "值":[" rol"]
 });


 oVizFrame.addFeed(oFeedValueAxis);
 oVizFrame.addFeed(oFeedValueAxis1);
 oVizFrame.addFeed(oFeedValueAxis2);
 oVizFrame.addFeed(oFeedValueAxis3);
 oVizFrame.addFeed(oFeedValueAxis4);
 oVizFrame.addFeed(oFeedValueAxis5);


 oVizFrame.addFeed(oFeedCategoryAxis);
 }
 

(19.1 kB)
付费偷看设置
发送
2条回答
N-Moskvin
1楼 · 2020-09-19 03:50.采纳回答

传奇名称来自vizFrame的度量标准

 var oDataset =新的sap.viz.ui5.data.FlattenedDataset({
 尺寸:[{
 名称:" rol",
 值:" {rol}"
 }],
 措施:[{
 名称:" referentes",
 值:" {referentes}"
 },{
 名称:" reconocimiento",
 值:" {reconocimiento}"
 },{
 名称:" crResiduos",//->>>将此更改为" Residuos"
 值:" {crResiduos}"
 },{
 名称:" comSustentable",
 值:" {comSustentable}"
 },{
 名称:" alumnosEnEco",
 值:" {alumnosEnEco}"
 },{
 名称:" accionPorElClima",
 值:" {accionPorElClima}"
 }],

谢谢! 它可以正常工作,但是在创建供稿项

时,我不得不再做一次修改
 oFeedValueAxis2 = new sap.viz.ui5.controls.common.feeds.FeedItem({
 " uid":" valueAxis",
 " type":" Measure",
 " values":[" crResiduos"]//我也将其更改为[" Residuos"]
 })

一周热门 更多>