Skip to Content
0

View -> VizFrame -> vizProperties -> i18n ?

Sep 13, 2017 at 06:03 AM

182

avatar image

Hey there,

I'm currently struggling with VizFrame ...

The situation:

I have defined the whole VizFrame in my view like this:

<viz:VizFrame 
	busy="{settingsModel>/busy}"
	busyIndicatorDelay="{settingsModel>/busyIndicatorDelay}"
	xmlns="sap.viz" id="chart_5" width="100%" vizType="stacked_column" uiConfig="{applicationSet:'fiori'}"
	vizProperties="{ valueAxis: { title: { visible: true, text: 'foo Items (pcs)' } },title: { visible: false }, plotArea: { colorPalette: ['#00b482', '#6e6e6e', '#711e82', '#40c7a1', '#969696'] } }">
	<viz:dataset>
		<viz.data:FlattenedDataset>
			<viz.data:dimensions>
				<viz.data:DimensionDefinition name="{i18n>year}" value="{YEAR}" identity="idYear"/>
				<viz.data:DimensionDefinition name="{i18n>month}" value="{MONTH}" identity="idMonth"/>
			</viz.data:dimensions>
			<viz.data:measures>
				<viz.data:MeasureDefinition name="{i18n>no}" value="{S_NO}" identity="idNo"/>
				<viz.data:MeasureDefinition name="{i18n>refurbished}" value="{S_SURFACE_REFURBISHED}" identity="idSurfaceRefurbished"/>
				<viz.data:MeasureDefinition name="{i18n>corrosion}" value="{S_CORROSION}" identity="idCorrosion"/>
			</viz.data:measures>
		</viz.data:FlattenedDataset>
	</viz:dataset>
	<viz:feeds>
		<viz.feeds:FeedItem uid="valueAxis" type="Measure" values="idNo,idSurfaceRefurbished,idCorrosion"/>
		<viz.feeds:FeedItem uid="categoryAxis" type="Dimension" values="idMonth,idYear"/>
	</viz:feeds>
</viz:VizFrame>

Works like a charm, except for the y-axis title... Normally I would get a axis title having all my three measures. But I want a different one, "Items (pcs.)". So I declared the valuue axis title in vizProperties. Works as well.

The problem is: I'm not able to apply an i18n'ed value in vizProperties.

I tried different things, like:

izProperties="{ valueAxis: { title: { visible: true, text: '{i18n>pieces}' } },title: { visible: false }, plotArea: { colorPalette: ['#00b482', '#6e6e6e', '#711e82', '#40c7a1', '#969696'] } }"
But the title I get is: "{i18n>pieces}", instead of the i18n'ed text.

Question:

Is this actually possible to have i18n in vizProperties, diretly in view?

If yes: How?

best regards,

Alex

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Vedaradhya Agrahar Oct 11, 2017 at 05:46 AM
1

Hi Alex,

It is possible to have i18n in vizProperties using Expression binding

Simple Example Here:

vizProperties="{= {valueAxis: { title: { visible: true, text: ${i18n>pieces} } } } }"

Regards,

Vedaradhya.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Sorry, tried this at first. Did not work at all. The expression "${i18n>pieces}" is not getting evaluated at all. It works everything else but vizProperties attribute...

[update]

Ah, I just saw that your string looks different:

yours: {= {valueAxis: { title: { visible: true, text: ${i18n>pieces} } } } }

mine: { valueAxis: { title: { visible: true, text: '{i18n>pieces}' } } }

there's an additional "=" ...

I will test it...

0
Pawan Kalyan Apr 08 at 05:14 AM
0

Hi Agrahar,

I am facing an issue with viz charts + selection screen. On click of Filter Bar go button, i need to display my viz frame .

without filterbar , i was getting a viz chart . but after keeping my selection screen , i was getting invalid data binding error in place of my viz frame.

i request you to please help me. complete details of code and error details are mentioned in the below link .. please help

https://answers.sap.com/questions/477815/invalid-data-binding-in-bar-chart-sap-ui5-viz-char.html

Share
10 |10000 characters needed characters left characters exceeded