Interface OptionHelper

    • Method Detail

      • getChartBaseResourceKey

        String getChartBaseResourceKey()
        Generate the base resource key for the chart. By convention this is build from the id of the Chart Component. Eg. if Chart id is "myChart" the result should be "chart.myChart.".
        Returns:
        Base resource key of chart in form "chart.<id of chart>.". Note the trailing dot.
      • getChartLabelResourceModel

        IModel<String> getChartLabelResourceModel​(String subKey)
        Generate a wrapped ResourceModel for the Chart component.
        Parameters:
        subKey - Subkey as suffix of getChartBaseResourceKey().
        Returns:
        ResourceModel for the complete key. There is no default defined, so missing properties can be easyly detected.
      • addTitle

        ChartOptions addTitle​(ChartOptions parent)
        Add a title of the chart to the root of ChartOptions. Use ResourceModel for the label text. The title handling is different for Material and Classic charts, so this convenient methods are written.
        Parameters:
        parent - Root ChartOptions to add title to.
        Returns:
        Parent for fluent calling.
      • addTitle

        ChartOptions addTitle​(ChartOptions parent,
                              String title)
        Add a title of the chart to the root of ChartOptions.
        Parameters:
        parent - Root ChartOptions to add title to.
        title - String to use for the title.
        Returns:
        Parent for fluent calling.
      • addTitle

        ChartOptions addTitle​(ChartOptions parent,
                              IModel<String> titleModel)
        Add a title of the chart to the root of ChartOptions.
        Parameters:
        parent - Root ChartOptions to add title to.
        titleModel - Model to use for the title.
        Returns:
        Parent for fluent calling.
      • addSubTitle

        ChartOptions addSubTitle​(ChartOptions parent)
        Add a subTitle of the chart to the root of ChartOptions. Use ResourceModel for the label text. The subTitle handling is different for Material and Classic charts, so this convenient methods are written.
        Parameters:
        parent - Root ChartOptions to add subTitle to.
        Returns:
        Parent for fluent calling.
      • addSubTitle

        ChartOptions addSubTitle​(ChartOptions parent,
                                 String subTitle)
        Add a subTitle of the chart to the root of ChartOptions.
        Parameters:
        parent - Root ChartOptions to add subTitle to.
        subTitle - String to use for the subTitle.
        Returns:
        Parent for fluent calling.
      • addSubTitle

        ChartOptions addSubTitle​(ChartOptions parent,
                                 IModel<String> subTitleModel)
        Add a subTitle of the chart to the root of ChartOptions.
        Parameters:
        parent - Root ChartOptions to add subTitle to.
        subTitleModel - Model to use for the subTitle.
        Returns:
        Parent for fluent calling.
      • addDualAxisOptions

        ChartOptions addDualAxisOptions​(ChartOptions parent,
                                        String[] axisNames,
                                        String[] seriesMapping)
        Add a definition of dual axis to the root of ChartOptions. Use ResourceModels with key convention for labeling axis.
        Parameters:
        parent - Root ChartOptions to add title to.
        axisNames - Names of the axis.
        seriesMapping - Map each serie in order to an axis by the axis name.
        Returns:
        Parent for fluent calling.
      • addDualAxisOptions

        ChartOptions addDualAxisOptions​(ChartOptions parent,
                                        String[] axisNames,
                                        String[] seriesMapping,
                                        OptionModifier[] axisModifiers,
                                        OptionModifier[] seriesModifiers)
        Add a definition of dual axis to the root of ChartOptions. Use ResourceModels with key convention for labeling axis.
        Parameters:
        parent - Root ChartOptions to add title to.
        axisNames - Names of the axis.
        seriesMapping - Map each serie in order to an axis by the axis name.
        axisModifiers - Modifiers for the axis definitions. Can be used to add options to each axis. Set to null if no modification is necessary at all. Set position in array to null if to modification is needed for the particular axis.
        seriesModifiers - Modifiers for the series definitions. Can be used to add options to each series. Set to null if no modification is necessary at all. Set position in array to null if to modification is needed for the particular series.
        Returns:
        Parent for fluent calling.
      • addDualAxisOptions

        ChartOptions addDualAxisOptions​(ChartOptions parent,
                                        String[] axisNames,
                                        String[] seriesMapping,
                                        String[] axisTitles)
        Add a definition of dual axis to the root of ChartOptions. Use explicit axis titles for labeling axis.
        Parameters:
        parent - Root ChartOptions to add title to.
        axisNames - Names of the axis.
        seriesMapping - Map each serie in order to an axis by the axis name.
        axisTitles - Display titles (labels) used for the titles axis. Must have same order and count as axisNames.
        Returns:
        Parent for fluent calling.
      • addDualAxisOptions

        ChartOptions addDualAxisOptions​(ChartOptions parent,
                                        String[] axisNames,
                                        String[] seriesMapping,
                                        String[] axisTitles,
                                        OptionModifier[] axisModifiers,
                                        OptionModifier[] seriesModifiers)
        Add a definition of dual axis to the root of ChartOptions. Use explicit axis titles for labeling axis.
        Parameters:
        parent - Root ChartOptions to add title to.
        axisNames - Names of the axis.
        seriesMapping - Map each serie in order to an axis by the axis name.
        axisTitles - Display titles (labels) used for the titles axis. Must have same order and count as axisNames.
        axisModifiers - Modifiers for the axis definitions. Can be used to add options to each axis. Set to null if no modification is necessary at all. Set position in array to null if to modification is needed for the particular axis.
        seriesModifiers - Modifiers for the series definitions. Can be used to add options to each series. Set to null if no modification is necessary at all. Set position in array to null if to modification is needed for the particular series. Set to null if no modification needed.
        Returns:
        Parent for fluent calling.