Class ChartLibLoaderBehavior

    • Field Detail

      • LOADER_SCRIPT_ID

        public static final String LOADER_SCRIPT_ID
    • Constructor Detail

      • ChartLibLoaderBehavior

        public ChartLibLoaderBehavior()
    • Method Detail

      • addChart

        public boolean addChart​(Chart chart)
        Description copied from interface: ChartLibLoader
        Add a chart to the loader, so it's package is loaded to.
        Specified by:
        addChart in interface ChartLibLoader
        Parameters:
        chart - Chart to add.
        Returns:
        True if Chart is added.
      • removeChart

        public boolean removeChart​(Chart chart)
        Description copied from interface: ChartLibLoader
        Remove a previous added chart.
        Specified by:
        removeChart in interface ChartLibLoader
        Parameters:
        chart - Chart to remove.
        Returns:
        True if the Chart was managed and is removed now, false otherwise.
      • getLocale

        public Locale getLocale()
        The Locale is used to render a language = "de" in the load statement like in the example:
         
         // Load Google Charts for the Japanese locale.
         google.charts.load('current', {'packages':['corechart'], 'language': 'ja'});
         
        If this behavior is attached to the Page, Locale is set from the Page which normally is identical to Session.getLocale(). To override use setLocale(java.util.Locale).
        Returns:
        Locale used for the package language option.
      • setLocale

        public void setLocale​(Locale locale)
      • isRenderLocale

        public boolean isRenderLocale()
      • setRenderLocale

        public void setRenderLocale​(boolean renderLocale)
      • getLoaderUrl

        public String getLoaderUrl()
        Get Google loader URL. Can be overwritten, if Google changes URL in future.
        Returns:
        Returns Chart.LOADER_URL.
      • toJavaScript

        public String toJavaScript()
        Description copied from interface: JavaScriptable
        Return the JavaScript part.
        Specified by:
        toJavaScript in interface JavaScriptable
        Returns:
        JavaScript String for use as part of chart declaration.
      • getHeaderItem

        public HeaderItem getHeaderItem()
        Description copied from interface: ChartLibLoader
        Get the HeaderItem the loader adds, only to make dependencies to.
        Specified by:
        getHeaderItem in interface ChartLibLoader
        Returns:
        HeaderItem that the loader contributes.