Skip to Content

How to use Formatter in VizFrame Charts

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 05, 2017 at 08:25 PM

    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>	
    

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 05, 2017 at 10:58 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded