'How to set fixed y-axis values in SAPUI5 VizFrame Column Chart using XMLView?
I have created a VizFrame Column Chart in SAPUI5 using oData. Now I need to put fixed values in y-axis (Dimension axis) since I want to show the days of the week on the y-axis, and how many hours worked in which day using the x-axis. Since I use oData date values I got from SAP, I can only show those values, but I want to show all the days in that week.
- How can I set fixed scale for y-axis, and then fill those values with oData?
- I want to show the time of work in the same days to be added, but I get only one value for a day, it does not add up with different data with the same date
- I also cannot format the Time value as HH:mm:ss setting, when I try to format like that, it does not show the column data. The formatting works on sap.ui.Table, but not on the VizFrame.
My code in XMLView is as follows:
<viz:VizFrame id="idVizFrame" width="100%" vizType='column' vizProperties="{title: {text: 'Weekly Timesheet Chart'}}">
<viz:dataset>
<viz.data:FlattenedDataset data="{/TasksSet}">
<viz.data:dimensions>
<viz.data:DimensionDefinition name="JobDate" value="{ path: 'JobDate', type: 'sap.ui.model.type.Date', formatOptions: {source: {pattern: 'yyyy-MM-dd'}, pattern: 'dd.MM.yyyy' } }" />
</viz.data:dimensions>
<viz.data:measures>
<viz.data:MeasureDefinition name="Duration"
value="{path: 'Duration', type: 'sap.ui.model.type.Time', formatOptions: {source:{pattern: 'HHmmss'},pattern: 'HH:mm:ss'}} "/>
</viz.data:measures>
</viz.data:FlattenedDataset>
</viz:dataset>
<viz:feeds>
<viz.feeds:FeedItem id='valueAxisFeed' uid="valueAxis" type="Measure" values="Duration"/>
<viz.feeds:FeedItem id='categoryAxisFeed' uid="categoryAxis" type="Dimension" values="JobDate"/>
</viz:feeds>
</viz:VizFrame>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|