Class representing d3 charts

Constructors

  • Create a chart

    Parameters

    • store: Record<string, any>

      Store

    • langCode: string

      Language code

    • target: string

      ID of chart DOM element

    • countryCode: string

      Country code

    • selectedCountryCode: string

      Selected country code

    • indicatorInfo: any

      Indicator info with unit

    • OptionaldataPath: Record<string, any>

      Data Path for export

    Returns Chart

Methods

  • Create a bar chart

    Parameters

    • data: { data_value: number; indicator_specification: string }[]

      Data to visualize in a bar chart.

    • dataPathBar: Record<string, any>

      Path or identifier for the bar chart data.

    Returns void

  • Create a time series chart

    Parameters

    • data: TimeSeriesData[]

      Data to visualize in a time series

    • dataPathTime: Record<string, any>

      Data path

    Returns void

  • Create a stacked bar chart

    Parameters

    • data: StackedBarData[]

      Data to visualize in a stacked bar chart

    • dataPathStackedBar: Record<string, any>

      Data path

    Returns void

  • Export bar chart

    Returns void

  • Exports a chart as a PNG image.

    Parameters

    • chartSelector: string

      Selector for the chart element.

    • filename: string

      Name of the file to be downloaded.

    Returns void

  • Export time series chart

    Returns void

  • Wrap text if needed

    Parameters

    • text: Selection<BaseType, unknown, HTMLElement, any>

      Label text

    • width: number

      Width

    Returns void