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>
Name | Required | Default | Description |
id | Yes | | The identity of the Chart tag. |
data | Yes | | The id of a data table to the Chart tag. |
type | Yes | | The type of the Chart tag. [ column | stackedcolumn | line | pie | donut | bar | stackedbar | area | stackedarea | scatter ]. |
height | No | "400" | The height of Chart tag. The unit is "px". |
width | No | "auto" | The width of Chart tag. The unit is "px". |
version | No | "current" | The version of Google Chart. |
setoptions | No | | The name of the customize function to set option params for google chart. |
data-format | No | | The format of the data.If it is defined, the tooltip of the data will be formated. |
data-legend | No | | The position of the legend.[ none | left | right | top | bottom ] |
data-color | No | | The color of the item. To set it with RGB or color name. |
data-ticks | No | | The gradations of the chart. |
Calling | Returning | Description |
id . draw ( ) | void | To draw the chart again. |
id . setType ( type ) | void | To set the type attribute. |
id . setHeight ( height ) | void | To set the height attribute. |
id . setWidth ( width ) | void | To set the width attribute. |