score:0
Accepted answer
Found the solution: Apparently, you can use have multiple x-axis. I have provided the bar chart data for ComposedChart component, made 2 XAxis components and gave them xAxisId. One of the XAxis (the one for line chart) is hidden with property hide={true}.
Line component has data property, where I passed the line chart data. Please find the code below:
<ComposedChart data={barData}>
<XAxis xAxisId={1} />
<XAsis xAxisId={2} hide={true} />
<Tooltip />
<Legend />
<Bar xAxisId={1} dataKey="pv" barSize={20} />
<Line xAxisId={2} data={lineData} dataKey="uv" dot={false} stroke="#000000" />
</ComposedChart>
Source: stackoverflow.com
Related Query
- Recharts composed chart with different data
- React Recharts render blocking with a lot of data
- How to create line chart with JSON data using D3
- Generate data into recharts bar chart using List of DTO
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Accessing multiple arrays of data with different numbers
- refetch with different data react query
- D3.js how to update chart when with new data
- How to create a refresh button with 4 different data end points in React?
- react-chartjs-2 line chart with time on X-axes with multiple data sets plotted wrong
- React Recharts -> Tooltip problem with LabelList in Scatter chart
- show two different stacked column data in one chart canvasjs react
- How can i use useParams() with an onClick button to navigate to different pages and display the data in react.js?
- How to represent a checkbox with data from two different arrays?
- How to make query api for email that I can find data email wise for different users from mongoDB with expressJs , nodeJs
- How to create simple line chart with json response data
- Rendering a Chart in React with Asynchronous Object Data
- Recharts chart not updating when using setInterval to periodically append new data
- Extending a reducer to different pages with slightly different data
- c3js multiple xy line chart with json data
- JSON: How to get data from a same "column" with different names?
- How to sync Recharts chart with something custom that is not a Recharts graph
- react-router v3: How to load data for the component when the same route with different query params is loaded
- RECHARTS having trouble applying data to my chart
- Chart Piechart in only show percentage on hover but it shows data and label with percentage both i just want to show percentage only percentage
- Data renders twice with different output
- React, how to render static json data with different keys
- Recharts ComposedChart two different data types / data baselines (value / percentage)
- React.js generate dynamic routes for the same component with different data
- How do I sustain data from DB while using another GET request with different query string in React(Next.js)?
More Query from same tag
- React Context Not Updating Globally
- React Native Image resizeMode: cover with bottom positioning
- How do you inspect a react element's props & state in the console?
- How can I wait for or cancel a data update in componentDidUpdate when a new update was triggered?
- Form in React and TypeScript with DRY handle of change
- React.js material-ui: Is it possible to sort amount when it is masked with commas?
- One common dialog for different types of input data
- Ant design DatePicker in form
- Gatsby: Multiple Content Types
- React hooks: referencing the parent of a component
- how to make last request in axios response interceptor
- React.js Getting State to Immediately Update
- Passing data to another component on click React.js
- Typescript cant find declaration file
- Property is missing in type error
- Network Error in react after deploy on heroku
- Update state on leading whitespace in React component
- Why I am not able to fetch query into my fetch url?
- how to use map function to make const in react
- ReactJS - Inline styling does not update upon rerendering of component
- Clearing cache on logout with Apollo Client
- How can get intl.formatMessage from parent component?
- Next.js - understanding getInitialProps
- How to fix image within a flexbox, ignoring containers height?
- React hook state - does not update component
- What is the best way to create text input Redux
- How to send State in Styling API as a Props for Custom Resuable ReactSelect?
- API data not printing but successes with console.log
- nginx not passing request to node server, if trailing slash is missing in the url
- can't find any method to get modified/updated image when I use PESDK in ReactComponent