Created
December 5, 2013 14:33
-
-
Save burhanaras/7806017 to your computer and use it in GitHub Desktop.
Bismillah
This file contains 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
import javax.faces.bean.ManagedBean; | |
import nz.co.tradeintel.highcharts.ColumnChartSeries; | |
@ManagedBean | |
public class NZEthnicPopulation2006 { | |
private ColumnChartSeries nzEuropeanSeries = new ColumnChartSeries(); | |
private ColumnChartSeries maoriSeries = new ColumnChartSeries(); | |
private ColumnChartSeries pacificSeries = new ColumnChartSeries(); | |
private ColumnChartSeries asianSeries = new ColumnChartSeries(); | |
private static String[] ageGroups = {"0-14", "15-39", "40-64", "65 and Over", "All ages"}; | |
private static int[] nzEuropeanData = {73, 71, 81, 91, 77}; | |
private static int[] maoriData = {24, 17, 10, 5, 15}; | |
private static int[] asianData = {9, 13, 8, 4, 10}; | |
private static int[] pacificData = {12, 8, 5, 2, 7}; | |
public NZEthnicPopulation2006() { | |
populateSeries(); | |
} | |
// Populate as in fill. | |
private void populateSeries() { | |
for(int i=0; i<ageGroups.length; i++) { | |
nzEuropeanSeries.addColumn(ageGroups[i], nzEuropeanData[i]); | |
maoriSeries.addColumn(ageGroups[i], maoriData[i]); | |
pacificSeries.addColumn(ageGroups[i], pacificData[i]); | |
asianSeries.addColumn(ageGroups[i], asianData[i]); | |
} | |
} | |
public ColumnChartSeries getNzEuropeanSeries() { | |
return nzEuropeanSeries; | |
} | |
public ColumnChartSeries getMaoriSeries() { | |
return maoriSeries; | |
} | |
public ColumnChartSeries getPacificSeries() { | |
return pacificSeries; | |
} | |
public ColumnChartSeries getAsianSeries() { | |
return asianSeries; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment