cancel
Showing results for 
Search instead for 
Did you mean: 

How to format dimension values on yAxis?

former_member213564
Participant
0 Kudos

Hi experts,

my yAxis shows a test case (BJK, SD) and a test case creation timestamp..where and how can I set to format the timestamp?

I would like to format the timestamp as 15:43 8th Jan 16

Here is my code


var oDataset = new FlattenedDataset({

                  dimensions: [{

                      name: "Name",

                      value: "{Name}"

                  },{

                      name: "Createstamp",

                      value: "{Createstamp}"

                  }],

                  measures: [{

                      name: 'Success',

                      value: '{Success}'

                  }, ....]

   ...

})


feedCategoryAxis = new FeedItem({

                  'uid': "categoryAxis",

                  'type': "Dimension",

                  'values': ["Name", "Createstamp"]

              });

Kind regards,

Filip

Accepted Solutions (1)

Accepted Solutions (1)

former_member213564
Participant
0 Kudos

I found the answer. Add formatter in dimensions


var oDataset = new FlattenedDataset({

                  dimensions: [{

                      name: "Name",

                      value: "{Name}"

                  },{

                      name: "Createstamp",

                     value: { 

                          parts : [ "Createstamp" ], 

                          formatter : function(oCreatestamp) { 

                              // format creationstamp of a test plan for yAxis

                         if(oCreatestamp === null)

                         return oCreatestamp;

                        

                         var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "dd/MM/yyyy HH:mm"});

                         return oDateFormat.format(oCreatestamp);

                        } 

                  }

                  }],

                  measures: [{

                      name: 'Success',

                      value: '{Success}'

                  }, ....]

   ...

})

Kind regards

Filip

Answers (0)