org.moxieapps.gwt.highcharts.client
Class Lang

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<Lang>
      extended by org.moxieapps.gwt.highcharts.client.Lang

public class Lang
extends Configurable<Lang>

A configurable class that can be used to globally configure the messages displayed by Highcharts. These options should be configured prior to the initialization of any chart instance.

Example usage:

   Highcharts.setOptions(
     new Highcharts.Options().setLang(
         new Lang()
           .setMonths(new String[] { 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
             'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' })
           .setWeekdays(new String[] {'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'})
   ));
 

Since:
1.4.0
Author:
myersj@gmail.com (Jeff Myers)

Constructor Summary
Lang()
           
 
Method Summary
 Lang setDecimalPoint(String decimalPoint)
          Convenience method for setting the 'decimalPoint' lang option.
 Lang setDownloadJPEG(String downloadJPEG)
          Convenience method for setting the 'downloadJPEG' lang option.
 Lang setDownloadPDF(String downloadPDF)
          Convenience method for setting the 'downloadPDF' lang option.
 Lang setDownloadPNG(String downloadPNG)
          Convenience method for setting the 'downloadPNG' lang option.
 Lang setDownloadSVG(String downloadSVG)
          Convenience method for setting the 'downloadSVG' lang option.
 Lang setExportButtonTitle(String exportButtonTitle)
          Convenience method for setting the 'exportButtonTitle' lang option.
 Lang setLoading(String loading)
          Convenience method for setting the 'loading' lang option.
 Lang setMonths(String[] months)
          Convenience method for setting the 'months' lang option.
 Lang setNoData(String noData)
          Convenience method for setting the 'noData' option of the chart.
 Lang setPrintButtonTitle(String printButtonTitle)
          Convenience method for setting the 'printButtonTitle' lang option.
 Lang setRangeSelectorFrom(String rangeSelectorFrom)
          Convenience method for setting the 'rangeSelectorFrom' lang option.
 Lang setRangeSelectorTo(String rangeSelectorTo)
          Convenience method for setting the 'rangeSelectorTo' lang option.
 Lang setRangeSelectorZoom(String rangeSelectorZoom)
          Convenience method for setting the 'rangeSelectorZoom' lang option.
 Lang setResetZoom(String resetZoom)
          Convenience method for setting the 'resetZoom' lang option.
 Lang setResetZoomTitle(String resetZoomTitle)
          Convenience method for setting the 'resetZoomTitle' lang option.
 Lang setShortMonths(String[] shortMonths)
          Convenience method for setting the 'shortMonths' lang option.
 Lang setThousandsSep(String thousandsSep)
          Convenience method for setting the 'thousandsSep' lang option.
 Lang setWeekdays(String[] weekdays)
          Convenience method for setting the 'weekdays' lang option.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable
getOptions, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lang

public Lang()
Method Detail

setDecimalPoint

public Lang setDecimalPoint(String decimalPoint)
Convenience method for setting the 'decimalPoint' lang option. Equivalent to:

     lang.setOption("decimalPoint", ",");
 
The default decimal point used in the Highcharts.numberFormat method unless otherwise specified in the function arguments. Defaults to ".".

Parameters:
decimalPoint - value to used as the decimal point by default when formatting numbers
Returns:
A reference to this Lang instance for convenient method chaining.

setDownloadPNG

public Lang setDownloadPNG(String downloadPNG)
Convenience method for setting the 'downloadPNG' lang option. Equivalent to:

     lang.setOption("downloadPNG", "PNG");
 
Exporting module only. The text for the PNG download menu item. Defaults to "Download PNG image".

Parameters:
downloadPNG - text for the PNG download menu item
Returns:
A reference to this Lang instance for convenient method chaining.

setDownloadJPEG

public Lang setDownloadJPEG(String downloadJPEG)
Convenience method for setting the 'downloadJPEG' lang option. Equivalent to:

     lang.setOption("downloadJPEG", "JPEG");
 
Exporting module only. The text for the JPEG download menu item. Defaults to "Download JPEG image".

Parameters:
downloadJPEG - text for the JPEG download menu item
Returns:
A reference to this Lang instance for convenient method chaining.

setDownloadPDF

public Lang setDownloadPDF(String downloadPDF)
Convenience method for setting the 'downloadPDF' lang option. Equivalent to:

     lang.setOption("downloadPDF", "PDF");
 
Exporting module only. The text for the PDF download menu item. Defaults to "Download PDF document".

Parameters:
downloadPDF - text for the PDF download menu item
Returns:
A reference to this Lang instance for convenient method chaining.

setDownloadSVG

public Lang setDownloadSVG(String downloadSVG)
Convenience method for setting the 'downloadSVG' lang option. Equivalent to:

     lang.setOption("downloadSVG", "SVG");
 
Exporting module only. The text for the SVG download menu item. Defaults to "Download SVG vector image".

Parameters:
downloadSVG - text for the SVG download menu item
Returns:
A reference to this Lang instance for convenient method chaining.

setExportButtonTitle

public Lang setExportButtonTitle(String exportButtonTitle)
Convenience method for setting the 'exportButtonTitle' lang option. Equivalent to:

     lang.setOption("exportButtonTitle", "Export");
 
Exporting module only. The tooltip text for the export button. Defaults to "Export to raster or vector image".

Parameters:
exportButtonTitle - tooltip text for the export button
Returns:
A reference to this Lang instance for convenient method chaining.

setLoading

public Lang setLoading(String loading)
Convenience method for setting the 'loading' lang option. Equivalent to:

     lang.setOption("loading", "Loading");
 
The loading text that appears when the chart is set into the loading state following a call to chart.showLoading. Defaults to "Loading...".

Parameters:
loading - loading text message
Returns:
A reference to this Lang instance for convenient method chaining.

setMonths

public Lang setMonths(String[] months)
Convenience method for setting the 'months' lang option. Equivalent to:

     lang.setOption("months", months);
 
An array containing the months names. Defaults to ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'].

Parameters:
months - array containing the months names
Returns:
A reference to this Lang instance for convenient method chaining.
Throws:
IllegalArgumentException - if months param is null or not exactly 12 items.

setNoData

public Lang setNoData(String noData)
Convenience method for setting the 'noData' option of the chart. Equivalent to:

     lsng.setOption("noData", "no data to display");
 
The text to display when the chart has no data. Defaults to "No data to display"

Parameters:
noData - A String representing the message to be shown when a chart has no data
Returns:
A reference to this Lang instance for convenient method chaining.

setShortMonths

public Lang setShortMonths(String[] shortMonths)
Convenience method for setting the 'shortMonths' lang option. Equivalent to:

     lang.setOption("shortMonths", shortMonths);
 
An array containing the months names in abbreviated form. Corresponds to the %b format in Highcharts.dateFormat(). Defaults to ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'].

Parameters:
shortMonths - array containing the months names in abbreviated form
Returns:
A reference to this Lang instance for convenient method chaining.
Throws:
IllegalArgumentException - if shortMonths param is null or not exactly 12 items.

setPrintButtonTitle

public Lang setPrintButtonTitle(String printButtonTitle)
Convenience method for setting the 'printButtonTitle' lang option. Equivalent to:

     lang.setOption("printButtonTitle", "Print");
 
Exporting module only. The tooltip text for the print button. Defaults to "Print the chart".

Parameters:
printButtonTitle - tooltip text for the print button
Returns:
A reference to this Lang instance for convenient method chaining.

setRangeSelectorFrom

public Lang setRangeSelectorFrom(String rangeSelectorFrom)
Convenience method for setting the 'rangeSelectorFrom' lang option. Equivalent to:

     lang.setOption("rangeSelectorFrom", "Start");
 
StockChart only. The text for the label for the "from" input box in the range selector. Defaults to "From".

Parameters:
rangeSelectorFrom - text for the label for the "from" input box
Returns:
A reference to this Lang instance for convenient method chaining.

setRangeSelectorTo

public Lang setRangeSelectorTo(String rangeSelectorTo)
Convenience method for setting the 'rangeSelectorTo' lang option. Equivalent to:

     lang.setOption("rangeSelectorTo", "End");
 
StockChart only. The text for the label for the "to" input box in the range selector. Defaults to "To".

Parameters:
rangeSelectorTo - text for the label for the "to" input box
Returns:
A reference to this Lang instance for convenient method chaining.

setRangeSelectorZoom

public Lang setRangeSelectorZoom(String rangeSelectorZoom)
Convenience method for setting the 'rangeSelectorZoom' lang option. Equivalent to:

     lang.setOption("rangeSelectorZoom", "zoom");
 
StockChart only. The text for the label for the range selector buttons. Defaults to "Zoom".

Parameters:
rangeSelectorZoom - text for the label for the range selector buttons
Returns:
A reference to this Lang instance for convenient method chaining.

setResetZoom

public Lang setResetZoom(String resetZoom)
Convenience method for setting the 'resetZoom' lang option. Equivalent to:

     lang.setOption("resetZoom", "Reset");
 
The text for the label appearing when a chart is zoomed. Defaults to "Reset zoom".

Parameters:
resetZoom - text for the label appearing when a chart is zoomed
Returns:
A reference to this Lang instance for convenient method chaining.

setResetZoomTitle

public Lang setResetZoomTitle(String resetZoomTitle)
Convenience method for setting the 'resetZoomTitle' lang option. Equivalent to:

     lang.setOption("resetZoomTitle", "Reset");
 
The tooltip title for the label appearing when a chart is zoomed. Defaults to "Reset zoom level 1:1."

Parameters:
resetZoomTitle - tooltip title for the label appearing when a chart is zoomed
Returns:
A reference to this Lang instance for convenient method chaining.

setThousandsSep

public Lang setThousandsSep(String thousandsSep)
Convenience method for setting the 'thousandsSep' lang option. Equivalent to:

     lang.setOption("thousandsSep", ".");
 
The default thousands separator used in the Highcharts.numberFormat method unless otherwise specified in the function arguments. Defaults to ",".

Parameters:
thousandsSep - value to used as the thousands separator by default when formatting numbers
Returns:
A reference to this Lang instance for convenient method chaining.

setWeekdays

public Lang setWeekdays(String[] weekdays)
Convenience method for setting the 'weekdays' lang option. Equivalent to:

     lang.setOption("weekdays", weekdays);
 
An array containing the weekday names. Defaults to ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].

Parameters:
weekdays - array containing the weekday names
Returns:
A reference to this Lang instance for convenient method chaining.
Throws:
IllegalArgumentException - if weekdays param is null or not exactly 7 items.


Copyright © 2015. All Rights Reserved.