Created
December 18, 2012 04:58
-
-
Save kevindoran/4325142 to your computer and use it in GitHub Desktop.
JSF composite component to render the data (and some options) for a Highchart chart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cc:interface> | |
| <cc:attribute name="name" default=""/> | |
| <cc:attribute name="series" type="nz.co.tradeintel.highcharts.ColumnChartSeries"/> | |
| </cc:interface> | |
| <cc:implementation> | |
| if(typeof options.xAxis.categories === "undefined") { | |
| options.xAxis.categories = | |
| [<ui:repeat value="#{cc.attrs.series.columns}" var="column"> | |
| '#{column.name}', | |
| </ui:repeat>]; | |
| } | |
| var data = [<ui:repeat value="#{cc.attrs.series.columns}" var="column"> | |
| #{column.value}, | |
| </ui:repeat>]; | |
| var series = { | |
| type: 'column', | |
| name: '#{cc.attrs.name}', | |
| data: data | |
| }; | |
| if(typeof options.series === "undefined") { | |
| options.series = []; | |
| } | |
| options.series.push(series); | |
| </cc:implementation> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment