org.moxieapps.gwt.highcharts.client
Class Exporting

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

public class Exporting
extends Configurable<Exporting>

A configurable class that will allow you to control the options for exporting module. An instance of this class can be constructed and then set on the chart via the BaseChart.setExporting(Exporting) method.

Note that the "exporting" module must be included in the page in order for the exporting navigation options to apply. E.g.:

<script type="text/javascript" src="js/modules/exporting.js"></script>

Since:
1.1.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Nested Class Summary
static class Exporting.Type
          An enumeration of supported exporting file types, which can be passed to the setType(Exporting.Type) method.
 
Constructor Summary
Exporting()
           
 
Method Summary
 Exporting setContextButton(ContextButton contextButton)
          Convenience method for directly setting the options for the context button.
 Exporting setEnabled(boolean enabled)
          Convenience method for setting the 'enabled' option for the exporting module.
 Exporting setFilename(String fileName)
          Convenience method for setting the 'filename' option for the exporting module.
 Exporting setScale(Number scale)
          Convenience method for setting the 'scale' option for exporting module.
 Exporting setSourceHeight(Number sourceHeight)
          Convenience method for setting the 'sourceHeight' option for the exporting module.
 Exporting setSourceWidth(Number sourceWidth)
          Convenience method for setting the 'sourceWidth' option for the exporting module.
 Exporting setType(Exporting.Type type)
          Convenience method for setting the 'type' option for the exporting module.
 Exporting setUrl(String url)
          Convenience method for setting the 'url' option for the exporting module.
 Exporting setWidth(Number width)
          Convenience method for setting the 'width' option for the exporting module.
 
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

Exporting

public Exporting()
Method Detail

setContextButton

public Exporting setContextButton(ContextButton contextButton)
Convenience method for directly setting the options for the context button. Equivalent to:

     exporting.setOption("/buttons/contextButton/align", "right");
 

Parameters:
contextButton - An instance of the ContextButton class
Returns:
A reference to this Exporting instance for convenient method chaining.
Since:
1.6.0

setEnabled

public Exporting setEnabled(boolean enabled)
Convenience method for setting the 'enabled' option for the exporting module. Equivalent to:

     exporting.setOption("enabled", true);
 
Whether to enable the exporting module. Defaults to true, but note that the exporting module Javascript file must be included in the source of the page in order for the exporting functionality to appear.

Parameters:
enabled - Whether or not to enable or disable the exporting module for the chart.
Returns:
A reference to this Exporting instance for convenient method chaining.

setFilename

public Exporting setFilename(String fileName)
Convenience method for setting the 'filename' option for the exporting module. Equivalent to:

     exporting.setOption("filename", "chart");
 
The filename, without extension, to use for the exported chart. Defaults to "chart".

Parameters:
fileName - The filename, without extension, to use for the exported chart.
Returns:
A reference to this Exporting instance for convenient method chaining.

setScale

public Exporting setScale(Number scale)
Convenience method for setting the 'scale' option for exporting module. Equivalent to:

       exporting.setOption("scale", 2)
 
Defines the scale or zoom factor for the exported image compared to the on-screen display. While for instance a 600px wide chart may look good on a website, it will look bad in print. The default scale of 2 makes this chart export to a 1200px PNG or JPG. Defaults to 2.

Parameters:
scale - The scale to use for the exported chart.
Returns:
A reference to this Exporting instance for convenient method chaining.
Since:
1.6.0

setSourceHeight

public Exporting setSourceHeight(Number sourceHeight)
Convenience method for setting the 'sourceHeight' option for the exporting module. Equivalent to:

     exporting.setOption("sourceHeight", 400);
 
The height of the original chart when exported, unless an explicit chart.height is set. The height exported raster image is then multiplied by scale.

Parameters:
sourceHeight - The height of the original chart to be used for exporting.
Returns:
A reference to this Exporting instance for convenient method chaining.
Since:
1.6.0

setSourceWidth

public Exporting setSourceWidth(Number sourceWidth)
Convenience method for setting the 'sourceWidth' option for the exporting module. Equivalent to:

     exporting.setOption("sourceWidth", 600);
 
The width of the original chart when exported, unless an explicit chart.width is set. The width exported raster image is then multiplied by scale.

Parameters:
sourceWidth - The width of the original chart to be used for exporting.
Returns:
A reference to this Exporting instance for convenient method chaining.
Since:
1.6.0

setType

public Exporting setType(Exporting.Type type)
Convenience method for setting the 'type' option for the exporting module. Equivalent to:

     exporting.setOption("type", "image/jpeg");
 
Default MIME type for exporting if chart.exportChart() is called without specifying a type option. Possible values are image/png, image/jpeg, application/pdf and image/svg+xml. Defaults to "image/png".

Parameters:
type - The default file format that exported charts should be created as.
Returns:
A reference to this Exporting instance for convenient method chaining.

setUrl

public Exporting setUrl(String url)
Convenience method for setting the 'url' option for the exporting module. Equivalent to:

     exporting.setOption("url", "http://export.highcharts.com");
 
The URL for the server module converting the SVG string to an image format. By default this points to Highslide Software's free web service. Defaults to http://export.highcharts.com.

Parameters:
url - The URL for the server module converting the SVG string to an image format.
Returns:
A reference to this Exporting instance for convenient method chaining.

setWidth

public Exporting setWidth(Number width)
Convenience method for setting the 'width' option for the exporting module. Equivalent to:

     exporting.setOption("width", 600);
 
The pixel width of charts exported to PNG or JPG. Defaults to 800. As of Highcharts 3.0, the default pixel width is a function of the chart.width or exporting.sourceWidth and the exporting.scale. Defaults to undefined.

Parameters:
width - The pixel width of charts exported to PNG or JPG.
Returns:
A reference to this Exporting instance for convenient method chaining.


Copyright © 2015. All Rights Reserved.