Skip to Content

How to format dimension values on yAxis?

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 12, 2016 at 01:43 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.