Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Latest commit

 

History

History
55 lines (48 loc) · 3.06 KB

tag.chart.md

File metadata and controls

55 lines (48 loc) · 3.06 KB

Chart Tag

Google charts API is a famous html5 chart tool for web. We made several templates to use it more easier, and included them into Efw as a tag. It must be used after the Client tag for jQuery and jQuery UI including.

<%@ taglib prefix="efw" uri="efw" %>
<head>
	<efw:Client/>
	<script>
		function func1(options){
			//alert(JSON.stringify(options));//to show the options as string.
			options.options.vAxis.ticks=[100,1000000];// it will be preferential to param data-ticks
		}
	</script>
</head>
<body>
	<efw:Chart id="char1" data="chart1_data" type="column" width="400" height="250" version="45.2" setoptions="func1" /> //or efw:chart , efw:CHART

	<table border=1 id="chart1_data" data-format="#,##0百万円" data-legend="bottom" data-ticks="100,1000000">
	<caption>会社業績</caption>
		<tr><th>年度</th><th data-color="red">売上高</th><th  data-color="green">営業利益</th><th data-color="blue">経常利益</th></tr>
		<tr><td>2004 年</td><td>1,000百万円</td><td>400百万円</td><td>380百万円</td></tr>
	...
	</table>
</body>

Attributes

NameRequiredDefaultDescription
idYesThe identity of the Chart tag.
dataYesThe id of a data table to the Chart tag.
typeYesThe type of the Chart tag. [ column | stackedcolumn | line | pie | donut | bar | stackedbar | area | stackedarea | scatter ].
heightNo"400"The height of Chart tag. The unit is "px".
widthNo"auto"The width of Chart tag. The unit is "px".
versionNo"current"The version of Google Chart.
setoptionsNoThe name of the customize function to set option params for google chart.
data-formatNoThe format of the data.If it is defined, the tooltip of the data will be formated.
data-legendNoThe position of the legend.[ none | left | right | top | bottom ]
data-colorNoThe color of the item. To set it with RGB or color name.
data-ticksNoThe gradations of the chart.

Methods

CallingReturningDescription
id . draw ( )voidTo draw the chart again.
id . setType ( type )voidTo set the type attribute.
id . setHeight ( height ) voidTo set the height attribute.
id . setWidth ( width ) voidTo set the width attribute.