
"card00": {
"model": "default",
"template": "sap.ovp.cards.charts.analytical",
"settings": {
"title": "{{card00_title}}",
"subTitle": "{{card00_subTitle}}",
"entitySet": "DV_BUFFERAGESTRUC",
"kpiAnnotationPath": "com.sap.vocabularies.UI.v1.KPI#currentPeriod",
"presentationAnnotationPath": "com.sap.vocabularies.UI.v1.PresentationVariant#currentPeriod",
"navigation": "dataPointNav",
"defaultSpan": {
"rows": 12,
"cols": 2
},
"bEnableStableColors": true,
"colorPalette": [
{
"dimensionValue": "0",
"color": "sapUiChartPaletteSemanticNeutral"
},
{
"dimensionValue": "1",
"color": "sapUiChartPaletteSemanticGood"
},
{
"dimensionValue": "2",
"color": "sapUiChartPaletteSemanticCritical"
},
{
"dimensionValue": "3",
"color": "sapUiChartPaletteSemanticBad"
}
]
}
}
<Annotation Term="UI.Chart" Qualifier="currentPeriod">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/Donut"/>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
<PropertyValue Property="Measure" PropertyPath="AVGAGE"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="VIS_COLORINDEX"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
The chart takes the dimension value of "VIS_COLORINDEX" and compares that with each array element property "dimensionValue" in the colorPalette, The text is read depending on the text annotation (in my case "VIS_COLORINDEX_TEXT").
In the next step I tried to change the Chart type to something another Chart like "Column" and the Semantic Coloring was gone! To achieve Semantic Colors in other Chart Types, I had to debug a little bit deeper in the SAP UI5 Coding and finally found a solution as well.
"card00": {
"model": "default",
"template": "sap.ovp.cards.charts.analytical",
"settings": {
"title": "{{card00_title}}",
"subTitle": "{{card00_subTitle}}",
"entitySet": "DV_BUFFERAGESTRUC",
"kpiAnnotationPath": "com.sap.vocabularies.UI.v1.KPI#currentPeriod",
"presentationAnnotationPath": "com.sap.vocabularies.UI.v1.PresentationVariant#currentPeriod",
"navigation": "dataPointNav",
"defaultSpan": {
"rows": 12,
"cols": 2
},
"bEnableStableColors": false,
"colorPalette": [
{
"dimensionValue": "0",
"color": "sapUiChartPaletteSemanticNeutral"
},
{
"dimensionValue": "1",
"color": "sapUiChartPaletteSemanticGood"
},
{
"dimensionValue": "2",
"color": "sapUiChartPaletteSemanticCritical"
},
{
"dimensionValue": "3",
"color": "sapUiChartPaletteSemanticBad"
}
]
}
}
<Annotation Term="UI.Chart" Qualifier="currentPeriod">
<Record Type="UI.ChartDefinitionType">
<PropertyValue Property="ChartType" EnumMember="UI.ChartType/ColumnStacked"/>
<PropertyValue Property="Measures">
<Collection>
<PropertyPath>AVGAGE</PropertyPath>
</Collection>
</PropertyValue>
<PropertyValue Property="MeasureAttributes">
<Collection>
<Record Type="UI.ChartMeasureAttributeType">
<PropertyValue Property="Role" EnumMember="UI.ChartMeasureRoleType/Axis1"/>
<PropertyValue Property="Measure" PropertyPath="AVGAGE"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="DimensionAttributes">
<Collection>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="OBJID_SHORT"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Category"/>
</Record>
<Record Type="UI.ChartDimensionAttributeType">
<PropertyValue Property="Dimension" PropertyPath="VIS_COLORINDEX"/>
<PropertyValue Property="Role" EnumMember="UI.ChartDimensionRoleType/Series"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="Dimensions">
<Collection>
<PropertyPath>OBJID_SHORT</PropertyPath>
<PropertyPath>VIS_COLORINDEX</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
{
"dimensionValue": "0",
"color": "sapUiChartPaletteSemanticNeutral",
"legendText": "{{chart00.legend0}}"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
9 | |
7 | |
6 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 |