Class ChartNode


  • public final class ChartNode
    extends Object
    This is a wrapper of CHART.JS CHART instance in order to provide all properties of chart java script instance, set at runtime.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • ChartNode

        public ChartNode​(String chartId,
                         Chart chart)
        Creates the object wrapping a CHART instance.
        Parameters:
        chartId - scope of the options, in this case the chart id.
        chart - CHART.JS CHART instance
    • Method Detail

      • isInitialized

        public boolean isInitialized()
        Returns if CHART.JS chart instance has been initialized.
        Returns:
        true if initialized, otherwise false
      • getOptions

        public OptionsNode getOptions()
        Returns the options item.
        Returns:
        the options item.
      • getLegend

        public LegendNode getLegend()
        Returns the legend item.
        Returns:
        the legend item.
      • getScales

        public ScalesNode getScales()
        Returns the scales item.
        Returns:
        the scales item.
      • getChartArea

        public ChartAreaNode getChartArea()
        Returns the chart area item.
        Returns:
        the chart area item.
      • getSubtitle

        public SubtitleNode getSubtitle()
        Returns the subtitle item.
        Returns:
        the subtitle item.
      • getTitle

        public TitleNode getTitle()
        Returns the title item.
        Returns:
        the title item.
      • getTooltip

        public TooltipNode getTooltip()
        Returns the tooltip item.
        Returns:
        the tooltip item.
      • getId

        public int getId()
        Returns the CHART JS chart ID.
        Returns:
        the CHART JS chart ID.
      • getWidth

        public int getWidth()
        Returns the width in pixel.
        Returns:
        the width in pixel.
      • getHeight

        public int getHeight()
        Returns the height in pixel.
        Returns:
        the height in pixel.
      • getAspectRatio

        public double getAspectRatio()
        Returns the aspect ratio.
        Returns:
        the aspect ratio.
      • getCurrentDevicePixelRatio

        public double getCurrentDevicePixelRatio()
        Returns the current device pixel ratio.
        Returns:
        the current device pixel ratio.
      • toJSON

        public String toJSON()
        Returns the string JSON representation of the object.
        Returns:
        the string JSON representation of the object.