<core:FragmentDefinition
	xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
	xmlns="sap.m"
	xmlns:core="sap.ui.core"
	xmlns:oDataV4MicroChart="sap.fe.macros.microchart"
	template:require="{
		MODEL: 'sap/ui/model/odata/v4/AnnotationHelper',
		MICROCHART: 'sap/fe/macros/microchart/MicroChartHelper'
	}"
>

	<VBox id="{= ${this>id} || undefined}">
		<template:with path="chartAnnotation>" helper="MODEL.resolve$Path" var="chartAnnotation">
			<template:if test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Bullet' }">
				<template:then>
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.BulletMicroChart" type="XML"/>
				</template:then>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Donut' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.RadialMicroChart" type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Pie' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.HarveyBallMicroChart" type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/BarStacked' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.StackedBarMicroChart" type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Area' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.AreaMicroChart" type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Column' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.ColumnMicroChart"	type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Line' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.LineMicroChart" type="XML"/>
				</template:elseif>
				<template:elseif test="{= ${chartAnnotation>ChartType/$EnumMember} === 'com.sap.vocabularies.UI.v1.ChartType/Bar' }">
					<core:Fragment fragmentName="sap.fe.macros.microchart.fragments.ComparisonMicroChart" type="XML"/>
				</template:elseif>
				<template:else>
					<Text text="This chart type is not supported. Other Types yet to be implemented.."/>
				</template:else>
			</template:if>
		</template:with>
	</VBox>

</core:FragmentDefinition>
