react-apexcharts icon indicating copy to clipboard operation
react-apexcharts copied to clipboard

Confusing documentation

Open DarkTrick opened this issue 2 years ago • 0 comments

I'm using react-apexcharts and I'm looking at this or this for reference. I find examples are

  • not working
  • confusing (contradictory)
  • showing only parts (too less) of code

this readme says this about structure

const options = {
        chart: { id: 'apexchart-example'},
        xaxis: {categories: [1991, 1992]}
      },
const series = [{
        name: 'series-1',
        data: [30, 40]
      }]

// ...

<Chart options={options} series={series} type="bar" width={500} height={320} />

Note:

  • options and series are separated
  • options contains xaxis

This site

  • shows a different data structure.
  • does not show how to integrate (use) the data.

Code excerpt:

series: [{
    data: [{x: 'Apple',y: 54}],
}],
xaxis: {
  type: 'category'
}

Note:

  • This time xaxis is not part of options
  • How do I use the axis object?

This site introduces curve formatting, but does not explain where to put it.

Code excerpt:

stroke: {
  curve: 'straight',
}

Note:

  • It has no effect within series[x], nor within options

chart type

The documentation is also not clear about the definition of the chart type.

<ApexChart options={options} series={series} type="area" width="500" /> (from the example in README) produces something like this: image

However, moving the type into series like this:

const series = [
			{
				name: 'series-1',
				data: [30, 40, 45, 50, 49, 60, 70, 20],
				type: 'area,
			},
		],

<ApexChart options={options} series={series}  width="500" />

will create a very different graph:

image

My hopes

It would be nice, if the documentation could be straightened out to make usage easier.

DarkTrick avatar Jun 08 '22 02:06 DarkTrick