Class Chart

The parent class for all types of Chart used to initialise all of the base settings universal to all charts. In handles data setting/updating, document resizing and includes the tooltip.




axis: Axis

The chart's axis object instance

chartConfig: ChartConfig

The chart's config object

chartData: ChartData

The chart's data array

chartOutWatcher: ChartEventListener

An event watcher for the user moving the mouse out of the chart

chartType: ChartType = 'bar'

The chart's type

container: HTMLElement

DOM reference to container element that wraps SVG

SVG d3 object for d3 operations on the chart

d3Title?: DivSelection

d3 reference to chart title element

doTransform: boolean

Whether to transform keys from an unknown data schema

height: number

The current calculated height of the chart

initialWidth: number

The width before any browser resize

innerHeight: number

The current calculated inner height of the chart

innerWidth: number

The current calculated inner width of the chart

key: Key

The chart's key object instance

loader: HTMLElement

DOM reference to loader display element

padding: Padding = ...

The padding for the chart within the container

resizeOffset: number = 0

The chart's resize offset

resizeWatcher: ChartEventListener

An event watcher for the user resizing the browser

svg: SVGSVGElement

SVG DOM object for displaying the chart

tooltip: Tooltip

Chart's tooltip object instance

transitionTime: number = 500

Default time for d3 transitions on the chart

width: number

The current calculated width of the chart


  • Sets the local config options for the chart.


    missing configuration


    • chartConfig: ChartConfig

      JSON configuration object

    • shouldAddColors: boolean = false

      determine whether to add random colours to the config

    Returns void

  • Sets the local container object. #


    invalid DOM element


    • container: null | HTMLElement

      Required DOM element

    Returns void

  • Sets the local chart dimensions based on the size of the container.




    missing DOM element

    Returns void

  • Updates the local config for the chart.




    Returns void

  • Updates the local data for the chart.


    • chartData: ChartData

      array of JSON objects

    • bRender: boolean = true

    Returns void

Generated using TypeDoc