npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oliasoft-open-source/charts-library

v9.1.0

Published

React Chart Library (based on Chart.js and react-chart-js-2)

Readme

Chart Library

Reusable charts for use in React applications.

Usage and defaults

The component JSDoc contains usage examples with sample data, labels and an explicit height. Those example values are not defaults.

The sections below show the complete library-normalized configuration for getDefaultProps({ chart: {} }). You do not need to pass these objects: omitted options receive these values automatically.

  • undefined means the library leaves that value unspecified; it does not mean zero or false.
  • Empty data is the default. Supply your own DS to draw a chart.
  • These are library defaults, not a dump of Chart.js or plugin defaults. Final rendering can also depend on data, container size, theme, plugin configuration and, for LineChart, persisted control state.
  • Compatibility fields may appear in normalized output without affecting rendering; see their public type documentation.
  • Default unit-selector callbacks are no-ops; consumers own unit selection and data conversion.
  • The snapshots describe the initial empty configuration. Per-item defaults for supplied annotations and DS are applied separately by their normalizers and renderers.

Migrating LineChart tooltips to 8.0

Tooltip coordinate roles no longer depend on axis placement. The default title shows X and the DS row shows Y. Set options.tooltip.titleAxis to 'y' when the title should show Y and the DS row should show X. Charts that previously relied on a top-positioned X axis must set this explicitly to preserve their tooltip order. If your application swaps X/Y coordinates, update titleAxis to keep the intended quantity in the title. This setting does not move axes, reverse scales or transpose data.

The default DS row reads units from the corresponding axis unit string or unit.selectedUnit when non-empty, then falls back to units in square brackets in that axis label. The title appends its axis label. Each hovered DS uses its own axis bindings, including numbered IDs such as x10 and y10. Time and category values retain their formatted labels. Custom title, label and afterLabel callbacks continue to override their respective defaults independently.

LineChart

const noop = () => {
  // Default unit selection does not change consumer state.
};

const defaultChart = {
  persistenceId: '',
  controlsPortalId: '',
  testId: undefined,
  data: {
    datasets: [],
  },
  options: {
    title: '',
    scales: {
      x: {},
      y: {},
    },
    axes: {
      x: [
        {
          label: '',
          position: 'bottom',
          color: '',
          unit: {
            options: [],
            selectedUnit: '',
            setSelectedUnit: noop,
          },
        },
      ],
      y: [
        {
          label: '',
          position: 'left',
          color: '',
          unit: {
            options: [],
            selectedUnit: '',
            setSelectedUnit: noop,
          },
        },
      ],
    },
    additionalAxesOptions: {
      chartScaleType: 'linear',
      reverse: false,
      beginAtZero: false,
      stepSize: undefined,
      suggestedMin: undefined,
      suggestedMax: undefined,
      range: undefined,
      autoAxisPadding: false,
    },
    chartStyling: {
      width: undefined,
      height: undefined,
      maintainAspectRatio: false,
      staticChartHeight: false,
      performanceMode: true,
      squareAspectRatio: false,
      layoutPadding: {
        top: 0,
        bottom: 20,
        left: 0,
        right: 0,
      },
    },
    tooltip: {
      tooltips: true,
      showLabelsInTooltips: false,
      hideSimulationName: false,
      scientificNotation: true,
      callbacks: undefined,
      titleAxis: 'x',
    },
    graph: {
      lineTension: 0.01,
      spanGaps: false,
      showDataLabels: false,
      showMinorGridlines: false,
    },
    annotations: {
      labelAnnotation: {
        showLabel: false,
        text: '',
        position: 'bottom-right',
        fontSize: 12,
        xOffset: 5,
        yOffset: 5,
        maxWidth: 300,
        lineHeight: 12,
      },
      showAnnotations: false,
      controlAnnotation: false,
      enableDragAnnotation: false,
      enableCalloutAnnotation: false,
      lineMarkersAnnotation: {
        enabled: false,
        itemGapPx: 4,
        edgePaddingPx: 8,
        horizontalLineLengthPx: undefined,
        lineDirection: undefined,
        labelCollisionPx: 4,
        labelCollisionClusterXPx: 36,
        enableLabelCollisionResolver: true,
        stickToEdge: true,
        stickToGroup: false,
        stickSide: 'right',
        reverse: false,
        xValue: undefined,
        yValue: undefined,
        yStartValue: undefined,
        yEndValue: undefined,
        xStartValue: undefined,
        xEndValue: undefined,
        lengthPx: undefined,
        color: 'rgba(20,20,20,0.9)',
        opacity: 1,
        lineWidth: 1,
        lineDash: [],
        startTick: undefined,
        endTick: undefined,
        items: [],
      },
      annotationsData: [],
    },
    legend: {
      display: true,
      position: 'bottom-left',
      align: 'center',
      customLegend: {
        customLegendPlugin: null,
        customLegendContainerID: '',
      },
      usePointStyle: true,
    },
    chartOptions: {
      showPoints: true,
      showLine: true,
      enableZoom: true,
      enablePan: false,
      enableDragAnnotation: false,
      closeOnOutsideClick: false,
    },
    interactions: {
      onLegendClick: undefined,
      onHover: undefined,
      onUnhover: undefined,
      onAnimationComplete: undefined,
    },
    dragData: {
      enableDragData: false,
      showTooltip: true,
      roundPoints: true,
      dragX: true,
      dragY: true,
      onDragStart: undefined,
      onDrag: undefined,
      onDragEnd: undefined,
    },
    depthType: {},
  },
};

BarChart

const defaultChart = {
  testId: '',
  controlsPortalId: '',
  data: {
    labels: [],
    datasets: [],
  },
  options: {
    title: '',
    direction: 'vertical',
    axes: {
      x: [{}],
      y: [{}],
    },
    additionalAxesOptions: {
      chartScaleType: 'linear',
      reverse: false,
      stacked: false,
      beginAtZero: true,
      stepSize: undefined,
      suggestedMin: undefined,
      suggestedMax: undefined,
      min: undefined,
      max: undefined,
      stackedX: undefined,
      stackedY: undefined,
    },
    chartStyling: {
      width: undefined,
      height: undefined,
      maintainAspectRatio: false,
      staticChartHeight: false,
      performanceMode: true,
    },
    tooltip: {
      tooltips: true,
      showLabelsInTooltips: false,
      scientificNotation: true,
    },
    graph: {
      showDataLabels: false,
      showMinorGridlines: false,
    },
    scales: {},
    annotations: {
      showAnnotations: true,
      controlAnnotation: false,
      annotationsData: [],
    },
    legend: {
      display: true,
      position: 'top-left',
      align: 'center',
      customLegend: {
        customLegendPlugin: null,
        customLegendContainerID: '',
      },
    },
    chartOptions: {
      enableZoom: false,
      enablePan: false,
    },
    interactions: {
      onLegendClick: undefined,
      onHover: undefined,
      onUnhover: undefined,
    },
    dragData: {
      enableDragData: false,
      showTooltip: true,
      roundPoints: true,
      dragX: true,
      dragY: true,
      onDragStart: undefined,
      onDrag: undefined,
      onDragEnd: undefined,
    },
  },
};

PieChart

const defaultChart = {
  testId: null,
  data: {
    labels: [],
    datasets: [],
  },
  options: {
    title: '',
    chartStyling: {
      width: undefined,
      height: undefined,
      maintainAspectRatio: false,
      staticChartHeight: false,
      performanceMode: true,
    },
    tooltip: {
      tooltips: true,
      showLabelsInTooltips: false,
      scientificNotation: true,
    },
    graph: {
      showDataLabels: false,
      stacked: false,
      cutout: 0,
    },
    legend: {
      display: true,
      useDataset: false,
      position: 'bottom',
      align: 'center',
    },
    chartOptions: {
      enableZoom: false,
      enablePan: false,
    },
    interactions: {
      onLegendClick: undefined,
      onHover: undefined,
      onUnhover: undefined,
    },
  },
};

ScatterChart

import { GradientDirection } from '@oliasoft-open-source/charts-library';

const defaultChart = {
  testId: null,
  data: {
    labels: [],
    datasets: [],
  },
  options: {
    title: '',
    axes: {
      x: [{}],
      y: [{}],
    },
    additionalAxesOptions: {
      chartScaleType: 'linear',
      reverse: false,
      stacked: false,
      beginAtZero: true,
      stepSize: undefined,
      suggestedMin: undefined,
      suggestedMax: undefined,
      min: undefined,
      max: undefined,
    },
    direction: 'vertical',
    chartStyling: {
      width: 'auto',
      height: 'auto',
      maintainAspectRatio: false,
      staticChartHeight: false,
      performanceMode: true,
      gradient: {
        display: false,
        gradientColors: [
          {
            offset: 0,
            color: 'rgba(144,238,144,0.8)',
          },
          {
            offset: 0.6,
            color: 'rgba(255,255,224,0.8)',
          },
          {
            offset: 0.8,
            color: 'rgba(255,255,224,0.8)',
          },
          {
            offset: 0.92,
            color: 'rgba(255,182,193,0.5)',
          },
          {
            offset: 0.99,
            color: 'rgba(255,182,193,0.8)',
          },
        ],
        direction: GradientDirection.BottomLeftToTopRight,
      },
    },
    tooltip: {
      enabled: true,
      tooltips: true,
      showLabelsInTooltips: false,
      backgroundColor: '#333',
      displayColors: false,
      scientificNotation: true,
    },
    graph: {
      showMinorGridlines: false,
      showDataLabels: false,
    },
    scales: {},
    legend: {
      display: true,
      useDataset: false,
      position: 'bottom-left',
      align: 'center',
    },
    annotations: {
      showAnnotations: true,
      controlAnnotation: false,
      annotationsData: [],
    },
    chartOptions: {
      enableZoom: false,
      enablePan: false,
    },
    interactions: {
      onLegendClick: undefined,
      onHover: undefined,
      onUnhover: undefined,
      onAnimationComplete: undefined,
    },
  },
};