0.1.7 • Published 2 years ago

@paraboly/react-apexcharts-dynamic-config v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Apex Chart Dynamic Config

Configure react apex chart options dynamically

Maintenance NPM Netlify Status GitHub license

Example 1Example 2Example 3
alt textalt textalt text

Demo

https://react-apexcharts-dynamic-config.netlify.app

Install

npm install --save @paraboly/react-apexcharts-dynamic-config

Usage

import React from 'react';
import ReactApexDynamicConfig from '@paraboly/react-apexcharts-dynamic-config';

const example = (): React.ReactElement => {
  //ApexCharts.ApexOptions
  const options = {
    chart: {
      type: 'pie',
    },
    title: {
      text: 'Chart Title',
    },
    labels: ['Team A', 'Team B', 'Team C', 'Team D', 'Team E'],
    legend: {
      position: 'bottom',
    },
  };

  return (
    <ReactApexDynamicConfig
      options={options}
      onChange={(opt) => console.log(opt)}
    />
  );
};

export default example;

Details

PropsDefinitionTypeDefaultRequired
optionsInitial apex chart optionsApexCharts.ApexOptionsnulltrue
translationsTranslations key value pairRecord<string, string>DEFAULT_TRANSLATIONSfalse
onChangeCallback for updated options(updatedOpt: ApexCharts.ApexOptions) => voidnulltrue

DEFAULT_TRANSLATIONS

{
  "reset": "Reset",
  "show": "Show",
  "hide": "Hide",
  "none": "None",
  "number": "Number",
  "percent": "Percent",
  "all": "All",
  "top": "Top",
  "right": "Right",
  "bottom": "Bottom",
  "left": "Left",
  "xaxis": "X-Axis",
  "yaxis": "Y-Axis",
  "legendPosition": "Legend Position",
  "titleVisibility": "Title Visibility",
  "fontSize": "FontSize",
  "axisLabelSize": "Axis Label Size",
  "dataLabels": "Data Labels"
}

License

MIT © SchemeSonic@Paraboly

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago