cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Chart Keeps On Loading In Sap UI5 using cap cds annotations

08-01-2023 2:51 PM
1349 views 4 comments
0 Likes
SAP Managed Tags
Subscribe



please find the annotation for chart and I have given aggregated property
annotation is perfectly working in sap Fiori elements analytical list page but not working in sap ui5

has anyone have any idea about smart chart in sap ui5 in sap btp capm cds annotations ,

does anyone got the issue smart chart keeps on loading in sap ui5 please help me with this

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

leonikussmaul
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Deepak,

You need to add annotations to aggregate the service, if you haven't already. You can try something like this, might need to play around with it based on your requirements and service definition.

annotate service.getWeeklySalesDate with@(
//Header-level annotations
Aggregation.ApplySupported: {
  PropertyRestrictions: true,
  Transformations: [
    'aggregate',
    'topcount',
    'bottomcount',
    'identity',
    'concat',
    'groupby',
    'filter',
    'expand',
    'top',
    'skip',
    'orderby',
    'search'
  ],
  AggregatableProperties: [
    {
      $Type: 'Aggregation.AggregatablePropertyType',
      Property: WEEK_DATE
    },
    {
      $Type: 'Aggregation.AggregatablePropertyType',
      Property: QUANTITY
    }
  ],
  GroupableProperties: [
    WEEK_DATE,
    QUANTITY
  ]
},
//UI annotation
UI: {
  Chart: {
    Title: 'Default',
    Description: 'Default chart',
    ChartType: #Column,
    Dimensions: [
      WEEK_DATE
    ],
    Measures: [
      QUANTITY
    ],
    DimensionAttributes: [
      {
        $Type: 'UI.ChartDimensionAttributeType',
        Dimension: WEEK_DATE,
        Role: #Series
      }
    ]
  }
})
{
//Element-level annotations
WEEK_DATE@(title: '{i18n>WEEK_DATE}',
  Analytics.Dimension: true,
  Role: #Series);QUANTITY@(title: '{i18n>QUANTITY}',
  Analytics.Measure: true,
  Aggregation.default: #SUM,
  );
}
0 Likes

Hi @leoni_kussmaul ,

Thanks a Lot for your Answer
but the thing is all the annotations which your clearly provided are already added in my annotation.cds file respect to that entity but smart chart keeps on loading ,
whatever annotations you provided help me double check if anything missing

stills chart doest show in smart chart but it is working in analytical list page template but in basic templte smart chart control it isn't working
again Thank You for your Reply !!

leonikussmaul
Product and Topic Expert
Product and Topic Expert
0 Likes

Any errors in the console?

Maybe try removing activateTimeSeries property for now as this requires the correct annotations as well..

0 Likes


iam getting this error in console everytime when I load application and chart keeps on loading and also tried removing activatetimeseries property still same error is showing