├── .gitignore ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.apt.core.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.jdt.ui.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.validation.prefs └── org.maven.ide.eclipse.prefs ├── README.md ├── pom.xml └── src ├── main ├── java │ └── nl │ │ └── topicus │ │ └── whighcharts │ │ ├── components │ │ ├── WHighChart.java │ │ ├── WHighChartsExtraJavaScriptResourceReference.java │ │ ├── WHighChartsJavaScriptResourceReference.java │ │ ├── adapters │ │ │ ├── WHighChartsMooToolsJavaScriptResourceReference.java │ │ │ └── WHighChartsPrototypeJavaScriptResourceReference.java │ │ ├── modules │ │ │ └── WHighChartsExportingJavaScriptResourceReference.java │ │ └── themes │ │ │ └── WHighChartsThemeJavaScriptResourceReference.java │ │ └── options │ │ ├── WHighChartFunction.java │ │ ├── WHighChartFunctionCallback.java │ │ ├── WHighChartFunctionString.java │ │ ├── WHighChartGlobalSettings.java │ │ ├── WHighChartHorizontalAlignmentType.java │ │ ├── WHighChartMarkerStateOptions.java │ │ ├── WHighChartMarkerStateType.java │ │ ├── WHighChartMarkerStatesOptions.java │ │ ├── WHighChartOptions.java │ │ ├── WHighChartPointerType.java │ │ ├── WHighChartStyleOptions.java │ │ ├── WHighChartVerticalAlignmentType.java │ │ ├── axis │ │ ├── IWHighChartAxisCategoriesProvider.java │ │ ├── WHighChartAxisDateTimeLabelFormats.java │ │ ├── WHighChartAxisLabelsOptions.java │ │ ├── WHighChartAxisOptions.java │ │ ├── WHighChartAxisPlotBandsOptions.java │ │ ├── WHighChartAxisPlotLinesLabelOptions.java │ │ └── WHighChartAxisPlotLinesOptions.java │ │ ├── chart │ │ ├── WHighChartChartEventsOptions.java │ │ ├── WHighChartChartOptions.java │ │ ├── WHighChartChartOptionsType.java │ │ └── WHighChartChartOptionsZoomType.java │ │ ├── credits │ │ ├── WHighChartCreditsOptions.java │ │ └── WHighChartCreditsOptionsOptions.java │ │ ├── exporting │ │ └── WHighChartExportingOptions.java │ │ ├── global │ │ └── WHighChartGlobalOptions.java │ │ ├── jackson │ │ ├── ComponentMarkupIdSerializer.java │ │ ├── ToStringNoQuoteSerializer.java │ │ └── ToStringNoQuoteWithCurlyBracketsSerializer.java │ │ ├── labels │ │ └── WHighChartLabelsOptions.java │ │ ├── lang │ │ └── WHighChartLangOptions.java │ │ ├── legend │ │ ├── WHighChartLegendLayoutType.java │ │ └── WHighChartLegendOptions.java │ │ ├── loading │ │ └── WHighChartLoadingOptions.java │ │ ├── navigation │ │ └── WHighChartNavigationOptions.java │ │ ├── plotoptions │ │ ├── AbstractWHighChartPlotChartOptions.java │ │ ├── WHighChartPlotAreaMarkerOptions.java │ │ ├── WHighChartPlotAreaMarkerSymbolType.java │ │ ├── WHighChartPlotAreaOptions.java │ │ ├── WHighChartPlotBarOptions.java │ │ ├── WHighChartPlotChartPointEventsOptions.java │ │ ├── WHighChartPlotChartPointOptions.java │ │ ├── WHighChartPlotColumnOptions.java │ │ ├── WHighChartPlotDashStyleType.java │ │ ├── WHighChartPlotDataLabelsOptions.java │ │ ├── WHighChartPlotOptions.java │ │ ├── WHighChartPlotPieOptions.java │ │ └── WHighChartPlotSeriesOptions.java │ │ ├── point │ │ ├── WHighChartPointEventsOptions.java │ │ └── WHighChartPointOptions.java │ │ ├── series │ │ ├── AbstractSeries.java │ │ ├── ISeries.java │ │ ├── ISeriesEntry.java │ │ ├── IntegerSeries.java │ │ ├── IntegerSeriesEntry.java │ │ ├── KeyValueSeries.java │ │ ├── KeyValueSeriesEntry.java │ │ ├── ObjectSeries.java │ │ ├── ObjectSeriesEntry.java │ │ ├── ToStringSeries.java │ │ ├── ToStringSeriesEntry.java │ │ ├── ValueSeries.java │ │ ├── ValueSeriesEntry.java │ │ └── WHighChartSeriesDataLabelsOptions.java │ │ ├── symbols │ │ └── WHighChartSymbolsOptionsType.java │ │ ├── title │ │ └── WHighChartTitleOptions.java │ │ └── tooltip │ │ └── WHighChartTooltipOptions.java └── resources │ ├── log4j.properties │ └── nl │ └── topicus │ └── whighcharts │ └── components │ ├── adapters │ ├── jquery.highcharts.mootools-adapter.js │ ├── jquery.highcharts.mootools-adapter.min.js │ ├── jquery.highcharts.prototype-adapter.js │ └── jquery.highcharts.prototype-adapter.min.js │ ├── jquery.highcharts.js │ ├── jquery.highcharts.min.js │ ├── jquery.whighcharts.js │ ├── jquery.whighcharts.min.js │ ├── modules │ ├── jquery.highcharts.exporting.js │ └── jquery.highcharts.exporting.min.js │ └── themes │ ├── jquery.highcharts.dark-blue.js │ ├── jquery.highcharts.dark-green.js │ ├── jquery.highcharts.gray.js │ ├── jquery.highcharts.grid.js │ └── jquery.highcharts.skies.js └── test ├── java └── nl │ └── topicus │ └── whighcharts │ ├── Start.java │ └── web │ ├── WicketApplication.java │ └── pages │ ├── BasePage.html │ ├── BasePage.java │ ├── HomePage.html │ ├── HomePage.java │ └── examples │ ├── AjaxBasicPage.html │ ├── AjaxBasicPage.java │ ├── AreaBasicPage.html │ ├── AreaBasicPage.java │ ├── AreaInvertedPage.html │ ├── AreaInvertedPage.java │ ├── AreaMissingPage.html │ ├── AreaMissingPage.java │ ├── AreaNegativePage.html │ ├── AreaNegativePage.java │ ├── AreasplinePage.html │ └── AreasplinePage.java └── webapp └── WEB-INF └── web.xml /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | target/ 4 | bin/ 5 | *.log 6 | .DS_Store 7 | rebel.xml 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.apt.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri May 21 16:03:27 CEST 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.apt.aptEnabled=true 4 | org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations 5 | org.eclipse.jdt.apt.reconcileEnabled=true 6 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | #Mon Mar 01 11:51:23 CET 2010 2 | DELEGATES_PREFERENCE=delegateValidatorList 3 | USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 4 | USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; 5 | USER_PREFERENCE=overrideGlobalPreferencesfalse 6 | eclipse.preferences.version=1 7 | override=false 8 | suspend=false 9 | vf.version=3 10 | -------------------------------------------------------------------------------- /.settings/org.maven.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | #Fri Feb 20 08:35:33 CET 2009 2 | activeProfiles= 3 | eclipse.preferences.version=1 4 | fullBuildGoals=process-test-resources 5 | includeModules=false 6 | resolveWorkspaceProjects=true 7 | resourceFilterGoals=process-resources resources\:testResources 8 | skipCompilerPlugin=true 9 | version=1 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Topicus WHighCharts 2 | ====================== 3 | 4 | This project provides WiQuery bindings for HighCharts. 5 | 6 | NOTE: HighCharts uses the Creative Commons Attribution-NonCommercial 3.0 License for non-commercial use. However the Highslide Software License is appropriate if you run a commercial website or project, a corporate intranet or a government agency project. 7 | See http://www.highcharts.com/license for more information. 8 | 9 | Repository 10 | ====================== 11 | WHighCharts is released to an free open source repository, currently all releases are placed in the staging repository: 12 | http://oss.sonatype.org/content/groups/staging/ -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.sonatype.oss 6 | oss-parent 7 | 7 8 | 9 | 10 | 11 | 3.0.4 12 | 13 | 14 | nl.topicus 15 | whighcharts 16 | jar 17 | 8.0-SNAPSHOT 18 | WHighCharts 19 | 20 | https://github.com/hielkehoeve/wiquery-highcharts/wiki 21 | 22 | git@github.com:hielkehoeve/wiquery-highcharts.git 23 | scm:git:git@github.com:hielkehoeve/wiquery-highcharts.git 24 | scm:git:git@github.com:hielkehoeve/wiquery-highcharts.git 25 | 26 | 27 | 28 | 29 | release 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-gpg-plugin 35 | 36 | 37 | sign-artifacts 38 | verify 39 | 40 | sign 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | UTF-8 52 | 8.0-SNAPSHOT 53 | 8.0.0-M9 54 | [1.7,1.7.12] 55 | 9.0.7.v20131107 56 | 57 | 1.0 58 | 2.4.0 59 | 3.3 60 | 2.10 61 | 1.6 62 | 2.4 63 | 64 | 65 | 66 | 67 | hielkehoeve 68 | Hielke Hoeve 69 | http://nl.linkedin.com/in/hielkehoeve 70 | hielke.hoeve@gmail.com 71 | GMT+1 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | org.apache.wicket 80 | wicket-core 81 | ${wicket.version} 82 | 83 | 84 | org.apache.wicket 85 | wicket-request 86 | ${wicket.version} 87 | 88 | 89 | 90 | 91 | org.wicketstuff.wiquery 92 | wiquery-core 93 | ${wiquery.version} 94 | 95 | 97 | 98 | org.wicketstuff.wiquery 99 | wiquery-core 100 | ${wiquery.version} 101 | tests 102 | 103 | 104 | org.wicketstuff.wiquery 105 | wiquery-jquery-ui 106 | ${wiquery.version} 107 | 108 | 109 | 110 | 111 | org.slf4j 112 | slf4j-api 113 | ${slf4j.version} 114 | 115 | 116 | 117 | 118 | org.slf4j 119 | slf4j-log4j12 120 | ${slf4j.version} 121 | 122 | 123 | org.eclipse.jetty 124 | jetty-plus 125 | ${jetty.version} 126 | 127 | 128 | 129 | 130 | 131 | 132 | org.wicketstuff.wiquery 133 | wiquery-core 134 | 135 | 136 | org.wicketstuff.wiquery 137 | wiquery-jquery-ui 138 | 139 | 140 | 141 | 142 | org.slf4j 143 | slf4j-log4j12 144 | test 145 | 146 | 147 | org.eclipse.jetty 148 | jetty-plus 149 | test 150 | 151 | 152 | 153 | 154 | 155 | 156 | false 157 | src/main/resources 158 | 159 | 160 | false 161 | src/main/java 162 | 163 | ** 164 | 165 | 166 | **/*.java 167 | 168 | 169 | 170 | 171 | 172 | false 173 | src/test/java 174 | 175 | ** 176 | 177 | 178 | **/*.java 179 | 180 | 181 | 182 | 183 | 184 | org.apache.maven.plugins 185 | maven-compiler-plugin 186 | ${maven-compiler-plugin.version} 187 | true 188 | 189 | 1.8 190 | 1.8 191 | UTF-8 192 | true 193 | true 194 | 195 | 196 | 197 | org.apache.maven.plugins 198 | maven-source-plugin 199 | ${maven-source-plugin.version} 200 | 201 | 202 | attach-sources 203 | 204 | jar 205 | 206 | 207 | 208 | 209 | 210 | maven-eclipse-plugin 211 | ${maven-eclipse-plugin.version} 212 | true 213 | 214 | true 215 | false 216 | 217 | 218 | 219 | org.apache.maven.plugins 220 | maven-gpg-plugin 221 | ${maven-gpg-plugin.version} 222 | 223 | 224 | org.eclipse.jetty 225 | jetty-maven-plugin 226 | ${jetty.version} 227 | 228 | 229 | 230 | 231 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/WHighChart.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components; 2 | 3 | import java.io.IOException; 4 | import java.util.Collection; 5 | 6 | import org.apache.wicket.Application; 7 | import org.apache.wicket.RuntimeConfigurationType; 8 | import org.apache.wicket.markup.head.IHeaderResponse; 9 | import org.apache.wicket.markup.head.JavaScriptHeaderItem; 10 | import org.apache.wicket.markup.head.OnDomReadyHeaderItem; 11 | import org.apache.wicket.markup.html.WebMarkupContainer; 12 | import org.apache.wicket.model.IModel; 13 | import org.wicketstuff.wiquery.core.javascript.JsStatement; 14 | 15 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 16 | import com.fasterxml.jackson.core.JsonGenerationException; 17 | import com.fasterxml.jackson.core.JsonGenerator; 18 | import com.fasterxml.jackson.databind.JsonMappingException; 19 | import com.fasterxml.jackson.databind.ObjectMapper; 20 | import com.fasterxml.jackson.databind.SerializationFeature; 21 | 22 | import nl.topicus.whighcharts.components.modules.WHighChartsExportingJavaScriptResourceReference; 23 | import nl.topicus.whighcharts.options.WHighChartGlobalSettings; 24 | import nl.topicus.whighcharts.options.WHighChartOptions; 25 | import nl.topicus.whighcharts.options.axis.IWHighChartAxisCategoriesProvider; 26 | import nl.topicus.whighcharts.options.series.ISeries; 27 | import nl.topicus.whighcharts.options.series.ISeriesEntry; 28 | 29 | public class WHighChart> extends WebMarkupContainer 30 | { 31 | private static final long serialVersionUID = 1L; 32 | 33 | private WHighChartOptions options = new WHighChartOptions(this); 34 | 35 | private WHighChartGlobalSettings globalSettings = new WHighChartGlobalSettings(); 36 | 37 | public WHighChart(String id) 38 | { 39 | this(id, null); 40 | } 41 | 42 | public WHighChart(String id, IModel< ? extends Collection< ? extends ISeries>> model) 43 | { 44 | super(id, model); 45 | setOutputMarkupId(true); 46 | } 47 | 48 | public WHighChartOptions getOptions() 49 | { 50 | return options; 51 | } 52 | 53 | public WHighChartGlobalSettings getGlobalSettings() 54 | { 55 | return globalSettings; 56 | } 57 | 58 | @Override 59 | public void renderHead(IHeaderResponse response) 60 | { 61 | response.render( 62 | JavaScriptHeaderItem.forReference(WHighChartsJavaScriptResourceReference.get())); 63 | response.render( 64 | JavaScriptHeaderItem.forReference(WHighChartsExtraJavaScriptResourceReference.get())); 65 | 66 | if (getOptions().getExporting().getEnabled() != null 67 | && getOptions().getExporting().getEnabled().booleanValue()) 68 | response.render(JavaScriptHeaderItem 69 | .forReference(WHighChartsExportingJavaScriptResourceReference.get())); 70 | response.render(JavaScriptHeaderItem.forScript("var " + getMarkupId() + ";", 71 | "highchart_" + getMarkupId())); 72 | response.render(OnDomReadyHeaderItem.forScript(statement().render().toString())); 73 | } 74 | 75 | public JsStatement statement() 76 | { 77 | ObjectMapper mapper = new ObjectMapper(); 78 | mapper.setSerializationInclusion(Include.NON_NULL); 79 | mapper.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, false); 80 | 81 | if (Application.exists() && RuntimeConfigurationType.DEVELOPMENT 82 | .equals(Application.get().getConfigurationType())) 83 | mapper.configure(SerializationFeature.INDENT_OUTPUT, true); 84 | 85 | String optionsStr = "{}"; 86 | String globalOptions = "{}"; 87 | 88 | try 89 | { 90 | if (getModel() != null) 91 | { 92 | getOptions().getSeries().clear(); 93 | getOptions().getSeries().addAll(getModel().getObject()); 94 | 95 | if (getModel() instanceof IWHighChartAxisCategoriesProvider) 96 | { 97 | IWHighChartAxisCategoriesProvider categoriesProvider = 98 | (IWHighChartAxisCategoriesProvider) getModel(); 99 | 100 | if (getOptions().getxAxis().getCategories() == null 101 | || getOptions().getxAxis().getCategories().isEmpty()) 102 | { 103 | getOptions().getxAxis() 104 | .setCategories(categoriesProvider.getxAxisCategories()); 105 | } 106 | 107 | if (getOptions().getyAxis().getCategories() == null 108 | || getOptions().getyAxis().getCategories().isEmpty()) 109 | { 110 | getOptions().getyAxis() 111 | .setCategories(categoriesProvider.getyAxisCategories()); 112 | } 113 | } 114 | } 115 | 116 | optionsStr = mapper.writeValueAsString(options); 117 | globalOptions = 118 | "Highcharts.setOptions(" + mapper.writeValueAsString(getGlobalSettings()) + ");\n"; 119 | } 120 | catch (JsonGenerationException e) 121 | { 122 | e.printStackTrace(); 123 | } 124 | catch (JsonMappingException e) 125 | { 126 | e.printStackTrace(); 127 | } 128 | catch (IOException e) 129 | { 130 | e.printStackTrace(); 131 | } 132 | 133 | JsStatement jsStatement = new JsStatement().append( 134 | globalOptions + getMarkupId() + " = new Highcharts.Chart( " + optionsStr + " );\n"); 135 | 136 | return jsStatement; 137 | } 138 | 139 | @SuppressWarnings("unchecked") 140 | public IModel< ? extends Collection< ? extends ISeries>> getModel() 141 | { 142 | return (IModel< ? extends Collection< ? extends ISeries>>) getDefaultModel(); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/WHighChartsExtraJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components; 2 | 3 | import org.apache.wicket.request.resource.JavaScriptResourceReference; 4 | 5 | public class WHighChartsExtraJavaScriptResourceReference extends JavaScriptResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private static WHighChartsExtraJavaScriptResourceReference INSTANCE = 10 | new WHighChartsExtraJavaScriptResourceReference(); 11 | 12 | private WHighChartsExtraJavaScriptResourceReference() 13 | { 14 | super(WHighChartsExtraJavaScriptResourceReference.class, "jquery.whighcharts.js"); 15 | } 16 | 17 | public static WHighChartsExtraJavaScriptResourceReference get() 18 | { 19 | return INSTANCE; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/WHighChartsJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components; 2 | 3 | import org.apache.wicket.resource.JQueryPluginResourceReference; 4 | 5 | public class WHighChartsJavaScriptResourceReference extends JQueryPluginResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private static WHighChartsJavaScriptResourceReference INSTANCE = 10 | new WHighChartsJavaScriptResourceReference(); 11 | 12 | private WHighChartsJavaScriptResourceReference() 13 | { 14 | super(WHighChartsJavaScriptResourceReference.class, "jquery.highcharts.js"); 15 | } 16 | 17 | public static WHighChartsJavaScriptResourceReference get() 18 | { 19 | return INSTANCE; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/adapters/WHighChartsMooToolsJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components.adapters; 2 | 3 | import org.apache.wicket.request.resource.JavaScriptResourceReference; 4 | 5 | public class WHighChartsMooToolsJavaScriptResourceReference extends JavaScriptResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private static WHighChartsMooToolsJavaScriptResourceReference INSTANCE = 10 | new WHighChartsMooToolsJavaScriptResourceReference(); 11 | 12 | private WHighChartsMooToolsJavaScriptResourceReference() 13 | { 14 | super(WHighChartsMooToolsJavaScriptResourceReference.class, 15 | "jquery.highcharts.mootools-adapter.js"); 16 | } 17 | 18 | public static WHighChartsMooToolsJavaScriptResourceReference get() 19 | { 20 | return INSTANCE; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/adapters/WHighChartsPrototypeJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components.adapters; 2 | 3 | import org.apache.wicket.request.resource.JavaScriptResourceReference; 4 | 5 | public class WHighChartsPrototypeJavaScriptResourceReference extends JavaScriptResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private static WHighChartsPrototypeJavaScriptResourceReference INSTANCE = 10 | new WHighChartsPrototypeJavaScriptResourceReference(); 11 | 12 | private WHighChartsPrototypeJavaScriptResourceReference() 13 | { 14 | super(WHighChartsPrototypeJavaScriptResourceReference.class, 15 | "jquery.highcharts.prototype-adapter.js"); 16 | } 17 | 18 | public static WHighChartsPrototypeJavaScriptResourceReference get() 19 | { 20 | return INSTANCE; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/modules/WHighChartsExportingJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components.modules; 2 | 3 | import org.apache.wicket.request.resource.JavaScriptResourceReference; 4 | 5 | public class WHighChartsExportingJavaScriptResourceReference extends JavaScriptResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private static WHighChartsExportingJavaScriptResourceReference INSTANCE = 10 | new WHighChartsExportingJavaScriptResourceReference(); 11 | 12 | private WHighChartsExportingJavaScriptResourceReference() 13 | { 14 | super(WHighChartsExportingJavaScriptResourceReference.class, 15 | "jquery.highcharts.exporting.js"); 16 | } 17 | 18 | public static WHighChartsExportingJavaScriptResourceReference get() 19 | { 20 | return INSTANCE; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/components/themes/WHighChartsThemeJavaScriptResourceReference.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.components.themes; 2 | 3 | import org.apache.wicket.request.resource.JavaScriptResourceReference; 4 | 5 | public class WHighChartsThemeJavaScriptResourceReference extends JavaScriptResourceReference 6 | { 7 | private static final long serialVersionUID = -4771815414204892357L; 8 | 9 | private WHighChartsThemeJavaScriptResourceReference(String theme) 10 | { 11 | super(WHighChartsThemeJavaScriptResourceReference.class, "jquery.highcharts." + theme 12 | + ".js"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartFunction.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import java.io.Serializable; 4 | 5 | import org.apache.wicket.request.IRequestParameters; 6 | import org.apache.wicket.util.string.StringValue; 7 | 8 | public interface WHighChartFunction extends Serializable 9 | { 10 | public static class WHighChartFunctionEvent implements Serializable 11 | { 12 | public WHighChartFunctionEvent(IRequestParameters map) 13 | { 14 | name = getValue(map, "event.currentTarget.name"); 15 | visible = getValue(map, "this.visible"); 16 | category = getValue(map, "event.point.category"); 17 | config = getValue(map, "event.point.config"); 18 | x = getValue(map, "this.x"); 19 | y = getValue(map, "this.y"); 20 | type = getValue(map, "event.type"); 21 | 22 | altKey = getValue(map, "event.altKey"); 23 | ctrlKey = getValue(map, "event.ctrlKey"); 24 | shiftKey = getValue(map, "event.shiftKey"); 25 | checked = getValue(map, "event.checked"); 26 | 27 | chartX = getValue(map, "event.chartX"); 28 | chartY = getValue(map, "event.chartY"); 29 | 30 | xAxis = new WHighChartFunctionEventAxis(map, "event.xAxis0"); 31 | yAxis = new WHighChartFunctionEventAxis(map, "event.yAxis0"); 32 | 33 | } 34 | 35 | private String getValue(IRequestParameters map, String key) 36 | { 37 | org.apache.wicket.util.string.StringValue values = map.getParameterValue(key); 38 | if (values == null) 39 | return null; 40 | 41 | String value = values.toString(""); 42 | if (value != null && value.trim().length() > 0 && !value.trim().startsWith("undefined")) 43 | return value; 44 | 45 | return null; 46 | } 47 | 48 | private static final long serialVersionUID = 1L; 49 | 50 | private String altKey; 51 | 52 | private String name; 53 | 54 | private String visible; 55 | 56 | private String category; 57 | 58 | private String config; 59 | 60 | private String x; 61 | 62 | private String y; 63 | 64 | private String type; 65 | 66 | private String ctrlKey; 67 | 68 | private String shiftKey; 69 | 70 | private String checked; 71 | 72 | private String chartX; 73 | 74 | private String chartY; 75 | 76 | private WHighChartFunctionEventAxis xAxis; 77 | 78 | private WHighChartFunctionEventAxis yAxis; 79 | 80 | public String getAltKey() 81 | { 82 | return altKey; 83 | } 84 | 85 | public String getName() 86 | { 87 | return name; 88 | } 89 | 90 | public String getVisible() 91 | { 92 | return visible; 93 | } 94 | 95 | public String getCategory() 96 | { 97 | return category; 98 | } 99 | 100 | public String getConfig() 101 | { 102 | return config; 103 | } 104 | 105 | public String getX() 106 | { 107 | return x; 108 | } 109 | 110 | public String getY() 111 | { 112 | return y; 113 | } 114 | 115 | public String getType() 116 | { 117 | return type; 118 | } 119 | 120 | public String getCtrlKey() 121 | { 122 | return ctrlKey; 123 | } 124 | 125 | public String getShiftKey() 126 | { 127 | return shiftKey; 128 | } 129 | 130 | public String getChecked() 131 | { 132 | return checked; 133 | } 134 | 135 | public String getChartX() 136 | { 137 | return chartX; 138 | } 139 | 140 | public String getChartY() 141 | { 142 | return chartY; 143 | } 144 | 145 | public WHighChartFunctionEventAxis getxAxis() 146 | { 147 | return xAxis; 148 | } 149 | 150 | public WHighChartFunctionEventAxis getyAxis() 151 | { 152 | return yAxis; 153 | } 154 | } 155 | 156 | public static class WHighChartFunctionEventAxis implements Serializable 157 | { 158 | private static final long serialVersionUID = 1L; 159 | 160 | private String value; 161 | 162 | private String min; 163 | 164 | private String max; 165 | 166 | public WHighChartFunctionEventAxis(String value, String min, String max) 167 | { 168 | super(); 169 | this.value = value; 170 | this.min = min; 171 | this.max = max; 172 | } 173 | 174 | public WHighChartFunctionEventAxis(IRequestParameters map, String string) 175 | { 176 | value = getValue(map, string + ".value"); 177 | min = getValue(map, string + ".min"); 178 | max = getValue(map, string + ".max"); 179 | } 180 | 181 | @SuppressWarnings("hiding") 182 | private String getValue(IRequestParameters map, String key) 183 | { 184 | StringValue values = map.getParameterValue(key); 185 | if (values == null) 186 | return null; 187 | 188 | String value = values.toString(""); 189 | if (value != null && value.trim().length() > 0 && !value.trim().startsWith("undefined")) 190 | return value; 191 | 192 | return null; 193 | } 194 | 195 | public String getValue() 196 | { 197 | return value; 198 | } 199 | 200 | public String getMin() 201 | { 202 | return min; 203 | } 204 | 205 | public String getMax() 206 | { 207 | return max; 208 | } 209 | } 210 | 211 | /** 212 | *

213 | * Implementors must implement this function and place the following annotation on the 214 | * class: 215 | *

216 | *

217 | * @JsonSerialize(using=ToStringNoQuoteSerializer) 218 | *

219 | */ 220 | @Override 221 | public String toString(); 222 | } 223 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartFunctionCallback.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import org.apache.wicket.Component; 4 | import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; 5 | import org.apache.wicket.ajax.AjaxRequestTarget; 6 | import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; 7 | import org.apache.wicket.request.IRequestParameters; 8 | import org.apache.wicket.request.cycle.RequestCycle; 9 | 10 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 11 | 12 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteSerializer; 13 | 14 | @JsonSerialize(using = ToStringNoQuoteSerializer.class) 15 | public class WHighChartFunctionCallback extends AbstractDefaultAjaxBehavior implements 16 | WHighChartFunction 17 | { 18 | private static final long serialVersionUID = 1L; 19 | 20 | public WHighChartFunctionCallback(Component component) 21 | { 22 | component.add(this); 23 | } 24 | 25 | @Override 26 | public String toString() 27 | { 28 | AjaxRequestAttributes attributes = getAttributes(); 29 | StringBuilder builder = new StringBuilder(); 30 | builder.append("function(event){ var attrs = "); 31 | builder.append(renderAjaxAttributes(getComponent(), attributes)); 32 | builder.append("; wHighChartsSerializeEvent(attrs, event); Wicket.Ajax.ajax(attrs); }"); 33 | 34 | return builder.toString(); 35 | } 36 | 37 | @Override 38 | protected void respond(AjaxRequestTarget target) 39 | { 40 | IRequestParameters map = RequestCycle.get().getRequest().getRequestParameters(); 41 | WHighChartFunctionEvent event = new WHighChartFunctionEvent(map); 42 | onEvent(event, target); 43 | } 44 | 45 | @SuppressWarnings("unused") 46 | public void onEvent(WHighChartFunctionEvent event, AjaxRequestTarget target) 47 | { 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartFunctionString.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 4 | 5 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteSerializer; 6 | 7 | @JsonSerialize(using = ToStringNoQuoteSerializer.class) 8 | public class WHighChartFunctionString implements WHighChartFunction 9 | { 10 | private static final long serialVersionUID = 1L; 11 | 12 | private String function; 13 | 14 | public WHighChartFunctionString(String function) 15 | { 16 | this.function = function; 17 | } 18 | 19 | @Override 20 | public String toString() 21 | { 22 | StringBuilder builder = new StringBuilder(); 23 | builder.append("function(event){\n "); 24 | builder.append(function); 25 | builder.append("\n }"); 26 | return builder.toString(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartGlobalSettings.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.global.WHighChartGlobalOptions; 11 | import nl.topicus.whighcharts.options.lang.WHighChartLangOptions; 12 | 13 | /** 14 | * Contains settings that must be set globally using Highcharts.setOptions, rather than 15 | * during the chart initiation. Currently consists of global options and language options. 16 | * 17 | */ 18 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 19 | @JsonInclude(Include.NON_NULL) 20 | public class WHighChartGlobalSettings implements Serializable 21 | { 22 | private static final long serialVersionUID = 1L; 23 | 24 | private WHighChartGlobalOptions global; 25 | 26 | private WHighChartLangOptions lang; 27 | 28 | public WHighChartGlobalOptions getGlobal() 29 | { 30 | if (global == null) 31 | global = new WHighChartGlobalOptions(); 32 | 33 | return global; 34 | } 35 | 36 | public WHighChartLangOptions getLang() 37 | { 38 | if (lang == null) 39 | lang = new WHighChartLangOptions(); 40 | 41 | return lang; 42 | } 43 | 44 | public WHighChartGlobalSettings setGlobal(WHighChartGlobalOptions global) 45 | { 46 | this.global = global; 47 | return this; 48 | } 49 | 50 | public WHighChartGlobalSettings setLang(WHighChartLangOptions lang) 51 | { 52 | this.lang = lang; 53 | return this; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartHorizontalAlignmentType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | public enum WHighChartHorizontalAlignmentType 4 | { 5 | left, 6 | center, 7 | right; 8 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartMarkerStateOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartMarkerStateOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * Enable or disable the point marker. Defaults to true. 18 | */ 19 | private Boolean enabled; 20 | 21 | /** 22 | * The fill color of the point marker. When null, the series' or point's color is 23 | * used. Defaults to null. 24 | */ 25 | private String fillColor; 26 | 27 | /** 28 | * The color of the point marker's outline. When null, the series' or point's color is 29 | * used. Defaults to "#FFFFFF". 30 | */ 31 | private String lineColor; 32 | 33 | /** 34 | * The width of the point marker's outline. Defaults to 0. 35 | */ 36 | private Number lineWidth; 37 | 38 | /** 39 | * The radius of the point marker. In hover state, it defaults to the normal state's 40 | * radius + 2. 41 | */ 42 | private Number radius; 43 | 44 | public Boolean getEnabled() 45 | { 46 | return enabled; 47 | } 48 | 49 | public WHighChartMarkerStateOptions setEnabled(Boolean enabled) 50 | { 51 | this.enabled = enabled; 52 | return this; 53 | } 54 | 55 | public String getFillColor() 56 | { 57 | return fillColor; 58 | } 59 | 60 | public WHighChartMarkerStateOptions setFillColor(String fillColor) 61 | { 62 | this.fillColor = fillColor; 63 | return this; 64 | } 65 | 66 | public String getLineColor() 67 | { 68 | return lineColor; 69 | } 70 | 71 | public WHighChartMarkerStateOptions setLineColor(String lineColor) 72 | { 73 | this.lineColor = lineColor; 74 | return this; 75 | } 76 | 77 | public Number getLineWidth() 78 | { 79 | return lineWidth; 80 | } 81 | 82 | public WHighChartMarkerStateOptions setLineWidth(Number lineWidth) 83 | { 84 | this.lineWidth = lineWidth; 85 | return this; 86 | } 87 | 88 | public Number getRadius() 89 | { 90 | return radius; 91 | } 92 | 93 | public WHighChartMarkerStateOptions setRadius(Number radius) 94 | { 95 | this.radius = radius; 96 | return this; 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartMarkerStateType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | public enum WHighChartMarkerStateType 4 | { 5 | hover, 6 | select; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartMarkerStatesOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartMarkerStatesOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private WHighChartMarkerStateOptions hover; 17 | 18 | private WHighChartMarkerStateOptions select; 19 | 20 | public WHighChartMarkerStateOptions getHover() 21 | { 22 | if (hover == null) 23 | hover = new WHighChartMarkerStateOptions(); 24 | 25 | return hover; 26 | } 27 | 28 | public WHighChartMarkerStatesOptions setHover(WHighChartMarkerStateOptions hover) 29 | { 30 | this.hover = hover; 31 | return this; 32 | } 33 | 34 | public WHighChartMarkerStateOptions getSelect() 35 | { 36 | if (select == null) 37 | select = new WHighChartMarkerStateOptions(); 38 | 39 | return select; 40 | } 41 | 42 | public WHighChartMarkerStatesOptions setSelect(WHighChartMarkerStateOptions select) 43 | { 44 | this.select = select; 45 | return this; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartPointerType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | public enum WHighChartPointerType 4 | { 5 | pointer; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartStyleOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartStyleOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private String color; 17 | 18 | private String fontSize; 19 | 20 | public WHighChartStyleOptions setColor(String color) 21 | { 22 | this.color = color; 23 | return this; 24 | } 25 | 26 | public String getColor() 27 | { 28 | return color; 29 | } 30 | 31 | public WHighChartStyleOptions setFontSize(String fontSize) 32 | { 33 | this.fontSize = fontSize; 34 | return this; 35 | } 36 | 37 | public String getFontSize() 38 | { 39 | return fontSize; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/WHighChartVerticalAlignmentType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options; 2 | 3 | public enum WHighChartVerticalAlignmentType 4 | { 5 | top, 6 | middle, 7 | bottom; 8 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/IWHighChartAxisCategoriesProvider.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.util.List; 4 | 5 | public interface IWHighChartAxisCategoriesProvider 6 | { 7 | /** 8 | * @return a list of all categories available for the X axis. (should) return null 9 | * when no categories are available. 10 | */ 11 | List getxAxisCategories(); 12 | 13 | /** 14 | * @return a list of all categories available for the Y axis. (should) return null 15 | * when no categories are available. 16 | */ 17 | List getyAxisCategories(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisDateTimeLabelFormats.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartAxisDateTimeLabelFormats implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private String day; 17 | 18 | private String month; 19 | 20 | private String year; 21 | 22 | public String getDay() 23 | { 24 | return day; 25 | } 26 | 27 | public WHighChartAxisDateTimeLabelFormats setDay(String day) 28 | { 29 | this.day = day; 30 | return this; 31 | } 32 | 33 | public String getMonth() 34 | { 35 | return month; 36 | } 37 | 38 | public WHighChartAxisDateTimeLabelFormats setMonth(String month) 39 | { 40 | this.month = month; 41 | return this; 42 | } 43 | 44 | public String getYear() 45 | { 46 | return year; 47 | } 48 | 49 | public WHighChartAxisDateTimeLabelFormats setYear(String year) 50 | { 51 | this.year = year; 52 | return this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisLabelsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.WHighChartFunction; 12 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 13 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 14 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 15 | 16 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 17 | @JsonInclude(Include.NON_NULL) 18 | public class WHighChartAxisLabelsOptions implements Serializable 19 | { 20 | private static final long serialVersionUID = 1L; 21 | 22 | /** 23 | * What part of the string the given position is anchored to. Can be one of "left", 24 | * "center" or "right". In inverted charts, x axis label alignment and y axis 25 | * alignment are swapped. Defaults to "center". 26 | */ 27 | private WHighChartHorizontalAlignmentType align; 28 | 29 | /** 30 | * Enable or disable the axis labels. Defaults to true. 31 | */ 32 | private Boolean enabled; 33 | 34 | /** 35 | * Callback JavaScript function to format the label. The value is given by this.value. 36 | * Defaults to: function() { return this.value; } 37 | */ 38 | private WHighChartFunction formatter; 39 | 40 | /** 41 | * Rotation of the labels in degrees. Defaults to 0. 42 | */ 43 | private Number rotation; 44 | 45 | /** 46 | * Horizontal axes only. The number of lines to spread the labels over to make room or 47 | * tighter labels. Defaults to null. 48 | */ 49 | private Number staggerLines; 50 | 51 | /** 52 | * To show only every n'th label on the axis, set the step to n. Setting the step to 2 53 | * shows every other label. Defaults to null. 54 | */ 55 | private Number step; 56 | 57 | /** 58 | * CSS styles for the label. Defaults to: style: { color: '#6D869F', fontWeight: 59 | * 'bold' } 60 | */ 61 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 62 | @JsonInclude(value = Include.NON_NULL) 63 | private String style; 64 | 65 | /** 66 | * The x position offset of the label relative to the tick position on the axis. 67 | * Defaults to 0. 68 | */ 69 | private Number x; 70 | 71 | /** 72 | * The y position offset of the label relative to the tick position on the axis. 73 | * Defaults to 0. 74 | */ 75 | private Number y; 76 | 77 | public WHighChartHorizontalAlignmentType getAlign() 78 | { 79 | return align; 80 | } 81 | 82 | public WHighChartAxisLabelsOptions setAlign(WHighChartHorizontalAlignmentType align) 83 | { 84 | this.align = align; 85 | return this; 86 | } 87 | 88 | public Boolean isEnabled() 89 | { 90 | return enabled; 91 | } 92 | 93 | public WHighChartAxisLabelsOptions setEnabled(Boolean enabled) 94 | { 95 | this.enabled = enabled; 96 | return this; 97 | } 98 | 99 | public WHighChartFunction getFormatter() 100 | { 101 | return formatter; 102 | } 103 | 104 | public WHighChartAxisLabelsOptions setFormatter(WHighChartFunction formatter) 105 | { 106 | this.formatter = formatter; 107 | return this; 108 | } 109 | 110 | public WHighChartAxisLabelsOptions setFormatter(String formatter) 111 | { 112 | return setFormatter(new WHighChartFunctionString(formatter)); 113 | } 114 | 115 | public Number getRotation() 116 | { 117 | return rotation; 118 | } 119 | 120 | public WHighChartAxisLabelsOptions setRotation(Number rotation) 121 | { 122 | this.rotation = rotation; 123 | return this; 124 | } 125 | 126 | public Number getStaggerLines() 127 | { 128 | return staggerLines; 129 | } 130 | 131 | public WHighChartAxisLabelsOptions setStaggerLines(Number staggerLines) 132 | { 133 | this.staggerLines = staggerLines; 134 | return this; 135 | } 136 | 137 | public Number getStep() 138 | { 139 | return step; 140 | } 141 | 142 | public WHighChartAxisLabelsOptions setStep(Number step) 143 | { 144 | this.step = step; 145 | return this; 146 | } 147 | 148 | public String getStyle() 149 | { 150 | return style; 151 | } 152 | 153 | public WHighChartAxisLabelsOptions setStyle(String style) 154 | { 155 | this.style = style; 156 | return this; 157 | } 158 | 159 | public Number getX() 160 | { 161 | return x; 162 | } 163 | 164 | public WHighChartAxisLabelsOptions setX(Number x) 165 | { 166 | this.x = x; 167 | return this; 168 | } 169 | 170 | public Number getY() 171 | { 172 | return y; 173 | } 174 | 175 | public WHighChartAxisLabelsOptions setY(Number y) 176 | { 177 | this.y = y; 178 | return this; 179 | } 180 | 181 | } 182 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | 8 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 9 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 10 | import com.fasterxml.jackson.annotation.JsonInclude; 11 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 12 | 13 | import nl.topicus.whighcharts.options.title.WHighChartTitleOptions; 14 | 15 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 16 | @JsonInclude(Include.NON_NULL) 17 | public class WHighChartAxisOptions implements Serializable 18 | { 19 | private static final long serialVersionUID = 1L; 20 | 21 | public enum AxisType 22 | { 23 | linear, 24 | datetime; 25 | } 26 | 27 | private WHighChartAxisLabelsOptions labels; 28 | 29 | private WHighChartTitleOptions title; 30 | 31 | /** 32 | * If categories are present for the xAxis, names are used instead of numbers for that 33 | * axis. WHighChart note: When no categories are set here, WHighChart will check if 34 | * its model implements {@link IWHighChartAxisCategoriesProvider}. 35 | */ 36 | private List categories; 37 | 38 | private Number min; 39 | 40 | private AxisType type; 41 | 42 | private WHighChartAxisDateTimeLabelFormats dateTimeLabelFormats; 43 | 44 | private String gridLineColor; 45 | 46 | /** 47 | * An array of configuration objects for plot bands colouring parts of the plot area 48 | * background. Defaults to null. 49 | */ 50 | List plotBands; 51 | 52 | private Number gridLineWidth; 53 | 54 | List plotLines; 55 | 56 | private Number offset; 57 | 58 | private Number max; 59 | 60 | private Number tickInterval; 61 | 62 | public WHighChartAxisLabelsOptions getLabels() 63 | { 64 | if (labels == null) 65 | labels = new WHighChartAxisLabelsOptions(); 66 | 67 | return labels; 68 | } 69 | 70 | public WHighChartAxisOptions setLabels(WHighChartAxisLabelsOptions labels) 71 | { 72 | this.labels = labels; 73 | return this; 74 | } 75 | 76 | public WHighChartTitleOptions getTitle() 77 | { 78 | if (title == null) 79 | title = new WHighChartTitleOptions(); 80 | 81 | return title; 82 | } 83 | 84 | public WHighChartAxisOptions setTitle(WHighChartTitleOptions title) 85 | { 86 | this.title = title; 87 | return this; 88 | } 89 | 90 | public List getCategories() 91 | { 92 | return categories; 93 | } 94 | 95 | public WHighChartAxisOptions setCategories(List categories) 96 | { 97 | this.categories = categories; 98 | return this; 99 | } 100 | 101 | public WHighChartAxisOptions setCategories(String... values) 102 | { 103 | categories = Arrays.asList(values); 104 | return this; 105 | } 106 | 107 | public Number getMin() 108 | { 109 | return min; 110 | } 111 | 112 | public WHighChartAxisOptions setMin(Number min) 113 | { 114 | this.min = min; 115 | return this; 116 | } 117 | 118 | public List getPlotBands() 119 | { 120 | if (plotBands == null) 121 | plotBands = new ArrayList(); 122 | 123 | return plotBands; 124 | } 125 | 126 | public WHighChartAxisOptions setPlotBands(List plotBands) 127 | { 128 | this.plotBands = plotBands; 129 | return this; 130 | } 131 | 132 | public WHighChartAxisOptions addPlotBand(WHighChartAxisPlotBandsOptions plotBand) 133 | { 134 | getPlotBands().add(plotBand); 135 | return this; 136 | } 137 | 138 | public WHighChartAxisOptions setGridLineWidth(Number gridLineWidth) 139 | { 140 | this.gridLineWidth = gridLineWidth; 141 | return this; 142 | 143 | } 144 | 145 | public Number getGridLineWidth() 146 | { 147 | return gridLineWidth; 148 | } 149 | 150 | public List getPlotLines() 151 | { 152 | if (plotLines == null) 153 | plotLines = new ArrayList(); 154 | 155 | return plotLines; 156 | } 157 | 158 | public WHighChartAxisOptions setPlotLines(List plotLines) 159 | { 160 | this.plotLines = plotLines; 161 | return this; 162 | } 163 | 164 | public WHighChartAxisOptions addPlotLine(WHighChartAxisPlotLinesOptions plotLine) 165 | { 166 | getPlotLines().add(plotLine); 167 | return this; 168 | } 169 | 170 | public WHighChartAxisOptions setOffset(Number offset) 171 | { 172 | this.offset = offset; 173 | return this; 174 | } 175 | 176 | public Number getOffset() 177 | { 178 | return offset; 179 | } 180 | 181 | public WHighChartAxisOptions setMax(Number max) 182 | { 183 | this.max = max; 184 | return this; 185 | } 186 | 187 | public Number getMax() 188 | { 189 | return max; 190 | } 191 | 192 | public Number getTickInterval() 193 | { 194 | return tickInterval; 195 | } 196 | 197 | public WHighChartAxisOptions setTickInterval(Number tickInterval) 198 | { 199 | this.tickInterval = tickInterval; 200 | return this; 201 | } 202 | 203 | public AxisType getType() 204 | { 205 | return type; 206 | } 207 | 208 | public WHighChartAxisOptions setType(AxisType type) 209 | { 210 | this.type = type; 211 | return this; 212 | } 213 | 214 | public WHighChartAxisDateTimeLabelFormats getDateTimeLabelFormats() 215 | { 216 | if (dateTimeLabelFormats == null) 217 | dateTimeLabelFormats = new WHighChartAxisDateTimeLabelFormats(); 218 | return dateTimeLabelFormats; 219 | } 220 | 221 | public WHighChartAxisOptions setDateTimeLabelFormats( 222 | WHighChartAxisDateTimeLabelFormats dateTimeLabelFormats) 223 | { 224 | this.dateTimeLabelFormats = dateTimeLabelFormats; 225 | return this; 226 | } 227 | 228 | public String getGridLineColor() 229 | { 230 | return gridLineColor; 231 | } 232 | 233 | public WHighChartAxisOptions setGridLineColor(String gridLineColor) 234 | { 235 | this.gridLineColor = gridLineColor; 236 | return this; 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisPlotBandsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartAxisPlotBandsOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private String color; 17 | 18 | private Number from; 19 | 20 | private Number to; 21 | 22 | public Number getFrom() 23 | { 24 | return from; 25 | } 26 | 27 | public WHighChartAxisPlotBandsOptions setFrom(Number from) 28 | { 29 | this.from = from; 30 | return this; 31 | } 32 | 33 | public Number getTo() 34 | { 35 | return to; 36 | } 37 | 38 | public WHighChartAxisPlotBandsOptions setTo(Number to) 39 | { 40 | this.to = to; 41 | return this; 42 | } 43 | 44 | public String getColor() 45 | { 46 | return color; 47 | } 48 | 49 | public WHighChartAxisPlotBandsOptions setColor(String color) 50 | { 51 | this.color = color; 52 | return this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisPlotLinesLabelOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartStyleOptions; 11 | 12 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 13 | @JsonInclude(Include.NON_NULL) 14 | public class WHighChartAxisPlotLinesLabelOptions implements Serializable 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | private String text; 19 | 20 | private String align; 21 | 22 | private String verticalAlign; 23 | 24 | private String textAlign; 25 | 26 | private Number rotation; 27 | 28 | private Number x; 29 | 30 | private Number y; 31 | 32 | private WHighChartStyleOptions style; 33 | 34 | public String getAlign() 35 | { 36 | return align; 37 | } 38 | 39 | public WHighChartAxisPlotLinesLabelOptions setAlign(String align) 40 | { 41 | this.align = align; 42 | return this; 43 | } 44 | 45 | public WHighChartAxisPlotLinesLabelOptions setVerticalAlign(String verticalAlign) 46 | { 47 | this.verticalAlign = verticalAlign; 48 | return this; 49 | } 50 | 51 | public String getVerticalAlign() 52 | { 53 | return verticalAlign; 54 | } 55 | 56 | public WHighChartAxisPlotLinesLabelOptions setRotation(Number rotation) 57 | { 58 | this.rotation = rotation; 59 | return this; 60 | } 61 | 62 | public Number getRotation() 63 | { 64 | return rotation; 65 | } 66 | 67 | public WHighChartAxisPlotLinesLabelOptions setTextAlign(String textAlign) 68 | { 69 | this.textAlign = textAlign; 70 | return this; 71 | } 72 | 73 | public String getTextAlign() 74 | { 75 | return textAlign; 76 | } 77 | 78 | public WHighChartAxisPlotLinesLabelOptions setX(Number x) 79 | { 80 | this.x = x; 81 | return this; 82 | } 83 | 84 | public Number getX() 85 | { 86 | return x; 87 | } 88 | 89 | public WHighChartAxisPlotLinesLabelOptions setY(Number y) 90 | { 91 | this.y = y; 92 | return this; 93 | } 94 | 95 | public Number getY() 96 | { 97 | return y; 98 | } 99 | 100 | public WHighChartAxisPlotLinesLabelOptions setText(String text) 101 | { 102 | this.text = text; 103 | return this; 104 | } 105 | 106 | public String getText() 107 | { 108 | return text; 109 | } 110 | 111 | public WHighChartAxisPlotLinesLabelOptions setStyle(WHighChartStyleOptions style) 112 | { 113 | this.style = style; 114 | return this; 115 | } 116 | 117 | public WHighChartStyleOptions getStyle() 118 | { 119 | return style; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/axis/WHighChartAxisPlotLinesOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.axis; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartAxisPlotLinesOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | private String color; 17 | 18 | private Number width; 19 | 20 | private Number value; 21 | 22 | private WHighChartAxisPlotLinesLabelOptions label; 23 | 24 | public String getColor() 25 | { 26 | return color; 27 | } 28 | 29 | public WHighChartAxisPlotLinesOptions setColor(String color) 30 | { 31 | this.color = color; 32 | return this; 33 | } 34 | 35 | public WHighChartAxisPlotLinesOptions setWidth(Number width) 36 | { 37 | this.width = width; 38 | return this; 39 | } 40 | 41 | public Number getWidth() 42 | { 43 | return width; 44 | } 45 | 46 | public WHighChartAxisPlotLinesOptions setLabel(WHighChartAxisPlotLinesLabelOptions label) 47 | { 48 | this.label = label; 49 | return this; 50 | } 51 | 52 | public WHighChartAxisPlotLinesLabelOptions getLabel() 53 | { 54 | return label; 55 | } 56 | 57 | public WHighChartAxisPlotLinesOptions setValue(Number value) 58 | { 59 | this.value = value; 60 | return this; 61 | } 62 | 63 | public Number getValue() 64 | { 65 | return value; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/chart/WHighChartChartEventsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.chart; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartFunction; 11 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartChartEventsOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * Fires when a series is added to the chart after load time, using the addSeries 21 | * method. The this keyword refers to the chart object itself. One parameter, event, 22 | * is passed to the function. This contains common event information based on jQuery 23 | * or MooTools depending on which library is used as the base for Highcharts. Through 24 | * event.options you can access the series options that was passed to the addSeries 25 | * method. Returning false prevents the series from being added. 26 | */ 27 | private WHighChartFunction addSeries; 28 | 29 | /** 30 | *

31 | * Fires when clicking on the plot background. The this keyword refers to the chart 32 | * object itself. One parameter, event, is passed to the function. This contains 33 | * common event information based on jQuery or MooTools depending on which library is 34 | * used as the base for Highcharts. 35 | *

36 | * 37 | *

38 | * Information on the clicked spot can be found through event.xAxis and event.yAxis, 39 | * which are arrays containing the axes of each dimension and each axis' value at the 40 | * clicked spot. The primary axes are event.xAxis[0] and event.yAxis[0]. Remember the 41 | * unit of a datetime axis is milliseconds since 1970-01-01 00:00:00. 42 | *

43 | * 44 | *
 45 | 	 * click: function(e) {
 46 | 	 * 	console.log(
 47 | 	 * 		Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', e.xAxis[0].value),
 48 | 	 * 		e.yAxis[0].value
 49 | 	 * 	)
 50 | 	 * }
 51 | 	 * 
52 | */ 53 | private WHighChartFunction click; 54 | 55 | /** 56 | *

57 | * Fires when the chart is finished loading. The this keyword refers to the chart 58 | * object itself. One parameter, event, is passed to the function. This contains 59 | * common event information based on jQuery or MooTools depending on which library is 60 | * used as the base for Highcharts. 61 | *

62 | *

63 | * From version 2.0.4, there is also a second parameter to Highcharts.Chart where a 64 | * callback function can be passed to be executed on chart.load. 65 | *

66 | */ 67 | private WHighChartFunction load; 68 | 69 | /** 70 | * Fires when the chart is redrawn, either after a call to chart.redraw() or after an 71 | * axis, series or point is modified with the redraw option set to true. The this 72 | * keyword refers to the chart object itself. One parameter, event, is passed to the 73 | * function. This contains common event information based on jQuery or MooTools 74 | * depending on which library is used as the base for Highcharts. 75 | */ 76 | private WHighChartFunction redraw; 77 | 78 | /** 79 | *

80 | * Fires when an area of the chart has been selected. Selection is enabled by setting 81 | * the chart's zoomType. The this keyword refers to the chart object itself. One 82 | * parameter, event, is passed to the function. This contains common event information 83 | * based on jQuery or MooTools depending on which library is used as the base for 84 | * Highcharts. The default action for the selection event is to zoom the chart to the 85 | * selected area. It can be prevented by calling event.preventDefault(). 86 | *

87 | * 88 | *

89 | * Information on the selected area can be found through event.xAxis and event.yAxis, 90 | * which are arrays containing the axes of each dimension and each axis' min and max 91 | * values. The primary axes are event.xAxis[0] and event.yAxis[0]. Remember the unit 92 | * of a datetime axis is milliseconds since 1970-01-01 00:00:00. 93 | *

94 | * 95 | *
 96 | 	 * selection: function(event) {
 97 | 	 * 	// log the min and max of the primary, datetime x-axis
 98 | 	 * 	console.log(
 99 | 	 * 		Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].min),
100 | 	 * 		Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].max)
101 | 	 * 	);
102 | 	 * 	// log the min and max of the y axis
103 | 	 * 	console.log(event.yAxis[0].min, event.yAxis[0].max);
104 | 	 * }
105 | 	 * 
106 | */ 107 | private WHighChartFunction selection; 108 | 109 | public WHighChartFunction getAddSeries() 110 | { 111 | return addSeries; 112 | } 113 | 114 | public WHighChartChartEventsOptions setAddSeries(WHighChartFunction addSeries) 115 | { 116 | this.addSeries = addSeries; 117 | return this; 118 | } 119 | 120 | public WHighChartChartEventsOptions setAddSeries(String formatter) 121 | { 122 | return setAddSeries(new WHighChartFunctionString(formatter)); 123 | } 124 | 125 | public WHighChartFunction getClick() 126 | { 127 | return click; 128 | } 129 | 130 | public WHighChartChartEventsOptions setClick(WHighChartFunction click) 131 | { 132 | this.click = click; 133 | return this; 134 | } 135 | 136 | public WHighChartChartEventsOptions setClick(String formatter) 137 | { 138 | return setClick(new WHighChartFunctionString(formatter)); 139 | } 140 | 141 | public WHighChartFunction getLoad() 142 | { 143 | return load; 144 | } 145 | 146 | public WHighChartChartEventsOptions setLoad(WHighChartFunction load) 147 | { 148 | this.load = load; 149 | return this; 150 | } 151 | 152 | public WHighChartChartEventsOptions setLoad(String formatter) 153 | { 154 | return setLoad(new WHighChartFunctionString(formatter)); 155 | } 156 | 157 | public WHighChartFunction getRedraw() 158 | { 159 | return redraw; 160 | } 161 | 162 | public WHighChartChartEventsOptions setRedraw(WHighChartFunction redraw) 163 | { 164 | this.redraw = redraw; 165 | return this; 166 | } 167 | 168 | public WHighChartChartEventsOptions setRedraw(String formatter) 169 | { 170 | return setRedraw(new WHighChartFunctionString(formatter)); 171 | } 172 | 173 | public Object getSelection() 174 | { 175 | return selection; 176 | } 177 | 178 | public WHighChartChartEventsOptions setSelection(WHighChartFunction selection) 179 | { 180 | this.selection = selection; 181 | return this; 182 | } 183 | 184 | public WHighChartChartEventsOptions setSelection(String formatter) 185 | { 186 | return setSelection(new WHighChartFunctionString(formatter)); 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/chart/WHighChartChartOptionsType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.chart; 2 | 3 | public enum WHighChartChartOptionsType 4 | { 5 | line, 6 | spline, 7 | area, 8 | areaspline, 9 | column, 10 | bar, 11 | pie, 12 | scatter; 13 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/chart/WHighChartChartOptionsZoomType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.chart; 2 | 3 | public enum WHighChartChartOptionsZoomType 4 | { 5 | x, 6 | y, 7 | xy; 8 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/credits/WHighChartCreditsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.credits; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 12 | 13 | /** 14 | * Highchart by default puts a credits label in the lower right corner of the chart. This 15 | * can be changed using these options. 16 | */ 17 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 18 | @JsonInclude(Include.NON_NULL) 19 | public class WHighChartCreditsOptions implements Serializable 20 | { 21 | private static final long serialVersionUID = 1L; 22 | 23 | /** 24 | * Whether to show the credits text. Defaults to true. 25 | */ 26 | private Boolean enabled; 27 | 28 | /** 29 | * position: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 } 30 | */ 31 | private WHighChartCreditsOptionsOptions position; 32 | 33 | /** 34 | * The URL for the credits label. Defaults to "http://www.highcharts.com". 35 | */ 36 | private String href; 37 | 38 | /** 39 | * CSS styles for the credits label. Defaults to: itemStyle: { cursor: 'pointer', 40 | * color: '#909090', fontSize: '10px' } 41 | */ 42 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 43 | @JsonInclude(value = Include.NON_NULL) 44 | private String style; 45 | 46 | /** 47 | * The text for the credits label. Defaults to "Highcharts.com". 48 | */ 49 | private String text; 50 | 51 | public Boolean getEnabled() 52 | { 53 | return enabled; 54 | } 55 | 56 | public WHighChartCreditsOptions setEnabled(Boolean enabled) 57 | { 58 | this.enabled = enabled; 59 | return this; 60 | } 61 | 62 | public WHighChartCreditsOptionsOptions getPosition() 63 | { 64 | if (position == null) 65 | position = new WHighChartCreditsOptionsOptions(); 66 | 67 | return position; 68 | } 69 | 70 | public WHighChartCreditsOptions setPosition(WHighChartCreditsOptionsOptions position) 71 | { 72 | this.position = position; 73 | return this; 74 | } 75 | 76 | public String getHref() 77 | { 78 | return href; 79 | } 80 | 81 | public WHighChartCreditsOptions setHref(String href) 82 | { 83 | this.href = href; 84 | return this; 85 | } 86 | 87 | public String getStyle() 88 | { 89 | return style; 90 | } 91 | 92 | public WHighChartCreditsOptions setStyle(String style) 93 | { 94 | this.style = style; 95 | return this; 96 | } 97 | 98 | public String getText() 99 | { 100 | return text; 101 | } 102 | 103 | public WHighChartCreditsOptions setText(String text) 104 | { 105 | this.text = text; 106 | return this; 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/credits/WHighChartCreditsOptionsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.credits; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 11 | import nl.topicus.whighcharts.options.WHighChartVerticalAlignmentType; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartCreditsOptionsOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | private WHighChartHorizontalAlignmentType align; 20 | 21 | private WHighChartVerticalAlignmentType verticalAlign; 22 | 23 | private Number x; 24 | 25 | private Number y; 26 | 27 | public WHighChartHorizontalAlignmentType getAlign() 28 | { 29 | return align; 30 | } 31 | 32 | public WHighChartCreditsOptionsOptions setAlign(WHighChartHorizontalAlignmentType align) 33 | { 34 | this.align = align; 35 | return this; 36 | } 37 | 38 | public WHighChartVerticalAlignmentType getVerticalAlign() 39 | { 40 | return verticalAlign; 41 | } 42 | 43 | public WHighChartCreditsOptionsOptions setVerticalAlign( 44 | WHighChartVerticalAlignmentType verticalAlign) 45 | { 46 | this.verticalAlign = verticalAlign; 47 | return this; 48 | } 49 | 50 | public Number getX() 51 | { 52 | return x; 53 | } 54 | 55 | public WHighChartCreditsOptionsOptions setX(Number x) 56 | { 57 | this.x = x; 58 | return this; 59 | } 60 | 61 | public Number getY() 62 | { 63 | return y; 64 | } 65 | 66 | public WHighChartCreditsOptionsOptions setY(Number y) 67 | { 68 | this.y = y; 69 | return this; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/exporting/WHighChartExportingOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.exporting; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartExportingOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * Whether to enable the exporting module. Defaults to true. 18 | */ 19 | private Boolean enabled; 20 | 21 | /** 22 | * The filename, without extension, to use for the exported chart. Defaults to 23 | * "chart". 24 | */ 25 | private String filename; 26 | 27 | /** 28 | * Default MIME type for exporting if chart.exportChart() is called without specifying 29 | * a type option. Possible values are image/png, image/jpeg, application/pdf and 30 | * image/svg+xml. Defaults to "image/png". 31 | */ 32 | private String type; 33 | 34 | /** 35 | * The URL for the server module converting the SVG string to an image format. By 36 | * default this points to Highslide Software's free web service. Defaults to 37 | * http://export.highcharts.com. 38 | */ 39 | private String url; 40 | 41 | /** 42 | * The pixel width of charts exported to PNG or JPG. Defaults to 800. 43 | */ 44 | private Number width; 45 | 46 | public Boolean getEnabled() 47 | { 48 | return enabled; 49 | } 50 | 51 | public WHighChartExportingOptions setEnabled(Boolean enabled) 52 | { 53 | this.enabled = enabled; 54 | return this; 55 | } 56 | 57 | public String getFilename() 58 | { 59 | return filename; 60 | } 61 | 62 | public WHighChartExportingOptions setFilename(String filename) 63 | { 64 | this.filename = filename; 65 | return this; 66 | } 67 | 68 | public String getType() 69 | { 70 | return type; 71 | } 72 | 73 | public WHighChartExportingOptions setType(String type) 74 | { 75 | this.type = type; 76 | return this; 77 | } 78 | 79 | public String getUrl() 80 | { 81 | return url; 82 | } 83 | 84 | public WHighChartExportingOptions setUrl(String url) 85 | { 86 | this.url = url; 87 | return this; 88 | } 89 | 90 | public Number getWidth() 91 | { 92 | return width; 93 | } 94 | 95 | public WHighChartExportingOptions setWidth(Number width) 96 | { 97 | this.width = width; 98 | return this; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/global/WHighChartGlobalOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.global; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | /** 11 | * Global options that don't apply to each chart. These options, like the lang options, 12 | * must be set using the Highcharts.setOptions method. 13 | */ 14 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 15 | @JsonInclude(Include.NON_NULL) 16 | public class WHighChartGlobalOptions implements Serializable 17 | { 18 | private static final long serialVersionUID = 1L; 19 | 20 | private Boolean useUTC; 21 | 22 | public Boolean getUseUTC() 23 | { 24 | return useUTC; 25 | } 26 | 27 | public WHighChartGlobalOptions setUseUTC(Boolean useUTC) 28 | { 29 | this.useUTC = useUTC; 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/jackson/ComponentMarkupIdSerializer.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.jackson; 2 | 3 | import java.io.IOException; 4 | import java.lang.reflect.Type; 5 | 6 | import org.apache.wicket.Component; 7 | 8 | import com.fasterxml.jackson.core.JsonGenerationException; 9 | import com.fasterxml.jackson.core.JsonGenerator; 10 | import com.fasterxml.jackson.databind.JsonNode; 11 | import com.fasterxml.jackson.databind.SerializerProvider; 12 | import com.fasterxml.jackson.databind.ser.std.StdSerializer; 13 | 14 | public class ComponentMarkupIdSerializer extends StdSerializer 15 | { 16 | public ComponentMarkupIdSerializer() 17 | { 18 | super(Component.class); 19 | } 20 | 21 | @Override 22 | public void serialize(Component value, JsonGenerator jgen, SerializerProvider provider) 23 | throws IOException, JsonGenerationException 24 | { 25 | jgen.writeString(value.getMarkupId()); 26 | } 27 | 28 | @Override 29 | public JsonNode getSchema(SerializerProvider provider, Type typeHint) 30 | { 31 | return createSchemaNode("string", true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/jackson/ToStringNoQuoteSerializer.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.jackson; 2 | 3 | import java.io.IOException; 4 | import java.lang.reflect.Type; 5 | 6 | import com.fasterxml.jackson.core.JsonGenerationException; 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.databind.JsonNode; 9 | import com.fasterxml.jackson.databind.SerializerProvider; 10 | import com.fasterxml.jackson.databind.ser.std.StdSerializer; 11 | 12 | public class ToStringNoQuoteSerializer extends StdSerializer 13 | { 14 | public ToStringNoQuoteSerializer() 15 | { 16 | super(Object.class); 17 | } 18 | 19 | @Override 20 | public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) 21 | throws IOException, JsonGenerationException 22 | { 23 | jgen.writeRawValue(value.toString()); 24 | } 25 | 26 | @Override 27 | public JsonNode getSchema(SerializerProvider provider, Type typeHint) 28 | { 29 | return createSchemaNode("string", true); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/jackson/ToStringNoQuoteWithCurlyBracketsSerializer.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.jackson; 2 | 3 | import java.io.IOException; 4 | import java.lang.reflect.Type; 5 | 6 | import com.fasterxml.jackson.core.JsonGenerationException; 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.databind.JsonNode; 9 | import com.fasterxml.jackson.databind.SerializerProvider; 10 | import com.fasterxml.jackson.databind.ser.std.StdSerializer; 11 | 12 | public class ToStringNoQuoteWithCurlyBracketsSerializer extends StdSerializer 13 | { 14 | public ToStringNoQuoteWithCurlyBracketsSerializer() 15 | { 16 | super(Object.class); 17 | } 18 | 19 | @Override 20 | public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) 21 | throws IOException, JsonGenerationException 22 | { 23 | String out = value.toString(); 24 | if (out != null && !out.isEmpty()) 25 | jgen.writeRawValue("{" + out + "}"); 26 | } 27 | 28 | @Override 29 | public JsonNode getSchema(SerializerProvider provider, Type typeHint) 30 | { 31 | return createSchemaNode("string", true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/labels/WHighChartLabelsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.labels; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 7 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 8 | import com.fasterxml.jackson.annotation.JsonInclude; 9 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 10 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 11 | 12 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 13 | 14 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 15 | @JsonInclude(Include.NON_NULL) 16 | public class WHighChartLabelsOptions implements Serializable 17 | { 18 | private static final long serialVersionUID = 1L; 19 | 20 | /** 21 | * An array containing configuration for each label. 22 | */ 23 | private List items; 24 | 25 | /** 26 | * Shared CSS styles for all labels. Defaults to: style: { color: '#3E576F' } 27 | */ 28 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 29 | @JsonInclude(value=Include.NON_NULL) 30 | private String style; 31 | 32 | public List getItems() 33 | { 34 | return items; 35 | } 36 | 37 | public WHighChartLabelsOptions setItems(List items) 38 | { 39 | this.items = items; 40 | return this; 41 | } 42 | 43 | public String getStyle() 44 | { 45 | return style; 46 | } 47 | 48 | public WHighChartLabelsOptions setStyle(String style) 49 | { 50 | this.style = style; 51 | return this; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/lang/WHighChartLangOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.lang; 2 | 3 | import java.io.Serializable; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 8 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 11 | 12 | /** 13 | * Language object. The language object is global and it can't be set on each chart 14 | * initiation. Instead, use Highcharts.setOptions to set it before any chart is initiated. 15 | * Highcharts.setOptions({ lang: { months: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 16 | * 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], weekdays: 17 | * ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'] } }); 18 | */ 19 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 20 | @JsonInclude(Include.NON_NULL) 21 | public class WHighChartLangOptions implements Serializable 22 | { 23 | private static final long serialVersionUID = 1L; 24 | 25 | /** 26 | * The default decimal point used in the Highcharts.numberFormat method unless 27 | * otherwise specified in the function arguments. Defaults to ".". 28 | */ 29 | private String decimalPoint; 30 | 31 | /** 32 | * Exporting module only. The text for the PNG download menu item. Defaults to 33 | * "Download PNG image". 34 | */ 35 | private String downloadPNG; 36 | 37 | /** 38 | * Exporting module only. The text for the JPEG download menu item. Defaults to 39 | * "Download JPEG image". 40 | */ 41 | private String downloadJPEG; 42 | 43 | /** 44 | * Exporting module only. The text for the PDF download menu item. Defaults to 45 | * "Download PDF document". 46 | */ 47 | private String downloadPDF; 48 | 49 | /** 50 | * Exporting module only. The text for the SVG download menu item. Defaults to 51 | * "Download SVG vector image". 52 | */ 53 | private String downloadSVG; 54 | 55 | /** 56 | * Exporting module only. The tooltip text for the export button. Defaults to 57 | * "Export to raster or vector image". 58 | */ 59 | private String exportButtonTitle; 60 | 61 | /** 62 | * The loading text that appears when the chart is set into the loading state 63 | * following a call to chart.showLoading. Defaults to Loading.... 64 | */ 65 | private String loading; 66 | 67 | /** 68 | * An array containing the months names. Defaults to ['January', 'February', 'March', 69 | * 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 70 | * 'December']. 71 | */ 72 | private List months; 73 | 74 | /** 75 | * Exporting module only. The tooltip text for the print button. Defaults to 76 | * "Print the chart". 77 | */ 78 | private String printButtonTitle; 79 | 80 | /** 81 | * The text for the label appearing when a chart is zoomed. Defaults to Reset zoom. 82 | */ 83 | private String resetZoom; 84 | 85 | /** 86 | * The tooltip title for the label appearing when a chart is zoomed. Defaults to Reset 87 | * zoom level 1:1. 88 | */ 89 | private String resetZoomTitle; 90 | 91 | /** 92 | * The default thousands separator used in the Highcharts.numberFormat method unless 93 | * otherwise specified in the function arguments. Defaults to ",". 94 | */ 95 | private String thousandsSep; 96 | 97 | /** 98 | * An array containing the weekday names. Defaults to ['Sunday', 'Monday', 'Tuesday', 99 | * 'Wednesday', 'Thursday', 'Friday', 'Saturday']. 100 | */ 101 | private List weekdays; 102 | 103 | public String getDecimalPoint() 104 | { 105 | return decimalPoint; 106 | } 107 | 108 | public WHighChartLangOptions setDecimalPoint(String decimalPoint) 109 | { 110 | this.decimalPoint = decimalPoint; 111 | return this; 112 | } 113 | 114 | public String getDownloadPNG() 115 | { 116 | return downloadPNG; 117 | } 118 | 119 | public WHighChartLangOptions setDownloadPNG(String downloadPNG) 120 | { 121 | this.downloadPNG = downloadPNG; 122 | return this; 123 | } 124 | 125 | public String getDownloadJPEG() 126 | { 127 | return downloadJPEG; 128 | } 129 | 130 | public WHighChartLangOptions setDownloadJPEG(String downloadJPEG) 131 | { 132 | this.downloadJPEG = downloadJPEG; 133 | return this; 134 | } 135 | 136 | public String getDownloadPDF() 137 | { 138 | return downloadPDF; 139 | } 140 | 141 | public WHighChartLangOptions setDownloadPDF(String downloadPDF) 142 | { 143 | this.downloadPDF = downloadPDF; 144 | return this; 145 | } 146 | 147 | public String getDownloadSVG() 148 | { 149 | return downloadSVG; 150 | } 151 | 152 | public WHighChartLangOptions setDownloadSVG(String downloadSVG) 153 | { 154 | this.downloadSVG = downloadSVG; 155 | return this; 156 | } 157 | 158 | public String getExportButtonTitle() 159 | { 160 | return exportButtonTitle; 161 | } 162 | 163 | public WHighChartLangOptions setExportButtonTitle(String exportButtonTitle) 164 | { 165 | this.exportButtonTitle = exportButtonTitle; 166 | return this; 167 | } 168 | 169 | public String getLoading() 170 | { 171 | return loading; 172 | } 173 | 174 | public WHighChartLangOptions setLoading(String loading) 175 | { 176 | this.loading = loading; 177 | return this; 178 | } 179 | 180 | public List getMonths() 181 | { 182 | return months; 183 | } 184 | 185 | public WHighChartLangOptions setMonths(List months) 186 | { 187 | this.months = months; 188 | return this; 189 | } 190 | 191 | public WHighChartLangOptions setMonths(String... months) 192 | { 193 | this.months = Arrays.asList(months); 194 | return this; 195 | } 196 | 197 | public String getPrintButtonTitle() 198 | { 199 | return printButtonTitle; 200 | } 201 | 202 | public WHighChartLangOptions setPrintButtonTitle(String printButtonTitle) 203 | { 204 | this.printButtonTitle = printButtonTitle; 205 | return this; 206 | } 207 | 208 | public String getResetZoom() 209 | { 210 | return resetZoom; 211 | } 212 | 213 | public WHighChartLangOptions setResetZoom(String resetZoom) 214 | { 215 | this.resetZoom = resetZoom; 216 | return this; 217 | } 218 | 219 | public String getResetZoomTitle() 220 | { 221 | return resetZoomTitle; 222 | } 223 | 224 | public WHighChartLangOptions setResetZoomTitle(String resetZoomTitle) 225 | { 226 | this.resetZoomTitle = resetZoomTitle; 227 | return this; 228 | } 229 | 230 | public String getThousandsSep() 231 | { 232 | return thousandsSep; 233 | } 234 | 235 | public WHighChartLangOptions setThousandsSep(String thousandsSep) 236 | { 237 | this.thousandsSep = thousandsSep; 238 | return this; 239 | } 240 | 241 | public List getWeekdays() 242 | { 243 | return weekdays; 244 | } 245 | 246 | public WHighChartLangOptions setWeekdays(List weekdays) 247 | { 248 | this.weekdays = weekdays; 249 | return this; 250 | } 251 | 252 | public WHighChartLangOptions setWeekdays(String... weekdays) 253 | { 254 | this.weekdays = Arrays.asList(weekdays); 255 | return this; 256 | } 257 | 258 | } 259 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/legend/WHighChartLegendLayoutType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.legend; 2 | 3 | public enum WHighChartLegendLayoutType 4 | { 5 | vertical, 6 | horizontal; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/loading/WHighChartLoadingOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.loading; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartLoadingOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * The duration in milliseconds of the fade out effect. Defaults to 100. 21 | */ 22 | private Number hideDuration; 23 | 24 | /** 25 | * CSS styles for the loading label span. Defaults to: labelStyle: { fontWeight: 26 | * 'bold', position: 'relative', top: '1em' } 27 | */ 28 | private String labelStyle; 29 | 30 | /** 31 | * The duration in milliseconds of the fade in effect. Defaults to 100. 32 | */ 33 | private Number showDuration; 34 | 35 | /** 36 | * CSS styles for the loading screen that covers the plot area. Defaults to: style: { 37 | * position: 'absolute', backgroundColor: 'white', opacity: 0.5, textAlign: 'center' } 38 | */ 39 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 40 | @JsonInclude(value = Include.NON_NULL) 41 | private String style; 42 | 43 | public Number getHideDuration() 44 | { 45 | return hideDuration; 46 | } 47 | 48 | public WHighChartLoadingOptions setHideDuration(Number hideDuration) 49 | { 50 | this.hideDuration = hideDuration; 51 | return this; 52 | } 53 | 54 | public String getLabelStyle() 55 | { 56 | return labelStyle; 57 | } 58 | 59 | public WHighChartLoadingOptions setLabelStyle(String labelStyle) 60 | { 61 | this.labelStyle = labelStyle; 62 | return this; 63 | } 64 | 65 | public Number getShowDuration() 66 | { 67 | return showDuration; 68 | } 69 | 70 | public WHighChartLoadingOptions setShowDuration(Number showDuration) 71 | { 72 | this.showDuration = showDuration; 73 | return this; 74 | } 75 | 76 | public String getStyle() 77 | { 78 | return style; 79 | } 80 | 81 | public WHighChartLoadingOptions setStyle(String style) 82 | { 83 | this.style = style; 84 | return this; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/navigation/WHighChartNavigationOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.navigation; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartNavigationOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotAreaMarkerOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartMarkerStatesOptions; 11 | 12 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 13 | @JsonInclude(Include.NON_NULL) 14 | public class WHighChartPlotAreaMarkerOptions implements Serializable 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | private Boolean enabled; 19 | 20 | private WHighChartPlotAreaMarkerSymbolType symbol; 21 | 22 | private Number radius; 23 | 24 | private WHighChartMarkerStatesOptions states; 25 | 26 | public Boolean getEnabled() 27 | { 28 | return enabled; 29 | } 30 | 31 | public WHighChartPlotAreaMarkerOptions setEnabled(Boolean enabled) 32 | { 33 | this.enabled = enabled; 34 | return this; 35 | } 36 | 37 | public WHighChartPlotAreaMarkerSymbolType getSymbol() 38 | { 39 | return symbol; 40 | } 41 | 42 | public WHighChartPlotAreaMarkerOptions setSymbol(WHighChartPlotAreaMarkerSymbolType symbol) 43 | { 44 | this.symbol = symbol; 45 | return this; 46 | } 47 | 48 | public Number getRadius() 49 | { 50 | return radius; 51 | } 52 | 53 | public WHighChartPlotAreaMarkerOptions setRadius(Number radius) 54 | { 55 | this.radius = radius; 56 | return this; 57 | } 58 | 59 | public WHighChartMarkerStatesOptions getStates() 60 | { 61 | if (states == null) 62 | states = new WHighChartMarkerStatesOptions(); 63 | 64 | return states; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotAreaMarkerSymbolType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | public enum WHighChartPlotAreaMarkerSymbolType 4 | { 5 | circle 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotAreaOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class WHighChartPlotAreaOptions extends 11 | AbstractWHighChartPlotChartOptions 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotBarOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class WHighChartPlotBarOptions extends 11 | AbstractWHighChartPlotChartOptions 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotChartPointEventsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartFunction; 11 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartPlotChartPointEventsOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * Fires when a point is clicked. The this keyword refers to the point object itself. 21 | * One parameter, event, is passed to the function. This contains common event 22 | * information based on jQuery or MooTools depending on which library is used as the 23 | * base for Highcharts. If the series.allowPointSelect option is true, the default 24 | * action for the point's click event is to toggle the point's select state. Returning 25 | * false cansels this action. 26 | */ 27 | private WHighChartFunction click; 28 | 29 | /** 30 | * Fires when the mouse enters the area close to the point. The this keyword refers to 31 | * the point object itself. One parameter, event, is passed to the function. This 32 | * contains common event information based on jQuery or MooTools depending on which 33 | * library is used as the base for Highcharts. 34 | */ 35 | private WHighChartFunction mouseOver; 36 | 37 | /** 38 | * Fires when the mouse leaves the area close to the point. The this keyword refers to 39 | * the point object itself. One parameter, event, is passed to the function. This 40 | * contains common event information based on jQuery or MooTools depending on which 41 | * library is used as the base for Highcharts. 42 | */ 43 | private WHighChartFunction mouseOut; 44 | 45 | /** 46 | * Fires when the point is removed using the .remove() method. The this keyword refers 47 | * to the point object itself. One parameter, event, is passed to the function. 48 | * Returning false cancels the operation. 49 | */ 50 | private WHighChartFunction remove; 51 | 52 | /** 53 | * Fires when the point is selected either programatically or following a click on the 54 | * point. The this keyword refers to the point object itself. One parameter, event, is 55 | * passed to the function. Returning false cancels the operation. 56 | */ 57 | private WHighChartFunction select; 58 | 59 | /** 60 | * Fires when the point is unselected either programatically or following a click on 61 | * the point. The this keyword refers to the point object itself. One parameter, 62 | * event, is passed to the function. Returning false cancels the operation. 63 | */ 64 | private WHighChartFunction unselect; 65 | 66 | /** 67 | * Fires when the point is updated programmatically through the .update() method. The 68 | * this keyword refers to the point object itself. One parameter, event, is passed to 69 | * the function. The new point options can be accessed through event.options. 70 | * Returning false cancels the operation. 71 | */ 72 | private WHighChartFunction update; 73 | 74 | public WHighChartFunction getClick() 75 | { 76 | return click; 77 | } 78 | 79 | public WHighChartPlotChartPointEventsOptions setClick(WHighChartFunction click) 80 | { 81 | this.click = click; 82 | return this; 83 | } 84 | 85 | public WHighChartPlotChartPointEventsOptions setClick(String formatter) 86 | { 87 | return setClick(new WHighChartFunctionString(formatter)); 88 | } 89 | 90 | public WHighChartFunction getMouseOver() 91 | { 92 | return mouseOver; 93 | } 94 | 95 | public WHighChartPlotChartPointEventsOptions setMouseOver(WHighChartFunction mouseOver) 96 | { 97 | this.mouseOver = mouseOver; 98 | return this; 99 | } 100 | 101 | public WHighChartPlotChartPointEventsOptions setMouseOver(String formatter) 102 | { 103 | return setMouseOver(new WHighChartFunctionString(formatter)); 104 | } 105 | 106 | public WHighChartFunction getMouseOut() 107 | { 108 | return mouseOut; 109 | } 110 | 111 | public WHighChartPlotChartPointEventsOptions setMouseOut(WHighChartFunction mouseOut) 112 | { 113 | this.mouseOut = mouseOut; 114 | return this; 115 | } 116 | 117 | public WHighChartPlotChartPointEventsOptions setMouseOut(String formatter) 118 | { 119 | return setMouseOut(new WHighChartFunctionString(formatter)); 120 | } 121 | 122 | public WHighChartFunction getRemove() 123 | { 124 | return remove; 125 | } 126 | 127 | public WHighChartPlotChartPointEventsOptions setRemove(WHighChartFunction remove) 128 | { 129 | this.remove = remove; 130 | return this; 131 | } 132 | 133 | public WHighChartPlotChartPointEventsOptions setRemove(String formatter) 134 | { 135 | return setRemove(new WHighChartFunctionString(formatter)); 136 | } 137 | 138 | public WHighChartFunction getSelect() 139 | { 140 | return select; 141 | } 142 | 143 | public WHighChartPlotChartPointEventsOptions setSelect(WHighChartFunction select) 144 | { 145 | this.select = select; 146 | return this; 147 | } 148 | 149 | public WHighChartPlotChartPointEventsOptions setSelect(String formatter) 150 | { 151 | return setSelect(new WHighChartFunctionString(formatter)); 152 | } 153 | 154 | public WHighChartFunction getUnselect() 155 | { 156 | return unselect; 157 | } 158 | 159 | public WHighChartPlotChartPointEventsOptions setUnselect(WHighChartFunction unselect) 160 | { 161 | this.unselect = unselect; 162 | return this; 163 | } 164 | 165 | public WHighChartPlotChartPointEventsOptions setUnselect(String formatter) 166 | { 167 | return setUnselect(new WHighChartFunctionString(formatter)); 168 | } 169 | 170 | public WHighChartFunction getUpdate() 171 | { 172 | return update; 173 | } 174 | 175 | public WHighChartPlotChartPointEventsOptions setUpdate(WHighChartFunction update) 176 | { 177 | this.update = update; 178 | return this; 179 | } 180 | 181 | public WHighChartPlotChartPointEventsOptions setUpdate(String formatter) 182 | { 183 | return setUpdate(new WHighChartFunctionString(formatter)); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotChartPointOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartPlotChartPointOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * Event listeners for chart events. 18 | */ 19 | private WHighChartPlotChartPointEventsOptions events; 20 | 21 | public WHighChartPlotChartPointEventsOptions getEvents() 22 | { 23 | if (events == null) 24 | events = new WHighChartPlotChartPointEventsOptions(); 25 | return events; 26 | } 27 | 28 | public WHighChartPlotChartPointOptions setEvents(WHighChartPlotChartPointEventsOptions events) 29 | { 30 | this.events = events; 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotColumnOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class WHighChartPlotColumnOptions extends 11 | AbstractWHighChartPlotChartOptions 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotDashStyleType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | public enum WHighChartPlotDashStyleType 4 | { 5 | solid, 6 | shortdash, 7 | shortdot, 8 | shortdashdot, 9 | shortdashdotdot, 10 | dot, 11 | dash, 12 | longdash, 13 | dashdot, 14 | longdashdot, 15 | longdashdotdot; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotDataLabelsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartFunction; 11 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartPlotDataLabelsOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * Enable or disable the data labels. Defaults to true. 21 | */ 22 | private Boolean enabled; 23 | 24 | private WHighChartFunction formatter; 25 | 26 | public Boolean getEnabled() 27 | { 28 | return enabled; 29 | } 30 | 31 | public WHighChartPlotDataLabelsOptions setEnabled(Boolean enabled) 32 | { 33 | this.enabled = enabled; 34 | return this; 35 | } 36 | 37 | public WHighChartFunction getFormatter() 38 | { 39 | return formatter; 40 | } 41 | 42 | public WHighChartPlotDataLabelsOptions setFormatter(WHighChartFunction formatter) 43 | { 44 | this.formatter = formatter; 45 | return this; 46 | } 47 | 48 | public WHighChartPlotDataLabelsOptions setFormatter(String formatter) 49 | { 50 | return setFormatter(new WHighChartFunctionString(formatter)); 51 | } 52 | 53 | public WHighChartPlotDataLabelsOptions setSelection(String formatter) 54 | { 55 | return setFormatter(new WHighChartFunctionString(formatter)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | @SuppressWarnings("rawtypes") 13 | public class WHighChartPlotOptions implements Serializable 14 | { 15 | private static final long serialVersionUID = 1L; 16 | 17 | private WHighChartPlotAreaOptions area; 18 | 19 | private AbstractWHighChartPlotChartOptions areaspline; 20 | 21 | private WHighChartPlotBarOptions bar; 22 | 23 | private WHighChartPlotColumnOptions column; 24 | 25 | private AbstractWHighChartPlotChartOptions line; 26 | 27 | private WHighChartPlotPieOptions pie; 28 | 29 | private WHighChartPlotSeriesOptions series; 30 | 31 | private AbstractWHighChartPlotChartOptions scatter; 32 | 33 | private AbstractWHighChartPlotChartOptions spline; 34 | 35 | public WHighChartPlotAreaOptions getArea() 36 | { 37 | if (area == null) 38 | area = new WHighChartPlotAreaOptions(); 39 | 40 | return area; 41 | } 42 | 43 | public WHighChartPlotOptions setArea(WHighChartPlotAreaOptions area) 44 | { 45 | this.area = area; 46 | return this; 47 | } 48 | 49 | public AbstractWHighChartPlotChartOptions getAreaspline() 50 | { 51 | if (areaspline == null) 52 | areaspline = new AbstractWHighChartPlotChartOptions(); 53 | 54 | return areaspline; 55 | } 56 | 57 | public WHighChartPlotOptions setAreaspline(AbstractWHighChartPlotChartOptions areaspline) 58 | { 59 | this.areaspline = areaspline; 60 | return this; 61 | } 62 | 63 | public WHighChartPlotBarOptions getBar() 64 | { 65 | if (bar == null) 66 | bar = new WHighChartPlotBarOptions(); 67 | 68 | return bar; 69 | } 70 | 71 | public WHighChartPlotOptions setBar(WHighChartPlotBarOptions bar) 72 | { 73 | this.bar = bar; 74 | return this; 75 | } 76 | 77 | public WHighChartPlotColumnOptions getColumn() 78 | { 79 | if (column == null) 80 | column = new WHighChartPlotColumnOptions(); 81 | 82 | return column; 83 | } 84 | 85 | public WHighChartPlotOptions setColumn(WHighChartPlotColumnOptions column) 86 | { 87 | this.column = column; 88 | return this; 89 | } 90 | 91 | public AbstractWHighChartPlotChartOptions getLine() 92 | { 93 | if (line == null) 94 | line = new AbstractWHighChartPlotChartOptions(); 95 | 96 | return line; 97 | } 98 | 99 | public WHighChartPlotOptions setLine(AbstractWHighChartPlotChartOptions line) 100 | { 101 | this.line = line; 102 | return this; 103 | } 104 | 105 | public WHighChartPlotPieOptions getPie() 106 | { 107 | if (pie == null) 108 | pie = new WHighChartPlotPieOptions(); 109 | 110 | return pie; 111 | } 112 | 113 | public WHighChartPlotOptions setPie(WHighChartPlotPieOptions pie) 114 | { 115 | this.pie = pie; 116 | return this; 117 | } 118 | 119 | public WHighChartPlotSeriesOptions getSeries() 120 | { 121 | if (series == null) 122 | series = new WHighChartPlotSeriesOptions(); 123 | 124 | return series; 125 | } 126 | 127 | public WHighChartPlotOptions setSeries(WHighChartPlotSeriesOptions series) 128 | { 129 | this.series = series; 130 | return this; 131 | } 132 | 133 | public AbstractWHighChartPlotChartOptions getScatter() 134 | { 135 | if (scatter == null) 136 | scatter = new AbstractWHighChartPlotChartOptions(); 137 | 138 | return scatter; 139 | } 140 | 141 | public WHighChartPlotOptions setScatter(AbstractWHighChartPlotChartOptions scatter) 142 | { 143 | this.scatter = scatter; 144 | return this; 145 | } 146 | 147 | public AbstractWHighChartPlotChartOptions getSpline() 148 | { 149 | if (spline == null) 150 | spline = new AbstractWHighChartPlotChartOptions(); 151 | 152 | return spline; 153 | } 154 | 155 | public WHighChartPlotOptions setSpline(AbstractWHighChartPlotChartOptions spline) 156 | { 157 | this.spline = spline; 158 | return this; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotPieOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class WHighChartPlotPieOptions extends 11 | AbstractWHighChartPlotChartOptions 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/plotoptions/WHighChartPlotSeriesOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.plotoptions; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.point.WHighChartPointOptions; 11 | 12 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 13 | @JsonInclude(Include.NON_NULL) 14 | public class WHighChartPlotSeriesOptions implements Serializable 15 | { 16 | private static final long serialVersionUID = 1L; 17 | 18 | private Boolean allowPointSelect; 19 | 20 | private Boolean animation; 21 | 22 | private String borderColor; 23 | 24 | private Number borderWidth; 25 | 26 | private String color; 27 | 28 | private Boolean connectNulls; 29 | 30 | private String cursor; 31 | 32 | private String dashStyle; 33 | 34 | private Boolean enableMouseTracking; 35 | 36 | private String id; 37 | 38 | private Number lineWidth; 39 | 40 | private WHighChartPointOptions point; 41 | 42 | private Number pointStart; 43 | 44 | private Number pointInterval; 45 | 46 | private Boolean selected; 47 | 48 | private Boolean step; 49 | 50 | private Boolean shadow; 51 | 52 | private Boolean showCheckbox; 53 | 54 | private Boolean showInLegend; 55 | 56 | private String stacking; 57 | 58 | private Boolean stickyTracking; 59 | 60 | private Boolean visible; 61 | 62 | private String zIndex; 63 | 64 | public Boolean getAllowPointSelect() 65 | { 66 | return allowPointSelect; 67 | } 68 | 69 | public WHighChartPlotSeriesOptions setAllowPointSelect(Boolean allowPointSelect) 70 | { 71 | this.allowPointSelect = allowPointSelect; 72 | return this; 73 | } 74 | 75 | public Boolean getAnimation() 76 | { 77 | return animation; 78 | } 79 | 80 | public WHighChartPlotSeriesOptions setAnimation(Boolean animation) 81 | { 82 | this.animation = animation; 83 | return this; 84 | } 85 | 86 | public String getBorderColor() 87 | { 88 | return borderColor; 89 | } 90 | 91 | public WHighChartPlotSeriesOptions setBorderColor(String borderColor) 92 | { 93 | this.borderColor = borderColor; 94 | return this; 95 | } 96 | 97 | public Number getBorderWidth() 98 | { 99 | return borderWidth; 100 | } 101 | 102 | public WHighChartPlotSeriesOptions setBorderWidth(Number borderWidth) 103 | { 104 | this.borderWidth = borderWidth; 105 | return this; 106 | } 107 | 108 | public String getColor() 109 | { 110 | return color; 111 | } 112 | 113 | public WHighChartPlotSeriesOptions setColor(String color) 114 | { 115 | this.color = color; 116 | return this; 117 | } 118 | 119 | public Boolean getConnectNulls() 120 | { 121 | return connectNulls; 122 | } 123 | 124 | public WHighChartPlotSeriesOptions setConnectNulls(Boolean connectNulls) 125 | { 126 | this.connectNulls = connectNulls; 127 | return this; 128 | } 129 | 130 | public String getCursor() 131 | { 132 | return cursor; 133 | } 134 | 135 | public WHighChartPlotSeriesOptions setCursor(String cursor) 136 | { 137 | this.cursor = cursor; 138 | return this; 139 | } 140 | 141 | public String getDashStyle() 142 | { 143 | return dashStyle; 144 | } 145 | 146 | public WHighChartPlotSeriesOptions setDashStyle(String dashStyle) 147 | { 148 | this.dashStyle = dashStyle; 149 | return this; 150 | } 151 | 152 | public Boolean getEnableMouseTracking() 153 | { 154 | return enableMouseTracking; 155 | } 156 | 157 | public WHighChartPlotSeriesOptions setEnableMouseTracking(Boolean enableMouseTracking) 158 | { 159 | this.enableMouseTracking = enableMouseTracking; 160 | return this; 161 | } 162 | 163 | public String getId() 164 | { 165 | return id; 166 | } 167 | 168 | public WHighChartPlotSeriesOptions setId(String id) 169 | { 170 | this.id = id; 171 | return this; 172 | } 173 | 174 | public Boolean getStep() 175 | { 176 | return step; 177 | } 178 | 179 | public WHighChartPlotSeriesOptions setStep(Boolean step) 180 | { 181 | this.step = step; 182 | return this; 183 | } 184 | 185 | public boolean isStep() 186 | { 187 | if (step == null) 188 | return Boolean.FALSE; 189 | 190 | return step; 191 | } 192 | 193 | public Number getLineWidth() 194 | { 195 | return lineWidth; 196 | } 197 | 198 | public WHighChartPlotSeriesOptions setLineWidth(Number lineWidth) 199 | { 200 | this.lineWidth = lineWidth; 201 | return this; 202 | } 203 | 204 | public WHighChartPointOptions getPoint() 205 | { 206 | if (point == null) 207 | point = new WHighChartPointOptions(); 208 | return point; 209 | } 210 | 211 | public WHighChartPlotSeriesOptions setPoint(WHighChartPointOptions point) 212 | { 213 | this.point = point; 214 | return this; 215 | } 216 | 217 | public Number getPointStart() 218 | { 219 | return pointStart; 220 | } 221 | 222 | public WHighChartPlotSeriesOptions setPointStart(Number pointStart) 223 | { 224 | this.pointStart = pointStart; 225 | return this; 226 | } 227 | 228 | public Number getPointInterval() 229 | { 230 | return pointInterval; 231 | } 232 | 233 | public WHighChartPlotSeriesOptions setPointInterval(Number pointInterval) 234 | { 235 | this.pointInterval = pointInterval; 236 | return this; 237 | } 238 | 239 | public Boolean getSelected() 240 | { 241 | return selected; 242 | } 243 | 244 | public WHighChartPlotSeriesOptions setSelected(Boolean selected) 245 | { 246 | this.selected = selected; 247 | return this; 248 | } 249 | 250 | public Boolean getShadow() 251 | { 252 | return shadow; 253 | } 254 | 255 | public WHighChartPlotSeriesOptions setShadow(Boolean shadow) 256 | { 257 | this.shadow = shadow; 258 | return this; 259 | } 260 | 261 | public Boolean getShowCheckbox() 262 | { 263 | return showCheckbox; 264 | } 265 | 266 | public WHighChartPlotSeriesOptions setShowCheckbox(Boolean showCheckbox) 267 | { 268 | this.showCheckbox = showCheckbox; 269 | return this; 270 | } 271 | 272 | public Boolean getShowInLegend() 273 | { 274 | return showInLegend; 275 | } 276 | 277 | public WHighChartPlotSeriesOptions setShowInLegend(Boolean showInLegend) 278 | { 279 | this.showInLegend = showInLegend; 280 | return this; 281 | } 282 | 283 | public String getStacking() 284 | { 285 | return stacking; 286 | } 287 | 288 | public WHighChartPlotSeriesOptions setStacking(String stacking) 289 | { 290 | this.stacking = stacking; 291 | return this; 292 | } 293 | 294 | public Boolean getStickyTracking() 295 | { 296 | return stickyTracking; 297 | } 298 | 299 | public WHighChartPlotSeriesOptions setStickyTracking(Boolean stickyTracking) 300 | { 301 | this.stickyTracking = stickyTracking; 302 | return this; 303 | } 304 | 305 | public Boolean getVisible() 306 | { 307 | return visible; 308 | } 309 | 310 | public WHighChartPlotSeriesOptions setVisible(Boolean visible) 311 | { 312 | this.visible = visible; 313 | return this; 314 | } 315 | 316 | public String getzIndex() 317 | { 318 | return zIndex; 319 | } 320 | 321 | public WHighChartPlotSeriesOptions setzIndex(String zIndex) 322 | { 323 | this.zIndex = zIndex; 324 | return this; 325 | } 326 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/point/WHighChartPointEventsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.point; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | import nl.topicus.whighcharts.options.WHighChartFunction; 11 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class WHighChartPointEventsOptions implements Serializable 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * Fires when a point is clicked. The this keyword refers to the point object itself. 21 | * One parameter, event, is passed to the function. This contains common event 22 | * information based on jQuery or MooTools depending on which library is used as the 23 | * base for Highcharts. If the series.allowPointSelect option is true, the default 24 | * action for the point's click event is to toggle the point's select state. Returning 25 | * false cansels this action. 26 | */ 27 | private WHighChartFunction click; 28 | 29 | /** 30 | * Fires when the point is selected either programatically or following a click on the 31 | * point. The this keyword refers to the point object itself. One parameter, event, is 32 | * passed to the function. Returning false cancels the operation. 33 | */ 34 | private WHighChartFunction select; 35 | 36 | public WHighChartFunction getClick() 37 | { 38 | return click; 39 | } 40 | 41 | public WHighChartPointEventsOptions setClick(WHighChartFunction click) 42 | { 43 | this.click = click; 44 | return this; 45 | } 46 | 47 | public WHighChartPointEventsOptions setClick(String formatter) 48 | { 49 | return setClick(new WHighChartFunctionString(formatter)); 50 | } 51 | 52 | public WHighChartFunction getSelect() 53 | { 54 | return select; 55 | } 56 | 57 | public WHighChartPointEventsOptions setSelect(WHighChartFunction select) 58 | { 59 | this.select = select; 60 | return this; 61 | } 62 | 63 | public WHighChartPointEventsOptions setSelect(String formatter) 64 | { 65 | return setSelect(new WHighChartFunctionString(formatter)); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/point/WHighChartPointOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.point; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | 10 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 11 | @JsonInclude(Include.NON_NULL) 12 | public class WHighChartPointOptions implements Serializable 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * Individual color for the point. Defaults to null. 18 | */ 19 | private String color; 20 | 21 | /** 22 | * Individual events for the point. Defaults to null. 23 | */ 24 | private WHighChartPointEventsOptions events; 25 | 26 | /** 27 | * An id for the point. This can be used after render time to get a pointer to the 28 | * point object through chart.get(). Defaults to null. 29 | */ 30 | private String id; 31 | 32 | /** 33 | * An individual point marker for the point. Defaults to null. 34 | */ 35 | private String marker; 36 | 37 | /** 38 | * The name of the point as shown in the legend, tooltip, dataLabel etc. Defaults to 39 | * "". 40 | */ 41 | private String name; 42 | 43 | /** 44 | * Pie series only. Whether to display a slice offset from the center. Defaults to 45 | * false. 46 | */ 47 | private Boolean sliced; 48 | 49 | /** 50 | * The x value of the point Defaults to null. 51 | */ 52 | private Number x; 53 | 54 | /** 55 | * The y value of the point Defaults to null. 56 | */ 57 | private Number y; 58 | 59 | public String getColor() 60 | { 61 | return color; 62 | } 63 | 64 | public WHighChartPointOptions setColor(String color) 65 | { 66 | this.color = color; 67 | return this; 68 | } 69 | 70 | public WHighChartPointEventsOptions getEvents() 71 | { 72 | if (events == null) 73 | events = new WHighChartPointEventsOptions(); 74 | 75 | return events; 76 | } 77 | 78 | public WHighChartPointOptions setEvents(WHighChartPointEventsOptions events) 79 | { 80 | this.events = events; 81 | return this; 82 | } 83 | 84 | public String getId() 85 | { 86 | return id; 87 | } 88 | 89 | public WHighChartPointOptions setId(String id) 90 | { 91 | this.id = id; 92 | return this; 93 | } 94 | 95 | public String getMarker() 96 | { 97 | return marker; 98 | } 99 | 100 | public WHighChartPointOptions setMarker(String marker) 101 | { 102 | this.marker = marker; 103 | return this; 104 | } 105 | 106 | public String getName() 107 | { 108 | return name; 109 | } 110 | 111 | public WHighChartPointOptions setName(String name) 112 | { 113 | this.name = name; 114 | return this; 115 | } 116 | 117 | public Boolean getSliced() 118 | { 119 | return sliced; 120 | } 121 | 122 | public WHighChartPointOptions setSliced(Boolean sliced) 123 | { 124 | this.sliced = sliced; 125 | return this; 126 | } 127 | 128 | public Number getX() 129 | { 130 | return x; 131 | } 132 | 133 | public WHighChartPointOptions setX(Number x) 134 | { 135 | this.x = x; 136 | return this; 137 | } 138 | 139 | public Number getY() 140 | { 141 | return y; 142 | } 143 | 144 | public WHighChartPointOptions setY(Number y) 145 | { 146 | this.y = y; 147 | return this; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/AbstractSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 7 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 8 | import com.fasterxml.jackson.annotation.JsonInclude; 9 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 10 | 11 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 12 | 13 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 14 | @JsonInclude(Include.NON_NULL) 15 | public class AbstractSeries> implements ISeries 16 | { 17 | private static final long serialVersionUID = 1L; 18 | 19 | /** 20 | * An array of data points for the series. The points can be given in three ways: A 21 | * list of numerical values. In this case, the numberical values will be interpreted 22 | * and y values, and x values will be automatically calculated, either starting at 0 23 | * and incrementing by 1, or from pointStart and pointInterval given in the 24 | * plotOptions. If the axis is has categories, these will be used. Example: data: [0, 25 | * 5, 3, 5] A list of arrays with two values. In this case, the first value is the x 26 | * value and the second is the y value. If the first value is a string, it is applied 27 | * as the name of the point, and the x value is incremented following the above rules. 28 | * Example: data: [[5, 2], [6, 3], [8, 2]] A list of object with named values. In this 29 | * case the objects are point configuration objects as seen under options.point. 30 | * Example: data: [{ name: 'Point 1', color: '#00FF00', y: 0 }, { name: 'Point 2', 31 | * color: '#FF00FF', y: 5 }] Defaults to "". 32 | */ 33 | private List data = new ArrayList(); 34 | 35 | /** 36 | * The name of the series as shown in the legend, tooltip etc. Defaults to "". 37 | */ 38 | private String name; 39 | 40 | /** 41 | * This option allows grouping series in a stacked chart. The stack option can be a 42 | * string or a number or anything else, as long as the grouped series' stack options 43 | * match each other. Defaults to null. 44 | */ 45 | private Object stack; 46 | 47 | /** 48 | * The type of series. Can be one of area, areaspline, bar, column, line, pie, scatter 49 | * or spline. Defaults to "line". 50 | */ 51 | private WHighChartChartOptionsType type; 52 | 53 | /** 54 | * When using dual or multiple x axes, this number defines which xAxis the particular 55 | * series is connected to. It refers to the index of the axis in the xAxis array, with 56 | * 0 being the first. Defaults to 0. 57 | */ 58 | private Number xAxis; 59 | 60 | /** 61 | * When using dual or multiple y axes, this number defines which yAxis the particular 62 | * series is connected to. It refers to the index of the axis in the yAxis array, with 63 | * 0 being the first. Defaults to 0. 64 | */ 65 | private Number yAxis; 66 | 67 | /** 68 | * An (aparently) undocumenten area of highcharts. 69 | */ 70 | private WHighChartSeriesDataLabelsOptions dataLabels; 71 | 72 | @Override 73 | public List getData() 74 | { 75 | return data; 76 | } 77 | 78 | @SuppressWarnings("unchecked") 79 | public > T setData(List data) 80 | { 81 | this.data = data; 82 | return (T) this; 83 | } 84 | 85 | @SuppressWarnings("unchecked") 86 | public > T addEntry(E entry) 87 | { 88 | data.add(entry); 89 | return (T) this; 90 | } 91 | 92 | public String getName() 93 | { 94 | return name; 95 | } 96 | 97 | @SuppressWarnings("unchecked") 98 | public > T setName(String name) 99 | { 100 | this.name = name; 101 | return (T) this; 102 | } 103 | 104 | public Object getStack() 105 | { 106 | return stack; 107 | } 108 | 109 | @SuppressWarnings("unchecked") 110 | public > T setStack(Object stack) 111 | { 112 | this.stack = stack; 113 | return (T) this; 114 | } 115 | 116 | public WHighChartChartOptionsType getType() 117 | { 118 | return type; 119 | } 120 | 121 | @SuppressWarnings("unchecked") 122 | public > T setType(WHighChartChartOptionsType type) 123 | { 124 | this.type = type; 125 | return (T) this; 126 | } 127 | 128 | public Number getxAxis() 129 | { 130 | return xAxis; 131 | } 132 | 133 | @SuppressWarnings("unchecked") 134 | public > T setxAxis(Number xAxis) 135 | { 136 | this.xAxis = xAxis; 137 | return (T) this; 138 | } 139 | 140 | public Number getyAxis() 141 | { 142 | return yAxis; 143 | } 144 | 145 | @SuppressWarnings("unchecked") 146 | public > T setyAxis(Number yAxis) 147 | { 148 | this.yAxis = yAxis; 149 | return (T) this; 150 | } 151 | 152 | public WHighChartSeriesDataLabelsOptions getDataLabels() 153 | { 154 | if (dataLabels == null) 155 | dataLabels = new WHighChartSeriesDataLabelsOptions(); 156 | 157 | return dataLabels; 158 | } 159 | 160 | @SuppressWarnings("unchecked") 161 | public > T setDataLabels( 162 | WHighChartSeriesDataLabelsOptions dataLabels) 163 | { 164 | this.dataLabels = dataLabels; 165 | return (T) this; 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ISeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | public interface ISeries> extends Serializable 7 | { 8 | public List getData(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ISeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import java.io.Serializable; 4 | 5 | public interface ISeriesEntry extends Serializable 6 | { 7 | public V getValue(); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/IntegerSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class IntegerSeries extends ValueSeries 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public IntegerSeries(Integer... values) 15 | { 16 | for (Integer value : values) 17 | addEntry(value); 18 | } 19 | 20 | @SuppressWarnings("unchecked") 21 | @Override 22 | public IntegerSeries addEntry(Integer value) 23 | { 24 | addEntry(new IntegerSeriesEntry(value)); 25 | return this; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/IntegerSeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class IntegerSeriesEntry extends ValueSeriesEntry 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public IntegerSeriesEntry(Integer value) 15 | { 16 | super(value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/KeyValueSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public abstract class KeyValueSeries> 11 | extends AbstractSeries 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | public abstract E addEntry(K key, V value); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/KeyValueSeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import java.util.Arrays; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 12 | @JsonInclude(Include.NON_NULL) 13 | public abstract class KeyValueSeriesEntry implements ISeriesEntry 14 | { 15 | private static final long serialVersionUID = 1L; 16 | 17 | private K key; 18 | 19 | private V value; 20 | 21 | public KeyValueSeriesEntry(K key, V value) 22 | { 23 | setKey(key); 24 | setValue(value); 25 | } 26 | 27 | public K getKey() 28 | { 29 | return key; 30 | } 31 | 32 | public KeyValueSeriesEntry setKey(K key) 33 | { 34 | this.key = key; 35 | return this; 36 | } 37 | 38 | @Override 39 | public V getValue() 40 | { 41 | return value; 42 | } 43 | 44 | public KeyValueSeriesEntry setValue(V value) 45 | { 46 | this.value = value; 47 | return this; 48 | } 49 | 50 | @JsonValue 51 | public Object value() 52 | { 53 | return Arrays.asList(getKey(), getValue()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ObjectSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class ObjectSeries extends AbstractSeries 11 | { 12 | private static final long serialVersionUID = 1L; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ObjectSeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class ObjectSeriesEntry implements ISeriesEntry 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | /** 15 | * Individual color for the point. Defaults to null. 16 | */ 17 | private String color; 18 | 19 | /** 20 | * Individual events for the point. Defaults to null. 21 | */ 22 | private String events; 23 | 24 | /** 25 | * An id for the point. This can be used after render time to get a pointer to the point 26 | * object through chart.get(). Defaults to null. 27 | */ 28 | private String id; 29 | 30 | /** 31 | * An individual point marker for the point. Defaults to null. 32 | */ 33 | private String marker; 34 | 35 | /** 36 | * The name of the point as shown in the legend, tooltip, dataLabel etc. Defaults to "". 37 | */ 38 | private String name; 39 | 40 | /** 41 | * Pie series only. Whether to display a slice offset from the center. Defaults to false. 42 | */ 43 | private Boolean sliced; 44 | 45 | /** 46 | * The x value of the point Defaults to null. 47 | */ 48 | private Number x; 49 | 50 | /** 51 | * The y value of the point Defaults to null. 52 | */ 53 | private Number y; 54 | 55 | public ObjectSeriesEntry(String name, Number value) 56 | { 57 | setName(name); 58 | setY(value); 59 | } 60 | 61 | public String getColor() 62 | { 63 | return color; 64 | } 65 | 66 | public ObjectSeriesEntry setColor(String color) 67 | { 68 | this.color = color; 69 | return this; 70 | } 71 | 72 | public String getEvents() 73 | { 74 | return events; 75 | } 76 | 77 | public ObjectSeriesEntry setEvents(String events) 78 | { 79 | this.events = events; 80 | return this; 81 | } 82 | 83 | public String getId() 84 | { 85 | return id; 86 | } 87 | 88 | public ObjectSeriesEntry setId(String id) 89 | { 90 | this.id = id; 91 | return this; 92 | } 93 | 94 | public String getMarker() 95 | { 96 | return marker; 97 | } 98 | 99 | public ObjectSeriesEntry setMarker(String marker) 100 | { 101 | this.marker = marker; 102 | return this; 103 | } 104 | 105 | public String getName() 106 | { 107 | return name; 108 | } 109 | 110 | public ObjectSeriesEntry setName(String name) 111 | { 112 | this.name = name; 113 | return this; 114 | } 115 | 116 | public Boolean getSliced() 117 | { 118 | return sliced; 119 | } 120 | 121 | public ObjectSeriesEntry setSliced(Boolean sliced) 122 | { 123 | this.sliced = sliced; 124 | return this; 125 | } 126 | 127 | public Number getX() 128 | { 129 | return x; 130 | } 131 | 132 | public ObjectSeriesEntry setX(Number x) 133 | { 134 | this.x = x; 135 | return this; 136 | } 137 | 138 | public Number getY() 139 | { 140 | return y; 141 | } 142 | 143 | public ObjectSeriesEntry setY(Number y) 144 | { 145 | this.y = y; 146 | return this; 147 | } 148 | 149 | @Override 150 | public Number getValue() 151 | { 152 | return getY(); 153 | } 154 | } -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ToStringSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public class ToStringSeries extends ValueSeries 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public ToStringSeries(Object... values) 15 | { 16 | for (Object value : values) 17 | addEntry(value); 18 | } 19 | 20 | @SuppressWarnings("unchecked") 21 | @Override 22 | public ToStringSeries addEntry(Object value) 23 | { 24 | addEntry(new ToStringSeriesEntry(value)); 25 | return this; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ToStringSeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | 9 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 10 | @JsonInclude(Include.NON_NULL) 11 | public class ToStringSeriesEntry extends ValueSeriesEntry 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | public ToStringSeriesEntry(Object value) 16 | { 17 | super(value); 18 | } 19 | 20 | @Override 21 | @JsonValue 22 | public Object value() 23 | { 24 | return getValue().toString(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ValueSeries.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | 8 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 9 | @JsonInclude(Include.NON_NULL) 10 | public abstract class ValueSeries> extends AbstractSeries 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | @SuppressWarnings("unchecked") 15 | public ValueSeries(V... values) 16 | { 17 | for (V value : values) 18 | addEntry(value); 19 | } 20 | 21 | public abstract > T addEntry(V value); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/ValueSeriesEntry.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | 9 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 10 | @JsonInclude(Include.NON_NULL) 11 | public abstract class ValueSeriesEntry implements ISeriesEntry 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | private V value; 16 | 17 | public ValueSeriesEntry(V value) 18 | { 19 | setValue(value); 20 | } 21 | 22 | @Override 23 | public V getValue() 24 | { 25 | return value; 26 | } 27 | 28 | public ValueSeriesEntry setValue(V value) 29 | { 30 | this.value = value; 31 | return this; 32 | } 33 | 34 | @JsonValue 35 | public Object value() 36 | { 37 | return getValue(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/series/WHighChartSeriesDataLabelsOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.series; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.WHighChartFunction; 12 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 13 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 14 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 15 | 16 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 17 | @JsonInclude(Include.NON_NULL) 18 | public class WHighChartSeriesDataLabelsOptions implements Serializable 19 | { 20 | private static final long serialVersionUID = 1L; 21 | 22 | private Boolean enabled; 23 | 24 | private String color; 25 | 26 | private WHighChartHorizontalAlignmentType align; 27 | 28 | private Number x; 29 | 30 | private Number y; 31 | 32 | private WHighChartFunction formatter; 33 | 34 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 35 | @JsonInclude(value = Include.NON_NULL) 36 | private String style; 37 | 38 | public Boolean getEnabled() 39 | { 40 | return enabled; 41 | } 42 | 43 | public WHighChartSeriesDataLabelsOptions setEnabled(Boolean enabled) 44 | { 45 | this.enabled = enabled; 46 | return this; 47 | } 48 | 49 | public String getColor() 50 | { 51 | return color; 52 | } 53 | 54 | public WHighChartSeriesDataLabelsOptions setColor(String color) 55 | { 56 | this.color = color; 57 | return this; 58 | } 59 | 60 | public WHighChartHorizontalAlignmentType getAlign() 61 | { 62 | return align; 63 | } 64 | 65 | public WHighChartSeriesDataLabelsOptions setAlign(WHighChartHorizontalAlignmentType align) 66 | { 67 | this.align = align; 68 | return this; 69 | } 70 | 71 | public Number getX() 72 | { 73 | return x; 74 | } 75 | 76 | public WHighChartSeriesDataLabelsOptions setX(Number x) 77 | { 78 | this.x = x; 79 | return this; 80 | } 81 | 82 | public Number getY() 83 | { 84 | return y; 85 | } 86 | 87 | public WHighChartSeriesDataLabelsOptions setY(Number y) 88 | { 89 | this.y = y; 90 | return this; 91 | } 92 | 93 | public WHighChartFunction getFormatter() 94 | { 95 | return formatter; 96 | } 97 | 98 | public WHighChartSeriesDataLabelsOptions setFormatter(WHighChartFunction formatter) 99 | { 100 | this.formatter = formatter; 101 | return this; 102 | } 103 | 104 | public WHighChartSeriesDataLabelsOptions setFormatter(String formatter) 105 | { 106 | setFormatter(new WHighChartFunctionString(formatter)); 107 | return this; 108 | } 109 | 110 | public String getStyle() 111 | { 112 | return style; 113 | } 114 | 115 | public WHighChartSeriesDataLabelsOptions setStyle(String style) 116 | { 117 | this.style = style; 118 | return this; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/symbols/WHighChartSymbolsOptionsType.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.symbols; 2 | 3 | public enum WHighChartSymbolsOptionsType 4 | { 5 | circle, 6 | diamond, 7 | square, 8 | triangle, 9 | triangle_down; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/title/WHighChartTitleOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.title; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 12 | import nl.topicus.whighcharts.options.WHighChartVerticalAlignmentType; 13 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 14 | 15 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 16 | @JsonInclude(Include.NON_NULL) 17 | public class WHighChartTitleOptions implements Serializable 18 | { 19 | private static final long serialVersionUID = 1L; 20 | 21 | /** 22 | * The horizontal alignment of the title. Can be one of "left", "center" and "right". 23 | * Defaults to "center". 24 | */ 25 | private WHighChartHorizontalAlignmentType align; 26 | 27 | /** 28 | * When the title is floating, the plot area will not move to make space for it. 29 | * Defaults to false. 30 | */ 31 | private Boolean floating; 32 | 33 | /** 34 | * The margin between the title and the plot area, or if a subtitle is present, the 35 | * margin between the subtitle and the plot area. Defaults to 15. 36 | */ 37 | private Number margin; 38 | 39 | /** 40 | * The title of the chart. To disable the title, set the text to null. Defaults to 41 | * "Chart title". 42 | */ 43 | private String text; 44 | 45 | /** 46 | * CSS styles for the title. Use this for font styling, but use align, x and yfor text 47 | * alignment. Defaults to: { color: '#3E576F', fontSize: '16px' } 48 | */ 49 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 50 | @JsonInclude(value = Include.NON_NULL) 51 | private String style; 52 | 53 | /** 54 | * The vertical alignment of the title. Can be one of "top", "middle" and "bottom". 55 | * Defaults to "top". 56 | */ 57 | private WHighChartVerticalAlignmentType verticalAlign; 58 | 59 | /** 60 | * The x position of the title relative to the alignment within chart.spacingLeft and 61 | * chart.spacingRight. Defaults to 0. 62 | */ 63 | private Number x; 64 | 65 | /** 66 | * The y position of the title relative to the alignment within chart.spacingTop and 67 | * chart.spacingBottom. Defaults to 25. 68 | */ 69 | private Number y; 70 | 71 | public WHighChartHorizontalAlignmentType getAlign() 72 | { 73 | return align; 74 | } 75 | 76 | public WHighChartTitleOptions setAlign(WHighChartHorizontalAlignmentType align) 77 | { 78 | this.align = align; 79 | return this; 80 | } 81 | 82 | public Boolean getFloating() 83 | { 84 | return floating; 85 | } 86 | 87 | public WHighChartTitleOptions setFloating(Boolean floating) 88 | { 89 | this.floating = floating; 90 | return this; 91 | } 92 | 93 | public Number getMargin() 94 | { 95 | return margin; 96 | } 97 | 98 | public WHighChartTitleOptions setMargin(Number margin) 99 | { 100 | this.margin = margin; 101 | return this; 102 | } 103 | 104 | public String getText() 105 | { 106 | return text; 107 | } 108 | 109 | public WHighChartTitleOptions setText(String text) 110 | { 111 | this.text = text; 112 | return this; 113 | } 114 | 115 | public String getStyle() 116 | { 117 | return style; 118 | } 119 | 120 | public WHighChartTitleOptions setStyle(String style) 121 | { 122 | this.style = style; 123 | return this; 124 | } 125 | 126 | public WHighChartVerticalAlignmentType getVerticalAlign() 127 | { 128 | return verticalAlign; 129 | } 130 | 131 | public WHighChartTitleOptions setVerticalAlign(WHighChartVerticalAlignmentType verticalAlign) 132 | { 133 | this.verticalAlign = verticalAlign; 134 | return this; 135 | } 136 | 137 | public Number getX() 138 | { 139 | return x; 140 | } 141 | 142 | public WHighChartTitleOptions setX(Number x) 143 | { 144 | this.x = x; 145 | return this; 146 | } 147 | 148 | public Number getY() 149 | { 150 | return y; 151 | } 152 | 153 | public WHighChartTitleOptions setY(Number y) 154 | { 155 | this.y = y; 156 | return this; 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /src/main/java/nl/topicus/whighcharts/options/tooltip/WHighChartTooltipOptions.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.options.tooltip; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 6 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 9 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 10 | 11 | import nl.topicus.whighcharts.options.WHighChartFunction; 12 | import nl.topicus.whighcharts.options.WHighChartFunctionString; 13 | import nl.topicus.whighcharts.options.jackson.ToStringNoQuoteWithCurlyBracketsSerializer; 14 | 15 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) 16 | @JsonInclude(Include.NON_NULL) 17 | public class WHighChartTooltipOptions implements Serializable 18 | { 19 | private static final long serialVersionUID = 1L; 20 | 21 | private String backgroundColor; 22 | 23 | private String borderColor; 24 | 25 | private Number borderRadius; 26 | 27 | private Number borderWidth; 28 | 29 | // crosshairs: null, 30 | 31 | private Boolean enabled; 32 | 33 | private WHighChartFunction formatter; 34 | 35 | /** 36 | * The HTML of the tooltip header line. Variables are enclosed by curly brackets. 37 | * Available variables are point.key, series.name, series.color and other members from 38 | * the point and series objects. The point.key variable contains the category name, x 39 | * value or datetime string depending on the type of axis. For datetime axes, the 40 | * point.key date format can be set using tooltip.xDateFormat. 41 | * 42 | *

43 | * Defaults to {point.key} 44 | *

45 | */ 46 | private String headerFormat; 47 | 48 | /** 49 | * The HTML of the point's line in the tooltip. Variables are enclosed by curly 50 | * brackets. Available variables are point.x, point.y, series.name and series.color 51 | * and other properties on the same form. Furthermore, point.y can be extended by the 52 | * tooltip.yPrefix and tooltip.ySuffix variables. This can also be overridden for each 53 | * series, which makes it a good hook for displaying units. 54 | * 55 | *

56 | * Defaults to {series.name}: 57 | * {point.y} 58 | *

59 | */ 60 | private String pointFormat; 61 | 62 | /** 63 | * A string to append to the tooltip format. Defaults to false. 64 | */ 65 | private String footerFormat; 66 | 67 | private Boolean shadow; 68 | 69 | private Boolean shared; 70 | 71 | private Number snap; 72 | 73 | @JsonSerialize(using = ToStringNoQuoteWithCurlyBracketsSerializer.class) 74 | @JsonInclude(value = Include.NON_NULL) 75 | private String style; 76 | 77 | /** 78 | * Use HTML to render the contents of the tooltip instead of SVG. Using HTML allows 79 | * advanced formatting like tables and images in the tooltip. It is also recommended 80 | * for rtl languages as it works around rtl bugs in early Firefox. Defaults to false. 81 | */ 82 | private Boolean useHTML; 83 | 84 | public String getBackgroundColor() 85 | { 86 | return backgroundColor; 87 | } 88 | 89 | public WHighChartTooltipOptions setBackgroundColor(String backgroundColor) 90 | { 91 | this.backgroundColor = backgroundColor; 92 | return this; 93 | } 94 | 95 | public String getBorderColor() 96 | { 97 | return borderColor; 98 | } 99 | 100 | public WHighChartTooltipOptions setBorderColor(String borderColor) 101 | { 102 | this.borderColor = borderColor; 103 | return this; 104 | } 105 | 106 | public Number getBorderRadius() 107 | { 108 | return borderRadius; 109 | } 110 | 111 | public WHighChartTooltipOptions setBorderRadius(Number borderRadius) 112 | { 113 | this.borderRadius = borderRadius; 114 | return this; 115 | } 116 | 117 | public Number getBorderWidth() 118 | { 119 | return borderWidth; 120 | } 121 | 122 | public WHighChartTooltipOptions setBorderWidth(Number borderWidth) 123 | { 124 | this.borderWidth = borderWidth; 125 | return this; 126 | } 127 | 128 | public Boolean getEnabled() 129 | { 130 | return enabled; 131 | } 132 | 133 | public WHighChartTooltipOptions setEnabled(Boolean enabled) 134 | { 135 | this.enabled = enabled; 136 | return this; 137 | } 138 | 139 | public WHighChartFunction getFormatter() 140 | { 141 | return formatter; 142 | } 143 | 144 | public WHighChartTooltipOptions setFormatter(WHighChartFunction formatter) 145 | { 146 | this.formatter = formatter; 147 | return this; 148 | } 149 | 150 | public WHighChartTooltipOptions setFormatter(String formatter) 151 | { 152 | return setFormatter(new WHighChartFunctionString(formatter)); 153 | } 154 | 155 | public String getHeaderFormat() 156 | { 157 | return headerFormat; 158 | } 159 | 160 | public WHighChartTooltipOptions setHeaderFormat(String headerFormat) 161 | { 162 | this.headerFormat = headerFormat; 163 | return this; 164 | } 165 | 166 | public String getPointFormat() 167 | { 168 | return pointFormat; 169 | } 170 | 171 | public WHighChartTooltipOptions setPointFormat(String pointFormat) 172 | { 173 | this.pointFormat = pointFormat; 174 | return this; 175 | } 176 | 177 | public String getFooterFormat() 178 | { 179 | return footerFormat; 180 | } 181 | 182 | public WHighChartTooltipOptions setFooterFormat(String footerFormat) 183 | { 184 | this.footerFormat = footerFormat; 185 | return this; 186 | } 187 | 188 | public Boolean getShadow() 189 | { 190 | return shadow; 191 | } 192 | 193 | public WHighChartTooltipOptions setShadow(Boolean shadow) 194 | { 195 | this.shadow = shadow; 196 | return this; 197 | } 198 | 199 | public Boolean getShared() 200 | { 201 | return shared; 202 | } 203 | 204 | public WHighChartTooltipOptions setShared(Boolean shared) 205 | { 206 | this.shared = shared; 207 | return this; 208 | } 209 | 210 | public Number getSnap() 211 | { 212 | return snap; 213 | } 214 | 215 | public WHighChartTooltipOptions setSnap(Number snap) 216 | { 217 | this.snap = snap; 218 | return this; 219 | } 220 | 221 | public String getStyle() 222 | { 223 | return style; 224 | } 225 | 226 | public WHighChartTooltipOptions setStyle(String style) 227 | { 228 | this.style = style; 229 | return this; 230 | } 231 | 232 | public Boolean getUseHTML() 233 | { 234 | return useHTML; 235 | } 236 | 237 | public WHighChartTooltipOptions setUseHTML(Boolean useHTML) 238 | { 239 | this.useHTML = useHTML; 240 | return this; 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.appender.Stdout=org.apache.log4j.ConsoleAppender 2 | log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout 3 | log4j.appender.Stdout.layout.conversionPattern=[%d{ISO8601}] [%p] [%t] %C{1} | %m%n 4 | 5 | log4j.rootLogger=INFO,Stdout 6 | 7 | log4j.logger.org.apache.wicket=INFO 8 | log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO 9 | log4j.logger.org.apache.wicket.version=INFO 10 | log4j.logger.org.apache.wicket.RequestCycle=INFO 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/nl/topicus/whighcharts/components/adapters/jquery.highcharts.mootools-adapter.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.2 (2013-06-05) 3 | MooTools adapter 4 | 5 | (c) 2010-2013 Torstein Hønsi 6 | 7 | License: www.highcharts.com/license 8 | */ 9 | (function(){var e=window,h=document,f=e.MooTools.version.substring(0,3),i=f==="1.2"||f==="1.1",j=i||f==="1.3",g=e.$extend||function(){return Object.append.apply(Object,arguments)};e.HighchartsAdapter={init:function(a){var b=Fx.prototype,c=b.start,d=Fx.Morph.prototype,e=d.compute;b.start=function(b,d){var e=this.element;if(b.d)this.paths=a.init(e,e.d,this.toD);c.apply(this,arguments);return this};d.compute=function(b,c,d){var f=this.paths;if(f)this.element.attr("d",a.step(f[0],f[1],d,this.toD));else return e.apply(this, 10 | arguments)}},adapterRun:function(a,b){if(b==="width"||b==="height")return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=h.getElementsByTagName("head")[0],d=h.createElement("script");d.type="text/javascript";d.src=a;d.onload=b;c.appendChild(d)},animate:function(a,b,c){var d=a.attr,f=c&&c.complete;if(d&&!a.setStyle)a.getStyle=a.attr,a.setStyle=function(){var a=arguments;this.attr.call(this,a[0],a[1][0])},a.$family=function(){return!0};e.HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a), 11 | g({transition:Fx.Transitions.Quad.easeInOut},c));if(d)c.element=a;if(b.d)c.toD=b.d;f&&c.addEvent("complete",f);c.start(b);a.fx=c},each:function(a,b){return i?$each(a,b):Array.each(a,b)},map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){a=a.getPosition();return{left:a.x,top:a.y}},extendWithEvents:function(a){a.addEvent||(a.nodeName?$(a):g(a,new Events))},addEvent:function(a,b,c){typeof b==="string"&&(b=== 12 | "unload"&&(b="beforeunload"),e.HighchartsAdapter.extendWithEvents(a),a.addEvent(b,c))},removeEvent:function(a,b,c){typeof a!=="string"&&a.addEvent&&(b?(b==="unload"&&(b="beforeunload"),c?a.removeEvent(b,c):a.removeEvents&&a.removeEvents(b)):a.removeEvents())},fireEvent:function(a,b,c,d){b={type:b,target:a};b=j?new Event(b):new DOMEvent(b);b=g(b,c);if(!b.target&&b.event)b.target=b.event.target;b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},washMouseEvent:function(a){if(a.page)a.pageX= 13 | a.page.x,a.pageY=a.page.y;return a},stop:function(a){a.fx&&a.fx.cancel()}}})(); 14 | -------------------------------------------------------------------------------- /src/main/resources/nl/topicus/whighcharts/components/adapters/jquery.highcharts.prototype-adapter.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.2 (2013-06-05) 3 | Prototype adapter 4 | 5 | @author Michael Nelson, Torstein Hønsi. 6 | 7 | Feel free to use and modify this script. 8 | Highcharts license: www.highcharts.com/license. 9 | */ 10 | var HighchartsAdapter=function(){var f=typeof Effect!=="undefined";return{init:function(a){if(f)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(b,c,d,g){var e;this.element=b;this.key=c;e=b.attr?b.attr(c):$(b).getStyle(c);if(c==="d")this.paths=a.init(b,b.d,d),this.toD=d,e=0,d=1;this.start(Object.extend(g||{},{from:e,to:d,attribute:c}))},setup:function(){HighchartsAdapter._extend(this.element);if(!this.element._highchart_animation)this.element._highchart_animation={};this.element._highchart_animation[this.key]= 11 | this},update:function(b){var c=this.paths,d=this.element;c&&(b=a.step(c[0],c[1],b,this.toD));d.attr?d.element&&d.attr(this.options.attribute,b):(c={},c[this.options.attribute]=b,$(d).setStyle(c))},finish:function(){this.element&&this.element._highchart_animation&&delete this.element._highchart_animation[this.key]}})},adapterRun:function(a,b){return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=$$("head")[0];c&&c.appendChild((new Element("script",{type:"text/javascript",src:a})).observe("load", 12 | b))},addNS:function(a){var b=/^(?:click|mouse(?:down|up|over|move|out))$/;return/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/.test(a)||b.test(a)?a:"h:"+a},addEvent:function(a,b,c){a.addEventListener||a.attachEvent?Event.observe($(a),HighchartsAdapter.addNS(b),c):(HighchartsAdapter._extend(a),a._highcharts_observe(b,c))},animate:function(a,b,c){var d,c=c||{};c.delay=0;c.duration=(c.duration||500)/1E3;c.afterFinish=c.complete;if(f)for(d in b)new Effect.HighchartsTransition($(a), 13 | d,b[d],c);else{if(a.attr)for(d in b)a.attr(d,b[d]);c.complete&&c.complete()}a.attr||$(a).setStyle(b)},stop:function(a){var b;if(a._highcharts_extended&&a._highchart_animation)for(b in a._highchart_animation)a._highchart_animation[b].cancel()},each:function(a,b){$A(a).each(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){return $(a).cumulativeOffset()},fireEvent:function(a,b,c,d){a.fire?a.fire(HighchartsAdapter.addNS(b),c):a._highcharts_extended&&(c=c||{},a._highcharts_fire(b, 14 | c));c&&c.defaultPrevented&&(d=null);d&&d(c)},removeEvent:function(a,b,c){$(a).stopObserving&&(b&&(b=HighchartsAdapter.addNS(b)),$(a).stopObserving(b,c));window===a?Event.stopObserving(a,b,c):(HighchartsAdapter._extend(a),a._highcharts_stop_observing(b,c))},washMouseEvent:function(a){return a},grep:function(a,b){return a.findAll(b)},map:function(a,b){return a.map(b)},_extend:function(a){a._highcharts_extended||Object.extend(a,{_highchart_events:{},_highchart_animation:null,_highcharts_extended:!0, 15 | _highcharts_observe:function(b,a){this._highchart_events[b]=[this._highchart_events[b],a].compact().flatten()},_highcharts_stop_observing:function(b,a){b?a?this._highchart_events[b]=[this._highchart_events[b]].compact().flatten().without(a):delete this._highchart_events[b]:this._highchart_events={}},_highcharts_fire:function(a,c){var d=this;(this._highchart_events[a]||[]).each(function(a){if(!c.stopped)c.preventDefault=function(){c.defaultPrevented=!0},c.target=d,a.bind(this)(c)===!1&&c.preventDefault()}.bind(this))}})}}}(); 16 | -------------------------------------------------------------------------------- /src/main/resources/nl/topicus/whighcharts/components/jquery.whighcharts.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | wHighChartsSerializeEvent = function(attrs, event) { 3 | attrs.ep = { 4 | "event.currentTarget.name" : event.currentTarget.name, 5 | "event.type" : event.type, 6 | "event.altKey" : event.altKey, 7 | "event.ctrlKey" : event.ctrlKey, 8 | "event.shiftKey" : event.shiftKey, 9 | "event.checked" : event.checked, 10 | "event.chartX" : event.chartX, 11 | "event.chartY" : event.chartY 12 | } 13 | if (event.point != undefined) { 14 | attrs.ep["event.point.category"] = event.point.category; 15 | attrs.ep["event.point.config"] = event.point.config; 16 | } 17 | 18 | if (event.xAxis != undefined && event.xAxis[0] != undefined) { 19 | attrs.ep["event.xAxis0.value"] = event.xAxis[0].value; 20 | attrs.ep["event.xAxis0.min"] = event.xAxis[0].min; 21 | attrs.ep["event.xAxis0.max"] = event.xAxis[0].max; 22 | } 23 | 24 | if (event.yAxis != undefined && event.yAxis[0] != undefined) { 25 | attrs.ep["event.yAxis0.value"] = event.yAxis[0].value; 26 | attrs.ep["event.yAxis0.min"] = event.yAxis[0].min; 27 | attrs.ep["event.yAxis0.max"] = event.yAxis[0].max; 28 | } 29 | 30 | return attrs; 31 | }; 32 | })(); 33 | -------------------------------------------------------------------------------- /src/main/resources/nl/topicus/whighcharts/components/jquery.whighcharts.min.js: -------------------------------------------------------------------------------- 1 | (function(){wHighChartsSerializeEvent=function(event){var queryString="event.currentTarget.name="+event.currentTarget.name+"&event.type="+event.type+"&event.altKey="+event.altKey+"&event.ctrlKey="+event.ctrlKey+"&event.shiftKey="+event.shiftKey+"&event.checked="+event.checked;if(event.point!=undefined){queryString+="&event.point.category="+event.point.category+"&event.point.config="+event.point.config;}queryString+="&event.chartX="+event.chartX+"&event.chartY="+event.chartY;if(event.xAxis!=undefined&&event.xAxis[0]!=undefined){queryString+="&event.xAxis[0].value="+event.xAxis[0].value+"&event.xAxis[0].min="+event.xAxis[0].min+"&event.xAxis[0].max="+event.xAxis[0].max;}if(event.yAxis!=undefined&&event.yAxis[0]!=undefined){queryString+=+"&event.yAxis[0].value="+event.yAxis[0].value+"&event.yAxis[0].min="+event.yAxis[0].min+"&event.yAxis[0].max="+event.yAxis[0].max;}return queryString;};})(); -------------------------------------------------------------------------------- /src/main/resources/nl/topicus/whighcharts/components/modules/jquery.highcharts.exporting.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | Highcharts JS v3.0.2 (2013-06-05) 3 | Exporting module 4 | 5 | (c) 2010-2013 Torstein Hønsi 6 | 7 | License: www.highcharts.com/license 8 | */ 9 | (function(e){var y=e.Chart,v=e.addEvent,B=e.removeEvent,m=e.createElement,j=e.discardElement,t=e.css,k=e.merge,r=e.each,p=e.extend,C=Math.max,i=document,z=window,D=e.isTouchDevice,E=e.Renderer.prototype.symbols,s=e.getOptions(),w;p(s.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});s.navigation={menuStyle:{border:"1px solid #A0A0A0", 10 | background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:D?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{symbol:"menu", 11 | _titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};e.post=function(a,b){var c,d;d=m("form",{method:"post",action:a,enctype:"multipart/form-data"}, 12 | {display:"none"},i.body);for(c in b)m("input",{type:"hidden",name:c,value:b[c]},null,d);d.submit();j(d)};p(y.prototype,{getSVG:function(a){var b=this,c,d,x,g,f=k(b.options,a);if(!i.createElementNS)i.createElementNS=function(a,b){return i.createElement(b)};a=m("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},i.body);d=b.renderTo.style.width;g=b.renderTo.style.height;d=f.exporting.sourceWidth||f.chart.width||/px$/.test(d)&&parseInt(d,10)||600;g=f.exporting.sourceHeight|| 13 | f.chart.height||/px$/.test(g)&&parseInt(g,10)||400;p(f.chart,{animation:!1,renderTo:a,forExport:!0,width:d,height:g});f.exporting.enabled=!1;f.series=[];r(b.series,function(a){x=k(a.options,{animation:!1,showCheckbox:!1,visible:a.visible});x.isInternal||f.series.push(x)});c=new e.Chart(f,b.callback);r(["xAxis","yAxis"],function(a){r(b[a],function(b,d){var f=c[a][d],e=b.getExtremes(),g=e.userMin,e=e.userMax;(g!==void 0||e!==void 0)&&f.setExtremes(g,e,!0,!1)})});d=c.container.innerHTML;f=null;c.destroy(); 14 | j(a);d=d.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/,"").replace(/ /g," ").replace(/­/g,"­").replace(//g, 15 | 'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});d=d.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'");d.match(/ xmlns="/g).length===2&&(d=d.replace(/xmlns="[^"]+"/,""));return d},exportChart:function(a,b){var a=a||{},c=this.options.exporting,c=this.getSVG(k({chart:{borderRadius:0}},c.chartOptions,b,{exporting:{sourceWidth:a.sourceWidth|| 16 | c.sourceWidth,sourceHeight:a.sourceHeight||c.sourceHeight}})),a=k(this.options.exporting,a);e.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale||2,svg:c})},print:function(){var a=this,b=a.container,c=[],d=b.parentNode,e=i.body,g=e.childNodes;if(!a.isPrinting)a.isPrinting=!0,r(g,function(a,b){if(a.nodeType===1)c[b]=a.style.display,a.style.display="none"}),e.appendChild(b),z.focus(),z.print(),setTimeout(function(){d.appendChild(b);r(g,function(a,b){if(a.nodeType=== 17 | 1)a.style.display=c[b]});a.isPrinting=!1},1E3)},contextMenu:function(a,b,c,d,e,g,f){var h=this,q=h.options.navigation,n=q.menuItemStyle,o=h.chartWidth,i=h.chartHeight,A="cache-"+a,l=h[A],k=C(e,g),u,j,s;if(!l)h[A]=l=m("div",{className:"highcharts-"+a},{position:"absolute",zIndex:1E3,padding:k+"px"},h.container),u=m("div",null,p({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},q.menuStyle),l),j=function(){t(l,{display:"none"});f&&f.setState(0);h.openMenu= 18 | !1},v(l,"mouseleave",function(){s=setTimeout(j,500)}),v(l,"mouseenter",function(){clearTimeout(s)}),r(b,function(a){if(a){var b=a.separator?m("hr",null,null,u):m("div",{onmouseover:function(){t(this,q.menuItemHoverStyle)},onmouseout:function(){t(this,n)},onclick:function(){j();a.onclick.apply(h,arguments)},innerHTML:a.text||h.options.lang[a.textKey]},p({cursor:"pointer"},n),u);h.exportDivElements.push(b)}}),h.exportDivElements.push(u,l),h.exportMenuWidth=l.offsetWidth,h.exportMenuHeight=l.offsetHeight; 19 | a={display:"block"};c+h.exportMenuWidth>o?a.right=o-c-e-k+"px":a.left=c-k+"px";d+g+h.exportMenuHeight>i?a.bottom=i-d-k+"px":a.top=d+g-k+"px";t(l,a);h.openMenu=!0},addButton:function(a){var b=this,c=b.renderer,a=k(b.options.navigation.buttonOptions,a),d=a.onclick,i=a.menuItems,g,f,h={stroke:a.symbolStroke,fill:a.symbolFill},q=a.symbolSize||12;if(!b.btnCount)b.btnCount=0;b.btnCount++;if(!b.exportDivElements)b.exportDivElements=[],b.exportSVGElements=[];if(a.enabled!==!1){var n=a.theme,o=n.states,m= 20 | o&&o.hover,o=o&&o.select,j;delete n.states;d?j=function(){d.apply(b,arguments)}:i&&(j=function(){b.contextMenu("contextmenu",i,f.translateX,f.translateY,f.width,f.height,f);f.setState(2)});a.text&&a.symbol?n.paddingLeft=e.pick(n.paddingLeft,25):a.text||p(n,{width:a.width,height:a.height,padding:0});f=c.button(a.text,0,0,j,n,m,o).attr({title:b.options.lang[a._titleKey],"stroke-linecap":"round"});a.symbol&&(g=c.symbol(a.symbol,a.symbolX-q/2,a.symbolY-q/2,q,q).attr(p(h,{"stroke-width":a.symbolStrokeWidth|| 21 | 1,zIndex:1})).add(f));f.add().align(p(a,{width:f.width,x:e.pick(a.x,w)}),!0,"spacingBox");w+=(f.width+a.buttonSpacing)*(a.align==="right"?-1:1);b.exportSVGElements.push(f,g)}},destroyExport:function(a){var a=a.target,b,c;for(b=0;b>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); 31 | server.start(); 32 | System.in.read(); 33 | System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); 34 | server.stop(); 35 | server.join(); 36 | } 37 | catch (Exception e) 38 | { 39 | e.printStackTrace(); 40 | System.exit(100); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/WicketApplication.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web; 2 | 3 | import org.apache.wicket.protocol.http.WebApplication; 4 | import org.apache.wicket.util.time.Duration; 5 | 6 | import nl.topicus.whighcharts.web.pages.HomePage; 7 | 8 | /** 9 | * Application object for your web application. If you want to run this application 10 | * without deploying, run the Start class. 11 | * 12 | */ 13 | public class WicketApplication extends WebApplication 14 | { 15 | @Override 16 | public Class getHomePage() 17 | { 18 | return HomePage.class; 19 | } 20 | 21 | @Override 22 | protected void init() 23 | { 24 | super.init(); 25 | 26 | getMarkupSettings().setStripWicketTags(true); 27 | getResourceSettings().setResourcePollFrequency(Duration.ONE_MINUTE); 28 | 29 | getRequestLoggerSettings().setRequestLoggerEnabled(true); 30 | getRequestLoggerSettings().setRequestsWindowSize(200); 31 | getRequestLoggerSettings().setRecordSessionSize(true); 32 | } 33 | 34 | public static WicketApplication get() 35 | { 36 | return (WicketApplication) WebApplication.get(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/BasePage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Topicus WHighCharts 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/BasePage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages; 2 | 3 | import org.apache.wicket.markup.html.WebPage; 4 | 5 | public class BasePage extends WebPage 6 | { 7 | private static final long serialVersionUID = 1L; 8 | 9 | public BasePage() 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/HomePage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
    5 |
  • 6 |
7 |
8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/HomePage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.apache.wicket.Page; 7 | import org.apache.wicket.markup.html.basic.Label; 8 | import org.apache.wicket.markup.html.link.BookmarkablePageLink; 9 | import org.apache.wicket.markup.html.list.ListItem; 10 | import org.apache.wicket.markup.html.list.ListView; 11 | import org.apache.wicket.model.util.ListModel; 12 | 13 | import nl.topicus.whighcharts.web.pages.examples.AjaxBasicPage; 14 | import nl.topicus.whighcharts.web.pages.examples.AreaBasicPage; 15 | import nl.topicus.whighcharts.web.pages.examples.AreaInvertedPage; 16 | import nl.topicus.whighcharts.web.pages.examples.AreaMissingPage; 17 | import nl.topicus.whighcharts.web.pages.examples.AreaNegativePage; 18 | import nl.topicus.whighcharts.web.pages.examples.AreasplinePage; 19 | 20 | public class HomePage extends BasePage 21 | { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public HomePage() 25 | { 26 | List> pages = new ArrayList>(); 27 | 28 | /* 29 | * Examples 30 | */ 31 | pages.add(AreaBasicPage.class); 32 | pages.add(AreaInvertedPage.class); 33 | pages.add(AreaMissingPage.class); 34 | pages.add(AreaNegativePage.class); 35 | pages.add(AreasplinePage.class); 36 | pages.add(AjaxBasicPage.class); 37 | 38 | ListView> links = 39 | new ListView>("links", new ListModel>( 40 | pages)) 41 | { 42 | private static final long serialVersionUID = 1L; 43 | 44 | @Override 45 | protected void populateItem(ListItem> item) 46 | { 47 | BookmarkablePageLink link = 48 | new BookmarkablePageLink("link", item.getModelObject()); 49 | item.add(link); 50 | link.add(new Label("label", item.getModelObject().getName())); 51 | } 52 | }; 53 | add(links); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AjaxBasicPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AjaxBasicPage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.WHighChartFunctionCallback; 5 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 6 | import nl.topicus.whighcharts.options.plotoptions.WHighChartPlotAreaMarkerSymbolType; 7 | import nl.topicus.whighcharts.options.series.IntegerSeries; 8 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 9 | import nl.topicus.whighcharts.web.pages.BasePage; 10 | 11 | public class AjaxBasicPage extends BasePage 12 | { 13 | private static final long serialVersionUID = 1L; 14 | 15 | public AjaxBasicPage() 16 | { 17 | WHighChart chart = 18 | new WHighChart("container"); 19 | chart.getOptions().getExporting().setEnabled(true); 20 | 21 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.area); 22 | chart.getOptions().getTitle().setText("US and USSR nuclear stockpiles"); 23 | chart 24 | .getOptions() 25 | .getSubtitle() 26 | .setText( 27 | "Source: " 28 | + "thebulletin.metapress.com"); 29 | 30 | chart.getOptions().getxAxis().getLabels().setFormatter("return this.value;"); 31 | chart.getOptions().getyAxis().getTitle().setText("Nuclear weapon states"); 32 | chart.getOptions().getyAxis().getLabels().setFormatter("return this.value / 1000 +'k';"); 33 | 34 | chart 35 | .getOptions() 36 | .getTooltip() 37 | .setFormatter( 38 | "return this.series.name +' produced '+ Highcharts.numberFormat(this.y, 0) +'
warheads in '+ this.x;"); 39 | 40 | chart.getOptions().getPlotOptions().getArea().setPointStart(1940).getMarker() 41 | .setEnabled(false).setSymbol(WHighChartPlotAreaMarkerSymbolType.circle).setRadius(2) 42 | .getStates().getHover().setEnabled(true); 43 | 44 | chart.getOptions().getChart().getEvents() 45 | .setClick(new WHighChartFunctionCallback(getPage())); 46 | chart.getOptions().getPoint().getEvents() 47 | .setClick(new WHighChartFunctionCallback(getPage())); 48 | chart.getOptions().getPlotOptions().getSeries().getPoint().getEvents() 49 | .setClick(new WHighChartFunctionCallback(getPage())); 50 | 51 | chart.getOptions().addSeries( 52 | new IntegerSeries(null, null, null, null, null, 6, 11, 32, 110, 235, 369, 640, 53 | 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126, 27387, 29459, 31056, 54 | 31982, 32040, 31233, 29224, 27342, 26662, 26956, 27912, 28999, 28965, 27826, 25579, 55 | 25722, 24826, 24605, 24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586, 56 | 22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950, 10871, 10824, 10577, 57 | 10527, 10475, 10421, 10358, 10295, 10104).setName("USA")); 58 | 59 | chart.getOptions().addSeries( 60 | new IntegerSeries(null, null, null, null, null, null, null, null, null, null, 5, 61 | 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322, 4238, 5221, 6129, 62 | 7089, 8339, 9399, 10538, 11643, 13092, 14478, 15915, 17385, 19055, 21205, 23044, 63 | 25393, 27935, 30062, 32049, 33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 64 | 37000, 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000, 21000, 20000, 65 | 19000, 18000, 18000, 17000, 16000).setName("USSR/Russia")); 66 | 67 | add(chart); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaBasicPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaBasicPage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 5 | import nl.topicus.whighcharts.options.plotoptions.WHighChartPlotAreaMarkerSymbolType; 6 | import nl.topicus.whighcharts.options.series.IntegerSeries; 7 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 8 | import nl.topicus.whighcharts.web.pages.BasePage; 9 | 10 | public class AreaBasicPage extends BasePage 11 | { 12 | private static final long serialVersionUID = 1L; 13 | 14 | public AreaBasicPage() 15 | { 16 | WHighChart chart = 17 | new WHighChart("container"); 18 | chart.getOptions().getExporting().setEnabled(true); 19 | 20 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.area); 21 | chart.getOptions().getTitle().setText("US and USSR nuclear stockpiles"); 22 | chart.getOptions().getSubtitle().setText( 23 | "Source: " 24 | + "thebulletin.metapress.com"); 25 | 26 | chart.getOptions().getxAxis().getLabels().setFormatter("return this.value;"); 27 | chart.getOptions().getyAxis().getTitle().setText("Nuclear weapon states"); 28 | chart.getOptions().getyAxis().getLabels().setFormatter("return this.value / 1000 +'k';"); 29 | 30 | chart.getOptions().getTooltip().setFormatter( 31 | "return this.series.name +' produced '+ Highcharts.numberFormat(this.y, 0) +'
warheads in '+ this.x;"); 32 | 33 | chart.getOptions().getPlotOptions().getArea().setPointStart(1940).getMarker() 34 | .setEnabled(false).setSymbol(WHighChartPlotAreaMarkerSymbolType.circle).setRadius(2) 35 | .getStates().getHover().setEnabled(true); 36 | 37 | chart.getOptions() 38 | .addSeries(new IntegerSeries(null, null, null, null, null, 6, 11, 32, 110, 235, 39 | 369, 640, 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126, 27387, 40 | 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662, 26956, 27912, 28999, 28965, 41 | 27826, 25579, 25722, 24826, 24605, 24304, 23464, 23708, 24099, 24357, 24237, 24401, 42 | 24344, 23586, 22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950, 10871, 43 | 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104).setName("USA")); 44 | 45 | chart.getOptions() 46 | .addSeries(new IntegerSeries(null, null, null, null, null, null, null, null, 47 | null, null, 5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322, 4238, 48 | 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478, 15915, 17385, 19055, 49 | 21205, 23044, 25393, 27935, 30062, 32049, 33952, 35804, 37431, 39197, 45000, 43000, 50 | 41000, 39000, 37000, 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000, 51 | 21000, 20000, 19000, 18000, 18000, 17000, 16000).setName("USSR/Russia")); 52 | 53 | add(chart); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaInvertedPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaInvertedPage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 5 | import nl.topicus.whighcharts.options.WHighChartVerticalAlignmentType; 6 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 7 | import nl.topicus.whighcharts.options.legend.WHighChartLegendLayoutType; 8 | import nl.topicus.whighcharts.options.series.IntegerSeries; 9 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 10 | import nl.topicus.whighcharts.web.pages.BasePage; 11 | 12 | public class AreaInvertedPage extends BasePage 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | public AreaInvertedPage() 17 | { 18 | WHighChart chart = 19 | new WHighChart("container"); 20 | chart.getOptions().getExporting().setEnabled(true); 21 | 22 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.area).setInverted(true); 23 | chart.getOptions().getTitle().setText("Average fruit consumption during one week"); 24 | chart.getOptions().getSubtitle() 25 | .setStyle("position: 'absolute', right: '0px', bottom: '10px'"); 26 | 27 | chart.getOptions().getLegend().setLayout(WHighChartLegendLayoutType.vertical) 28 | .setAlign(WHighChartHorizontalAlignmentType.right) 29 | .setVerticalAlign(WHighChartVerticalAlignmentType.top).setX(-150).setY(100) 30 | .setFloating(true).setBorderWidth(1).setBackgroundColor("#FFFFFF"); 31 | 32 | chart.getOptions().getxAxis().setCategories("Monday", "Tuesday", "Wednesday", "Thursday", 33 | "Friday", "Saturday", "Sunday"); 34 | 35 | chart.getOptions().getyAxis().getTitle().setText("Number of units"); 36 | chart.getOptions().getyAxis().getLabels().setFormatter("return this.value;"); 37 | chart.getOptions().getyAxis().setMin(0); 38 | 39 | chart.getOptions().getTooltip().setFormatter("return ''+ this.x +': '+ this.y;"); 40 | 41 | chart.getOptions().getPlotOptions().getArea().setFillOpacity(0.5d); 42 | 43 | chart.getOptions().addSeries(new IntegerSeries(3, 4, 3, 5, 4, 10, 12).setName("John")); 44 | chart.getOptions().addSeries(new IntegerSeries(1, 3, 4, 3, 3, 5, 4).setName("Jane")); 45 | 46 | add(chart); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaMissingPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaMissingPage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 5 | import nl.topicus.whighcharts.options.WHighChartVerticalAlignmentType; 6 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 7 | import nl.topicus.whighcharts.options.legend.WHighChartLegendLayoutType; 8 | import nl.topicus.whighcharts.options.series.IntegerSeries; 9 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 10 | import nl.topicus.whighcharts.web.pages.BasePage; 11 | 12 | public class AreaMissingPage extends BasePage 13 | { 14 | private static final long serialVersionUID = 1L; 15 | 16 | public AreaMissingPage() 17 | { 18 | WHighChart chart = 19 | new WHighChart("container"); 20 | chart.getOptions().getExporting().setEnabled(true); 21 | 22 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.area) 23 | .setSpacingBottom(30d); 24 | chart.getOptions().getTitle().setText("Fruit consumption *"); 25 | chart.getOptions().getSubtitle().setText("* Jane\'s banana consumption is unknown") 26 | .setFloating(true).setAlign(WHighChartHorizontalAlignmentType.right) 27 | .setVerticalAlign(WHighChartVerticalAlignmentType.bottom).setY(15); 28 | 29 | chart.getOptions().getLegend().setLayout(WHighChartLegendLayoutType.vertical) 30 | .setAlign(WHighChartHorizontalAlignmentType.left) 31 | .setVerticalAlign(WHighChartVerticalAlignmentType.top).setX(150).setY(100) 32 | .setFloating(true).setBorderWidth(1).setBackgroundColor("#FFFFFF"); 33 | 34 | chart.getOptions().getxAxis().setCategories("Apples", "Pears", "Oranges", "Bananas", 35 | "Grapes", "Plums", "Strawberries", "Raspberries"); 36 | 37 | chart.getOptions().getyAxis().getTitle().setText("Y-Axis"); 38 | chart.getOptions().getyAxis().getLabels().setFormatter("return this.value;"); 39 | 40 | chart.getOptions().getTooltip() 41 | .setFormatter("return ''+ this.series.name +'
'+this.x +': '+ this.y;"); 42 | 43 | chart.getOptions().getPlotOptions().getArea().setFillOpacity(0.5d); 44 | 45 | chart.getOptions().getCredits().setEnabled(false); 46 | 47 | chart.getOptions().addSeries(new IntegerSeries(0, 1, 4, 4, 5, 2, 3, 7).setName("John")); 48 | chart.getOptions().addSeries(new IntegerSeries(1, 0, 3, null, 3, 1, 2, 1).setName("Jane")); 49 | 50 | add(chart); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaNegativePage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreaNegativePage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 5 | import nl.topicus.whighcharts.options.series.IntegerSeries; 6 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 7 | import nl.topicus.whighcharts.web.pages.BasePage; 8 | 9 | public class AreaNegativePage extends BasePage 10 | { 11 | private static final long serialVersionUID = 1L; 12 | 13 | public AreaNegativePage() 14 | { 15 | WHighChart chart = 16 | new WHighChart("container"); 17 | chart.getOptions().getExporting().setEnabled(true); 18 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.area); 19 | chart.getOptions().getTitle().setText("Area chart with negative values"); 20 | 21 | chart.getOptions().getxAxis().setCategories("Apples", "Oranges", "Pears", "Grapes", 22 | "Bananas"); 23 | 24 | chart.getOptions().getTooltip() 25 | .setFormatter("return ''+ this.series.name +': '+ this.y +'';"); 26 | 27 | chart.getOptions().getCredits().setEnabled(false); 28 | 29 | chart.getOptions().addSeries(new IntegerSeries(5, 3, 4, 7, 2).setName("John")); 30 | chart.getOptions().addSeries(new IntegerSeries(2, -2, -3, 2, 1).setName("Jane")); 31 | chart.getOptions().addSeries(new IntegerSeries(3, 4, 4, -2, 5).setName("Joe")); 32 | 33 | add(chart); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreasplinePage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /src/test/java/nl/topicus/whighcharts/web/pages/examples/AreasplinePage.java: -------------------------------------------------------------------------------- 1 | package nl.topicus.whighcharts.web.pages.examples; 2 | 3 | import nl.topicus.whighcharts.components.WHighChart; 4 | import nl.topicus.whighcharts.options.WHighChartHorizontalAlignmentType; 5 | import nl.topicus.whighcharts.options.WHighChartVerticalAlignmentType; 6 | import nl.topicus.whighcharts.options.axis.WHighChartAxisPlotBandsOptions; 7 | import nl.topicus.whighcharts.options.chart.WHighChartChartOptionsType; 8 | import nl.topicus.whighcharts.options.legend.WHighChartLegendLayoutType; 9 | import nl.topicus.whighcharts.options.series.IntegerSeries; 10 | import nl.topicus.whighcharts.options.series.IntegerSeriesEntry; 11 | import nl.topicus.whighcharts.web.pages.BasePage; 12 | 13 | public class AreasplinePage extends BasePage 14 | { 15 | private static final long serialVersionUID = 1L; 16 | 17 | public AreasplinePage() 18 | { 19 | WHighChart chart = 20 | new WHighChart("container"); 21 | chart.getOptions().getExporting().setEnabled(true); 22 | chart.getOptions().getChart().setType(WHighChartChartOptionsType.areaspline); 23 | chart.getOptions().getTitle().setText("Average fruit consumption during one week"); 24 | 25 | chart.getOptions().getLegend().setLayout(WHighChartLegendLayoutType.vertical) 26 | .setAlign(WHighChartHorizontalAlignmentType.left) 27 | .setVerticalAlign(WHighChartVerticalAlignmentType.top).setX(150).setY(100) 28 | .setFloating(true).setBorderWidth(1).setBackgroundColor("#FFFFFF"); 29 | 30 | chart.getOptions().getxAxis().setCategories("Monday", "Tuesday", "Wednesday", "Thursday", 31 | "Friday", "Saturday", "Sunday"); 32 | chart.getOptions().getxAxis().addPlotBand(new WHighChartAxisPlotBandsOptions().setFrom(4.5d) 33 | .setTo(6.5d).setColor("rgba(68, 170, 213, .2)")); 34 | 35 | chart.getOptions().getyAxis().getTitle().setText("Fruit units"); 36 | 37 | chart.getOptions().getTooltip().setFormatter("return ''+ this.x +': '+ this.y +' units';"); 38 | 39 | chart.getOptions().getCredits().setEnabled(false); 40 | 41 | chart.getOptions().getPlotOptions().getAreaspline().setFillOpacity(0.5d); 42 | 43 | chart.getOptions().addSeries(new IntegerSeries(3, 4, 3, 5, 4, 10, 12).setName("John")); 44 | chart.getOptions().addSeries(new IntegerSeries(1, 3, 4, 3, 3, 5, 4).setName("Jane")); 45 | 46 | add(chart); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/test/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | Topicus WiQuery-HighCharts 7 | 8 | wicket.server 9 | org.apache.wicket.protocol.http.WicketFilter 10 | 11 | applicationClassName 12 | nl.topicus.whighcharts.web.WicketApplication 13 | 14 | 15 | 16 | 17 | wicket.server 18 | /* 19 | 20 | 21 | --------------------------------------------------------------------------------