Skip to content

Ti.Stackbar

grantges edited this page May 29, 2014 · 2 revisions

com.leorbrenman.tistackbar.png

id: com.leorbrenman.tistackbar

A widget for easily creating stacked bar charts and associated legend. This widget is modeled after the Morgan Stanley Wealth Management iPhone Application Asset Allocation chart

##Features

  • Widget size can be set or will fill to parent container size
  • Widget has a default setting and can be configured at instantiation time via XML, TSS or JS and can also be modified at run time using built-in methods in JS

Quick Start

Add Widget folder com.leorbrenman.tistackbar to project/app/widgets folder

Add dependency to config.json

"dependencies": {
	"com.leorbrenman.tistackbar": "1.0"
}

Add widget to screen as follows:

<Widget height="200" id="chart1" src="com.leorbrenman.tistackbar" chartTitle="ASSET ALLOCATION" chartTitleColor="#2c8fd3" labelColor="gray" />

and position and size in a view as follows:

<View height="200" right="10" left="10" top="50" backgroundColor="#f0f0f0" layout="vertical">
	<View height="10" />
	<View right="10" left="10" >
		<Widget height="200" id="chart1" src="com.leorbrenman.tistackbar" chartTitle="ASSET ALLOCATION" chartTitleColor="#2c8fd3" labelColor="gray" />
	</View>
	<View height="10" />
</View>

or in JavaScript

var x = Alloy.createWidget("com.leorbrenman.tistackbar", {});
$.containerView.add(x.getView());

or a combination:

``` AND ``` $.chart1.setData([{"type": "Equities", "val": 40}, {"type": "Fixed Income", "val": 5}, {"type": "Cash & Eq", "val": 25}, {"type": "Bonds", "val": 20}, {"type": "Alternates", "val": 20}, {"type": "Securities", "val": 5}]); ```

Other Resources

Clone this wiki locally