How to allow the negative x-axis values in react-d3 for bar charts

169 Views Asked by At

I'm trying to build the bar chart using react-d3-components, But here I want to show the values in negative x-axis also, can any one suggest me how can I do that,

Using module is: https://www.npmjs.com/package/react-d3-components

Here is my code:

<BarChart
          colorScale={colorScale}
          width={700}
          height={300}
          margin={{ top: 10, bottom: 50, left: 50, right: 10 }}
          {...this.props}
          yAxis={{ label: 'Days' }}
        />

to this bar passed the data like this.

const data = [
  {
    label: 'somethingA',
    values: [
      { x: '1st Point', y: 2 },
      { x: '2nd Point', y: 3 },
      { x: '3rd Point', y: 4 },
      { x: '4th Point', y: 5 },
      { x: '5th Point', y: 6 }
    ]
  }
];

I want the graph to be like this enter image description here

Can any one give me suggestions how to build these type of graphs any help much appreciated.

0

There are 0 best solutions below