Class Data

    • Constructor Detail

      • Data

        public Data​(ChartEnvelop<IsChart> envelop)
        Creates the object with an empty native object.
        Parameters:
        envelop - envelop containing the chart instance
    • Method Detail

      • getLabelsHandler

        public LabelsHandler getLabelsHandler()
        Description copied from interface: HasLabels
        Returns an labels option handler instance.
        Specified by:
        getLabelsHandler in interface HasLabels
        Returns:
        an labels option handler instance
      • setXLabels

        public void setXLabels​(String... labels)
        Sets the labels for X axes of the data.
        Parameters:
        labels - array of labels
      • setXLabels

        public void setXLabels​(Labels labels)
        Sets the labels for X axes of the data.
        Parameters:
        labels - labels object to manage also multi-line labels
      • getXLabels

        public Labels getXLabels()
        Returns the labels for X axes.
        Returns:
        the labels for X axes
      • getXLabels

        public Labels getXLabels​(boolean binding)
        Returns the labels for X axes.
        Parameters:
        binding - if true binds the new labels in the container
        Returns:
        the labels for X axes
      • setYLabels

        public void setYLabels​(String... labels)
        Sets the labels for Y axes of the data.
        Parameters:
        labels - array of labels
      • setYLabels

        public void setYLabels​(Labels labels)
        Sets the labels for Y axes of the data.
        Parameters:
        labels - labels object to manage also multiple line labels
      • getYLabels

        public Labels getYLabels()
        Returns the labels for Y axes.
        Returns:
        the labels for Y axes
      • getYLabels

        public Labels getYLabels​(boolean binding)
        Returns the labels for Y axes.
        Parameters:
        binding - if true binds the new labels in the container
        Returns:
        the labels for Y axes
      • setDatasets

        public void setDatasets​(Dataset... datasets)
        Sets a set of data sets for chart. If argument is null, removes all data sets.
        Parameters:
        datasets - set of data set. If null, removes all data sets
      • getDatasets

        public List<Dataset> getDatasets()
        Returns the list of data sets.
        Returns:
        the list of data sets
      • getDatasets

        public List<Dataset> getDatasets​(boolean binding)
        Returns the list of data sets.
        Parameters:
        binding - if true binds the new array list in the container
        Returns:
        the list of data sets
      • isCanvasObjectHandling

        public boolean isCanvasObjectHandling()
        Returns true if the plugin to manage canvas object (gradients and patterns) has been forcedly disable.
        Pay attention that disabling the handler, your data sets configuration with gradients or patterns will e showed with default color.
        Returns:
        true if the plugin to manage canvas object (gradients and patterns) has been forcedly disable
      • setCanvasObjectHandling

        public void setCanvasObjectHandling​(boolean canvasObjectHandling)
        Sets true if the plugin to manage canvas object (gradients and patterns) have to be forcedly disable.
        Pay attention that disabling the handler, your data sets configuration with gradients or patterns will e showed with default color.
        Parameters:
        canvasObjectHandling - true if the plugin to manage canvas object (gradients and patterns) have to be forcedly disable
      • createActiveElementsByDatasetIndex

        public List<ActiveDatasetElement> createActiveElementsByDatasetIndex​(int... datasetIndexes)
        Creates a list of active elements instances by an array of data set indexes, for visible data sets.
        Parameters:
        datasetIndexes - an array of data set indexes
        Returns:
        a list of active elements instances by an array of data set indexes
      • createActiveElementsByDataIndex

        public List<ActiveDatasetElement> createActiveElementsByDataIndex​(int... dataIndexes)
        Creates a list of active elements instances by an array of data indexes, for all visible data sets.
        Parameters:
        dataIndexes - an array of data indexes
        Returns:
        a list of active elements instances by an array of data indexes
      • retrieveFillStyleAsGradient

        public final Gradient retrieveFillStyleAsGradient​(LegendItem legendItem)
        Returns a gradient object set as background color for a data set related to legend item.
        Parameters:
        legendItem - legend item instance to get the data set related to.
        Returns:
        a gradient object or null if not found by legend item
      • retrieveStrokeStyleAsGradient

        public final Gradient retrieveStrokeStyleAsGradient​(LegendItem legendItem)
        Returns a gradient object set as border color for a data set related to legend item.
        Parameters:
        legendItem - legend item instance to get the data set related to.
        Returns:
        a gradient object or null if not found by legend item
      • retrieveFillStyleAsPattern

        public final Pattern retrieveFillStyleAsPattern​(LegendItem legendItem)
        Returns a pattern object set as background color for a data set related to legend item.
        Parameters:
        legendItem - legend item instance to get the data set related to.
        Returns:
        a pattern object or null if not found by legend item
      • retrieveStrokeStyleAsPattern

        public final Pattern retrieveStrokeStyleAsPattern​(LegendItem legendItem)
        Returns a pattern object set as border color for a data set related to legend item.
        Parameters:
        legendItem - legend item instance to get the data set related to.
        Returns:
        a pattern object or null if not found by legend item
      • retrieveDataset

        public final Dataset retrieveDataset​(LegendItem legendItem)
        Returns a data set instance by legend item locator, data set index and index.
        Parameters:
        legendItem - legend item instance to get the data set related to.
        Returns:
        a data set instance or null if not found by legend item
      • retrieveDataset

        public final Dataset retrieveDataset​(TooltipItem tooltipItem)
        Returns a data set instance by tooltip item locator, data set index and index.
        Parameters:
        tooltipItem - tooltip item instance to get the data set related to.
        Returns:
        a data set instance or null if not found by tooltip item
      • retrieveDataset

        public final Dataset retrieveDataset​(DatasetContext context)
        Returns a data set instance by scriptable context, data set index and index.
        Parameters:
        context - legend item instance to get the data set related to.
        Returns:
        a data set instance by scriptable context item or null if not found by scriptable context
      • load

        public void load​(IsChart chart,
                         Configuration configuration)
        Description copied from interface: ConfigurationElement
        Called to enable to load in the a configuration object the specific configuration item (by native object).
        Specified by:
        load in interface ConfigurationElement
        Parameters:
        chart - chart instance
        configuration - chart configuration instance