Class Chart

    • Constructor Detail

      • Chart

        public Chart()
    • Method Detail

      • isAlignTicks

        public boolean isAlignTicks()
        Returns when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by setting alignTicks to false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by setting gridLineWidth to 0.

        Default: true.

      • setAlignTicks

        public void setAlignTicks​(boolean alignTicks)
        Sets when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by setting alignTicks to false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by setting gridLineWidth to 0.
      • getAnimation

        public Animation getAnimation()
        Returns the overall animation for all chart updating.

        Default: an instance of Animation

      • isAnimation

        public boolean isAnimation()
        Returns whether enable the animation

        Default: true

      • setAnimation

        public void setAnimation​(boolean animation)
        Animation can be disabled throughout the chart by setting it to false here. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see SeriesPlotOptions.setAnimation(boolean).

        The animation can either be set as a boolean or a configuration object. See setAnimation(Animation). If true, it will use the 'swing' jQuery easing and a duration of 500 ms. If used as an Animation object, the following properties are supported:

        duration
        The duration of the animation in milliseconds.
        easing
        When using jQuery as the general framework, the easing can be set to linear or swing. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooTools as the general framework, use the property name transition instead of easing.

        See Also:
        setAnimation(Animation), Animation
      • setAnimation

        public void setAnimation​(Animation animation)
        Animation can be disabled throughout the chart by setting it to false by the method of setAnimation(boolean). It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see SeriesPlotOptions.setAnimation(boolean).

        Properties are supported:

        duration
        The duration of the animation in milliseconds.
        easing
        When using jQuery as the general framework, the easing can be set to linear or swing. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooTools as the general framework, use the property name transition instead of easing.

        See Also:
        setAnimation(boolean), Animation
      • setAxisLayoutRuns

        public void setAxisLayoutRuns​(int axisLayoutRuns)

        When a chart with an x and a y-axis is rendered, we first pre-render the labels of both in order to measure them. Then, if either of the axis labels take up so much space that it significantly affects the length of the other axis, we repeat the process.

        By default, we stop at two axis layout runs, but it may be that the second run also alter the space required by either axis, for example if it causes the labels to rotate. In this situation, a subsequent redraw of the chart may cause the tick and label placement to change for apparently no reason. Use the axisLayoutRuns option to set the maximum allowed number of repetitions. But keep in mind that the default value of 2 is set because every run costs performance time.

        Note: Changing that option to higher than the default might decrease performance significantly, especially with bigger sets of data.

        Default: 2

        Parameters:
        axisLayoutRuns - the number of axis layout runs
        Since:
        11.3.0.0
      • getAxisLayoutRuns

        public int getAxisLayoutRuns()
        Returns the number of axis layout runs.

        Default: 2

      • getBackgroundColor

        public Color getBackgroundColor()
        Returns the background color or gradient for the outer chart area.

        Default: "#FFFFFF".

      • setBackgroundColor

        public void setBackgroundColor​(Color color)
        Sets the background color or gradient for the outer chart area.
      • setBackgroundColor

        public void setBackgroundColor​(String color)
        Sets the background color or gradient for the outer chart area.
      • setBackgroundColor

        public void setBackgroundColor​(LinearGradient color)
        Sets the background color or gradient for the outer chart area.
      • setBackgroundColor

        public void setBackgroundColor​(RadialGradient color)
        Sets the background color or gradient for the outer chart area.
      • getBorderColor

        public Color getBorderColor()
        Returns the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.

        Default: "#4572A7".

      • setBorderColor

        public void setBorderColor​(Color color)
        Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
      • setBorderColor

        public void setBorderColor​(String color)
        Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
      • setBorderColor

        public void setBorderColor​(LinearGradient color)
        Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
      • setBorderColor

        public void setBorderColor​(RadialGradient color)
        Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
      • getBorderRadius

        public Object getBorderRadius()
        Returns the corner radius of the outer chart border. In export, the radius defaults to 0.

        Default: 5.

      • setBorderRadius

        public void setBorderRadius​(Number borderRadius)
        Sets the corner radius of the outer chart border. In export, the radius defaults to 0.

        Default: 5.

        Parameters:
        borderRadius - the corner radius of the outer chart border
      • setBorderRadius

        public void setBorderRadius​(String borderRadius)
        Sets the corner radius of the outer chart border. In export, the radius defaults to 0.

        Default: 5.

        Parameters:
        borderRadius - the corner radius of the outer chart border
      • getBorderWidth

        public Number getBorderWidth()
        Returns the pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.

        Default: 0.

      • setBorderWidth

        public void setBorderWidth​(Number borderWidth)
        Sets the pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
        Parameters:
        borderWidth - the pixel width of the outer chart border
      • getClassName

        public String getClassName()
        Returns a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
        Since:
        7.2.1.0
      • setClassName

        public void setClassName​(String className)
        Sets a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.
        Since:
        7.2.1.0
      • getEventsMap

        public Map<String,​org.zkoss.json.JavaScriptValue> getEventsMap()
        Returns a map of client side event listeners for the chart.
        Since:
        7.2.2.0
      • setEvents

        public void setEvents​(Map<String,​org.zkoss.json.JavaScriptValue> events)
        Sets a map of client side event listeners for the chart.
        Since:
        7.2.2.0
      • addEvent

        public void addEvent​(String name,
                             org.zkoss.json.JavaScriptValue event)
        Sets a client side event for the chart.
        Since:
        7.2.2.0
      • getHeight

        public Number getHeight()
        Returns an explicit height for the chart. By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0.

        Default: null.

      • setHeight

        public void setHeight​(Number height)
        Sets an explicit height for the chart. By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0.
      • setHeight

        public void setHeight​(String height)
        Sets an explicit height for the chart. If given a percentage string (for example '56%'), the height is given as the percentage of the actual chart width. This allows for preserving the aspect ratio across responsive sizes.
        Since:
        7.2.1.0
      • isIgnoreHiddenSeries

        public boolean isIgnoreHiddenSeries()
        Returns if true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected.

        Default: true.

      • setIgnoreHiddenSeries

        public void setIgnoreHiddenSeries​(boolean ignoreHiddenSeries)
        Sets to ignore the hidden series, if true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected.
        Parameters:
        ignoreHiddenSeries - if true, the axes will scale to the remaining visible series once one series is hidden
      • isInverted

        public boolean isInverted()
        Returns whether to invert the axes so that the x axis is vertical and y axis is horizontal. When true, the x axis is reversed by default. If a bar series is present in the chart, it will be inverted automatically.

        Default: false.

      • setInverted

        public void setInverted​(boolean inverted)
        Sets whether to invert the axes so that the x axis is vertical and y axis is horizontal. When true, the x axis is reversed by default. If a bar series is present in the chart, it will be inverted automatically.
        Parameters:
        inverted - whether to invert the axes so that the x axis is vertical and y axis is horizontal
      • setMargin

        public void setMargin​(Number margin)
        Sets the margin between the outer edge of the chart and the plot area.
      • getMarginBottom

        public Number getMarginBottom()
        Returns the margin between the bottom outer edge of the chart and the plot area.

        Default: null.

      • setMarginBottom

        public void setMarginBottom​(Number marginBottom)
        Sets the margin between the bottom outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingBottom(Number).
        Parameters:
        marginBottom - the margin between the bottom outer edge of the chart and the plot area
      • getMarginLeft

        public Number getMarginLeft()
        Returns the margin between the left outer edge of the chart and the plot area.

        Default: null.

      • setMarginLeft

        public void setMarginLeft​(Number marginLeft)
        Sets the margin between the left outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingLeft(Number)
        Parameters:
        marginLeft - the margin between the left outer edge of the chart and the plot area
      • getMarginRight

        public Number getMarginRight()
        Returns the margin between the right outer edge of the chart and the plot area.

        Default: null

      • setMarginRight

        public void setMarginRight​(Number marginRight)
        Sets the margin between the right outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingRight(Number).
        Parameters:
        marginRight - the margin between the right outer edge of the chart and the plot area
      • getMarginTop

        public Number getMarginTop()
        Returns the margin between the top outer edge of the chart and the plot area.

        Default: null.

      • setMarginTop

        public void setMarginTop​(Number marginTop)
        Sets the margin between the top outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingTop(Number).
        Parameters:
        marginTop - the margin between the top outer edge of the chart and the plot area
      • getOptions3D

        public Options3D getOptions3D()
        Returns the options to render charts in 3 dimensions.

        Default: null.

      • setOptions3D

        public void setOptions3D​(Options3D options3D)
        Sets the options to render charts in 3 dimensions.
        Parameters:
        options3D - the options to render charts in 3 dimensions.
      • getPanKey

        public String getPanKey()
        Returns setting a key to switch between zooming and panning. Can be one of alt, ctrl, meta (the command key on Mac and Windows key on Windows) or shift. The keys are mapped directly to the key properties of the click event argument (event.altKey, event.ctrlKey, event.metaKey and event.shiftKey).

        Default: null

        Since:
        7.2.1.0
      • setPanKey

        public void setPanKey​(String panKey)
        Sets setting a key to switch between zooming and panning. Can be one of alt, ctrl, meta (the command key on Mac and Windows key on Windows) or shift. The keys are mapped directly to the key properties of the click event argument (event.altKey, event.ctrlKey, event.metaKey and event.shiftKey).
        Since:
        7.2.1.0
      • isPanning

        public boolean isPanning()
        Returns if allow panning in a chart. Best used with panKey to combine zooming and panning. On touch devices, when the tooltip.followTouchMove option is true (default), panning requires two fingers. To allow panning with one finger, set followTouchMove to false.

        Default: false

        Since:
        7.2.1.0
      • setPanning

        public void setPanning​(boolean panning)
        Sets if allow panning in a chart. Best used with panKey to combine zooming and panning. On touch devices, when the tooltip.followTouchMove option is true (default), panning requires two fingers. To allow panning with one finger, set followTouchMove to false.
        Since:
        7.2.1.0
      • getParallelAxes

        public ParallelAxes getParallelAxes()
        Returns common options for all yAxes rendered in a parallel coordinates plot, if any. Otherwise, create a new one.
        Since:
        7.2.1.0
      • setParallelAxes

        public void setParallelAxes​(ParallelAxes parallelAxes)
        Sets common options for all yAxes rendered in a parallel coordinates plot.
        Since:
        7.2.1.0
      • isParallelCoordinates

        public boolean isParallelCoordinates()
        Returns a flag to render charts as a parallel coordinates plot. In a parallel coordinates plot (||-coords) by default all required yAxes are generated and the legend is disabled.

        Default: false

        Since:
        7.2.1.0
      • setParallelCoordinates

        public void setParallelCoordinates​(boolean parallelCoordinates)
        Sets a flag to render charts as a parallel coordinates plot. In a parallel coordinates plot (||-coords) by default all required yAxes are generated and the legend is disabled.
        Since:
        7.2.1.0
      • getPinchType

        public String getPinchType()
        Returns equivalent to getZoomType(), but for multitouch gestures only. By default, the pinchType is the same as the zoomType setting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse drag pans the chart, while pinching is enabled.

        Default: null.

      • setPinchType

        public void setPinchType​(String pinchType)
        Sets equivalent to setZoomType(String), but for multitouch gestures only. By default, the pinchType is the same as the zoomType setting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse drag pans the chart, while pinching is enabled.

        Default: null.

        See Also:
        setZoomType(String)
      • getPlotBackgroundColor

        public Color getPlotBackgroundColor()
        Returns the background color for the plot area.

        Default: null.

      • setPlotBackgroundColor

        public void setPlotBackgroundColor​(Color color)
        Sets the background color for the plot area.
      • setPlotBackgroundColor

        public void setPlotBackgroundColor​(String color)
        Sets the background color for the plot area.
      • setPlotBackgroundColor

        public void setPlotBackgroundColor​(LinearGradient color)
        Sets the background color for the plot area.
      • setPlotBackgroundColor

        public void setPlotBackgroundColor​(RadialGradient color)
        Sets the background color for the plot area.
      • getPlotBackgroundImage

        public String getPlotBackgroundImage()
        Returns the URL for an image to use as the plot background.

        Default: null.

      • setPlotBackgroundImage

        public void setPlotBackgroundImage​(String plotBackgroundImage)
        Sets the URL for an image to use as the plot background. To set an image as the background for the entire chart, set a CSS background image to the container element. Note that for the image to be applied to exported charts, its URL needs to be accessible by the export server.
        Parameters:
        plotBackgroundImage - the URL for an image to use as the plot background
      • getPlotBorderColor

        public Color getPlotBorderColor()
        Returns the color of the inner chart or plot area border.

        Default: "#C0C0C0".

      • setPlotBorderColor

        public void setPlotBorderColor​(Color color)
        Sets the color of the inner chart or plot area border.
      • setPlotBorderColor

        public void setPlotBorderColor​(String color)
        Sets the color of the inner chart or plot area border.
      • setPlotBorderColor

        public void setPlotBorderColor​(LinearGradient color)
        Sets the color of the inner chart or plot area border.
      • setPlotBorderColor

        public void setPlotBorderColor​(RadialGradient color)
        Sets the color of the inner chart or plot area border.
      • getPlotBorderWidth

        public Number getPlotBorderWidth()
        Returns the pixel width of the plot area border.

        Default: 0.

      • setPlotBorderWidth

        public void setPlotBorderWidth​(Number plotBorderWidth)
        Sets the pixel width of the plot area border.
        Parameters:
        plotBorderWidth - the pixel width of the plot area border
      • getPlotShadow

        public Object getPlotShadow()
        Returns the PlotShadow object or boolean value of plot shadow, depend on what was set. To apply a drop shadow to the plot area.
        Since:
        11.2.0.0
      • isPlotShadow

        public boolean isPlotShadow()
        Returns whether to apply a drop shadow to the plot area. Requires that setPlotBackgroundColor(String) be set.

        Default: false.

      • setPlotShadow

        public void setPlotShadow​(boolean plotShadow)
        Sets whether to apply a drop shadow to the plot area. Requires that setPlotBackgroundColor(String) be set.
        Parameters:
        plotShadow - whether to apply a drop shadow to the plot area
      • setPlotShadow

        public void setPlotShadow​(PlotShadow plotShadow)
        Sets whether to apply a drop shadow to the plot area. Requires that setPlotBackgroundColor(String) be set.
        Parameters:
        plotShadow - whether to apply a drop shadow to the plot area
        Since:
        11.2.0.0
      • isPolar

        public boolean isPolar()
        Returns whether transforms into the polar coordinate system

        Default: false.

      • setPolar

        public void setPolar​(boolean polar)
        Sets to true to enable the cartesian charts like line, spline, area and column are transformed into the polar coordinate system.
        Parameters:
        polar - when true, cartesian charts like line, spline, area and column are transformed into the polar coordinate system
      • isReflow

        public boolean isReflow()
        Returns whether to reflow the chart to fit the width of the container div on resizing the window.

        Default: true.

      • setReflow

        public void setReflow​(boolean reflow)
        Sets whether to reflow the chart to fit the width of the container div on resizing the window.
        Parameters:
        reflow - whether to reflow the chart to fit the width of the container div on resizing the window
      • getResetZoomButton

        public ResetZoomButton getResetZoomButton()
        Returns the button that appears after a selection zoom, allowing the user to reset zoom.

        Default: null.

      • setResetZoomButton

        public void setResetZoomButton​(ResetZoomButton resetZoomButton)
        Sets the button that appears after a selection zoom, allowing the user to reset zoom.
        Parameters:
        resetZoomButton - the button that appears after a selection zoom, allowing the user to reset zoom
      • getScrollablePlotArea

        public ScrollablePlotArea getScrollablePlotArea()
        Returns the options for a scrollable plot area.

        Since:
        7.2.2.0
      • setScrollablePlotArea

        public void setScrollablePlotArea​(ScrollablePlotArea scrollablePlotArea)
        Sets the options for a scrollable plot area.
        Since:
        7.2.2.0
      • getSelectionMarkerFill

        public Color getSelectionMarkerFill()
        Returns the background color of the marker square when selecting (zooming in on) an area of the chart.

        Default: "rgba(69,114,167,0.25)".

      • setSelectionMarkerFill

        public void setSelectionMarkerFill​(Color color)
        Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
      • setSelectionMarkerFill

        public void setSelectionMarkerFill​(String color)
        Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
      • setSelectionMarkerFill

        public void setSelectionMarkerFill​(LinearGradient color)
        Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
      • setSelectionMarkerFill

        public void setSelectionMarkerFill​(RadialGradient color)
        Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
      • isShadow

        public boolean isShadow()
        Returns whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.

        Default: false.

        See Also:
        Shadow
      • getShadow

        public Shadow getShadow()
        Returns whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.

        Default: Shadow.NONE.

        See Also:
        Shadow
      • setShadow

        public void setShadow​(boolean shadow)
        Sets whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.
      • setShadow

        public void setShadow​(Shadow shadow)
        Sets whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.
        See Also:
        Shadow
      • isShowAxes

        public boolean isShowAxes()
        Returns whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes are automatically added to cartesian series.

        Default: false.

      • setShowAxes

        public void setShowAxes​(boolean showAxes)
        Sets whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes are automatically added to cartesian series.
        Parameters:
        showAxes - whether to show the axes initially
      • getSpacing

        public Number[] getSpacing()
        Returns the distance between the outer edge of the chart and the content, like title, legend, axis title or labels. The numbers in the array designate top, right, bottom and left respectively.

        Default: [10, 10, 15, 10].

      • setSpacing

        public void setSpacing​(Number[] spacing)
        Sets the distance between the outer edge of the chart and the content, like title, legend, axis title or labels. The numbers in the array designate top, right, bottom and left respectively. Use the methods of setSpacingTop(Number), setSpacingRight(Number), setSpacingBottom(Number) and setSpacingLeft(Number) for shorthand setting of one option.
        Parameters:
        spacing - the distance between the outer edge of the chart and the content, like title, legend, axis title or labels
      • getSpacingBottom

        public Number getSpacingBottom()
        Returns the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Default: 15.

      • setSpacingBottom

        public void setSpacingBottom​(Number spacingBottom)
        Sets the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Parameters:
        spacingBottom - The space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
      • getSpacingLeft

        public Number getSpacingLeft()
        Returns the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Default: 10.

      • setSpacingLeft

        public void setSpacingLeft​(Number spacingLeft)
        Sets the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Parameters:
        spacingLeft - The space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
      • getSpacingRight

        public Number getSpacingRight()
        Returns the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Default: 10.

      • setSpacingRight

        public void setSpacingRight​(Number spacingRight)
        Sets the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
        Parameters:
        spacingRight - The space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
      • getSpacingTop

        public Number getSpacingTop()
        Returns the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).

        Default: 10.

      • setSpacingTop

        public void setSpacingTop​(Number spacingTop)
        Sets the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).
        Parameters:
        spacingTop - The space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
      • getStyle

        public <K,​V> Map<K,​V> getStyle()
        Returns additional CSS styles to apply inline to the container div. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally. Defaults to:
         fontFamily: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; fontSize: 12px
         
        Type Parameters:
        K - type for the key

        if style was set using setStyle(String), type will be String

        if style was set using setStyle(Map), type will be the same as the type from the key of the map

        if style was not set, default style will be applied, and type will be String

        V - type for the value

        if style was set using setStyle(String), type will be String

        if style was set using setStyle(Map), type will be the same as the type from the key of the map

        if style was not set, default style will be applied, and type will be String

      • isStyledMode

        public boolean isStyledMode()
        Returns whether to apply styled mode. When in styled mode, no presentational attributes or CSS are applied to the chart SVG. Instead, CSS rules are required to style the chart. The default style sheet is available from highcharts.css.

        Default: false

        Since:
        10.2.1.0
      • setStyledMode

        public void setStyledMode​(boolean styledMode)
        Sets whether to apply styled mode. When in styled mode, no presentational attributes or CSS are applied to the chart SVG. Instead, CSS rules are required to style the chart. The default style sheet is available from highcharts.css.

        Default: false

        Since:
        10.2.1.0
      • setStyle

        public void setStyle​(String style)
        Sets additional CSS styles to apply inline to the container div. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally.

        This method allows simple settings like

        
         label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");
         

        In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using setStyle(Map)

        Parameters:
        style - one or many CSS key:value pairs in a single line string format
        See Also:
        setStyle(Map)
      • setStyle

        public <K,​V> void setStyle​(Map<K,​V> style)
        Sets additional CSS styles to apply inline to the container div. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally.

        This method allows complex styling like:

         
         Map<String, Object> styles = new HashMap<String, Object>();
         styles.put("fill", "#E8E8EA");
         styles.put("stroke", "#6E6E78");
         styles.put("stroke-width", "1");
         styles.put("r", "0");
         Map<String, Object> states = new HashMap<String, Object>();
         Map<String, String> hover = new HashMap<String, String>();
         hover.put("fill", "#F4F4F6");
         hover.put("stroke", "#6E6E78");
         hover.put("stroke-width", "1");
         hover.put("r", "0");
         states.put("hover", hover);
         styles.put("states", states);
         Map<String, String> style = new HashMap<String, String>();
         style.put("color", "#4D5663");
         style.put("fontSize", "12px");
         style.put("fontFamily", "'Arial'");
         style.put("fontWeight", "normal");
         style.put("padding", "10px");
         styles.put("style", style);
         
        which will generate the final results like:
        
         {
             "fill": "#E8E8EA",
             "stroke": "#6E6E78",
             "stroke-width": "1",
             "r": "0",
             "states":
             {
                 "hover":
                 {
                     "fill": "#F4F4F6",
                     "stroke": "#6E6E78",
                     "stroke-width": "1",
                     "r": "0"
                 }
             },
             "style":
             {
                 "color": "#4D5663",
                 "fontSize": "12px",
                 "fontFamily": "'Arial'",
                 "fontWeight": "normal",
                 "padding": "10px"
             }
         }
         
        Type Parameters:
        K - Type for the key, usually String
        V - Type for the value, usually String. For nested maps, use Object or any other type.
        Parameters:
        style - the style object
      • getType

        public String getType()
        Returns the default series type for the chart. Can be any of the chart types listed under Charts.

        Default: "line".

      • setType

        public void setType​(String type)
        Sets the default series type for the chart. Can be any of the chart types listed under Charts.
        Parameters:
        type - the default series type for the chart
      • getWidth

        public Number getWidth()
        Returns an explicit width for the chart. By default the width is calculated from the offset width of the containing element.

        Default: null.

      • setWidth

        public void setWidth​(Number width)
        Sets an explicit width for the chart. By default the width is calculated from the offset width of the containing element.
        Parameters:
        width - an explicit width for the chart
      • getZoomType

        public String getZoomType()
        Returns decides in what dimensions the user can zoom by dragging the mouse. Can be one of x, y or xy.

        Default: null.

      • setZoomType

        public void setZoomType​(String zoomType)
        Sets decides in what dimensions the user can zoom by dragging the mouse. Can be one of x, y or xy.
        Parameters:
        zoomType - decides in what dimensions the user can zoom by dragging the mouse
      • isEnableZoomSelection

        public Boolean isEnableZoomSelection()
        Returns whether selection event will zoom the chart to the selected area.

        Default: true.

      • setEnableZoomSelection

        public void setEnableZoomSelection​(boolean enableZoomSelection)
        Sets whether selection event will zoom the chart to the selected area.