Class AbstractOptionHelper

    • Field Detail

      • chart

        protected Chart chart
    • Constructor Detail

      • AbstractOptionHelper

        public AbstractOptionHelper​(Chart chart)
    • Method Detail

      • getChartBaseResourceKey

        public static String getChartBaseResourceKey​(String chartId)
        Helper function to build resource base key for a chart and it's id according to a convention. This should be used as left part for all keys for i18n of charts.
        Parameters:
        chartId - Wicket id of Chart.
        Returns:
        Base key with trailing dot, eg. "Chart.myChart." if param is "myChart".
      • getChartBaseResourceKey

        public String getChartBaseResourceKey()
        Description copied from interface: OptionHelper
        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.".
        Specified by:
        getChartBaseResourceKey in interface OptionHelper
        Returns:
        Base resource key of chart in form "chart.<id of chart>.". Note the trailing dot.
      • addTitle

        public ChartOptions addTitle​(ChartOptions parent)
        Description copied from interface: OptionHelper
        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.
        Specified by:
        addTitle in interface OptionHelper
        Parameters:
        parent - Root ChartOptions to add title to.
        Returns:
        Parent for fluent calling.
      • addSubTitle

        public ChartOptions addSubTitle​(ChartOptions parent)
        Description copied from interface: OptionHelper
        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.
        Specified by:
        addSubTitle in interface OptionHelper
        Parameters:
        parent - Root ChartOptions to add subTitle to.
        Returns:
        Parent for fluent calling.
      • addDualAxisOptions

        public ChartOptions addDualAxisOptions​(ChartOptions parent,
                                               String[] axisNames,
                                               String[] seriesMapping)
        Description copied from interface: OptionHelper
        Add a definition of dual axis to the root of ChartOptions. Use ResourceModels with key convention for labeling axis.
        Specified by:
        addDualAxisOptions in interface OptionHelper
        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

        public ChartOptions addDualAxisOptions​(ChartOptions parent,
                                               String[] axisNames,
                                               String[] seriesMapping,
                                               OptionModifier[] axisModifiers,
                                               OptionModifier[] seriesModifiers)
        Description copied from interface: OptionHelper
        Add a definition of dual axis to the root of ChartOptions. Use ResourceModels with key convention for labeling axis.
        Specified by:
        addDualAxisOptions in interface OptionHelper
        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

        public ChartOptions addDualAxisOptions​(ChartOptions parent,
                                               String[] axisNames,
                                               String[] seriesMapping,
                                               String[] axisTitles)
        Description copied from interface: OptionHelper
        Add a definition of dual axis to the root of ChartOptions. Use explicit axis titles for labeling axis.
        Specified by:
        addDualAxisOptions in interface OptionHelper
        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.