Skip to Content
0

How to use Formatter in VizFrame Charts

Apr 05, 2017 at 07:40 AM

241

avatar image

Hi,

I have a Pie Chart showing Sales for Country. Data is coming from a table which contains column for Country,Total Sales,Currency using ODATA service.

Now I want to bind Currency also to Sales (which is present in table), how can I achieve this?

I have tried standard approach of using formatter but it is not working

pie.jpg (17.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Srikanth KV Apr 05, 2017 at 08:25 PM
0

Define another dimension for Currency in vizFrame

		<viz:VizFrame id="viz" vizType="pie">
			<viz:dataset>
			    <viz.data:FlattenedDataset data="{chartModel>/data}">
			        <viz.data:dimensions>
			            <viz.data:DimensionDefinition name="Country" value="{country}" />
			            <viz.data:DimensionDefinition name="Currency" value="{currency}" />
			        </viz.data:dimensions>
			        <viz.data:measures>
			            <viz.data:MeasureDefinition name="Sales" value="{sales}" />
			        </viz.data:measures>
			    </viz.data:FlattenedDataset>
			</viz:dataset>
			<viz:feeds>
			    <viz.feeds:FeedItem uid="size" type="Measure" values="Sales" />
			    <viz.feeds:FeedItem uid="color" type="Dimension" values="Country,Currency" />
			</viz:feeds>		
		</viz:VizFrame>	


piechart.jpg (18.1 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Srikanth.

This workaround solution can be taken. Let us know, if you ever find, how to bind two properties in same dimension.

0
Akhilesh Upadhyay Apr 05, 2017 at 10:58 AM
0

share what have you tried.

never tried but just a general idea, you can introduce one more property (value + currency) of type string and bind this property to Total Sales.

Share
10 |10000 characters needed characters left characters exceeded