Chart - mwasiluk/ODC-d3 GitHub Wiki

Base class for all charts in the ODC-D3 library.

#Configuration

The ODCD3.Chart function takes 3 parameters:

  1. selector for chart placeholder element - d3.select compatible (string or node)
  2. data to plot
  3. optional config object

Configuration object properties:

  • width - svg width (default: computed to fill parent container)
  • height - svh height (default: computed to fill parent container)
  • margin - object containing plot margins:
    • left - default: 50
    • right - default: 30
    • top - default: 30
    • bottom - default: 50
  • showTooltip - show tooltips, boolean (default: false)
  • transition - use transition animations, boolean (default: true)
  • title - chart title
  • titleSize - title font size
  • titleMargin - object containing title margins:
    • left - default: 0
    • right - default: 0
    • top - default: 15
    • bottom - default: 20
  • subtitle - chart subtitle
  • subtitleSize - subtitle font size
  • subtitleMargin - object containing title margins:
    • left - default: 0
    • right - default: 0
    • top - default: 10
    • bottom - default: 20