Skip to content

This project showcases various types of charts (Bar, Line, Area, Scatter, Pie, Column, Bubble, and Pictograph) using React and Chart.js. The charts use random generated or example data to illustrate how each type can be implemented.

License

Notifications You must be signed in to change notification settings

praveenjadhav1510/Graphs---charts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphs---charts

React Chart.js Visualization

This project showcases various types of charts (Bar, Line, Area, Scatter, Pie, Column, Bubble, and Pictograph) using React and Chart.js. The charts use random generated or example data to illustrate how each type can be implemented.

Table of Contents

Features

  • Bar chart for visualizing categories like monthly sales.
  • Line graph for tracking trends such as website traffic.
  • Area chart to show the filled area between two axes.
  • Scatter plot for visualizing point data relationships.
  • Pie chart for displaying portions of a whole dataset.
  • Column chart for vertical bar representations.
  • Bubble chart to plot data with varying bubble sizes.
  • Pictograph representation using icons (such as apples).

Technologies

This project is built with:

  • React.js - A JavaScript library for building user interfaces.
  • Chart.js - A JavaScript library for creating charts.
  • React-Chartjs-2 - A React wrapper for Chart.js to make it easier to integrate in React apps.

Setup and Installation

  1. Clone the repository:
    git clone https://github.com/praveenjadhav1510/Graphs---charts
  2. Navigate to the project directory:
    cd Graphs---charts
  3. Install the dependencies:
    npm install
  4. Run the development server:
    npm start

The app should now be running at http://localhost:3000.

Available Charts

This app includes the following chart types:

  1. Bar Chart
  2. Line Graph
  3. Area Chart
  4. Scatter Plot
  5. Pie Chart
  6. Column Chart
  7. Bubble Chart

Each chart is displayed with a unique dataset. Check out the /src/components/ folder to see the implementations.

Usage

In the App.js file, all the charts are imported and displayed on the main page. You can customize the datasets in each component or add new charts using Chart.js by following the documentation links below.

Example: Line Graph

import LineGraphComponent from './LineGraphComponent';

const App = () => {
  return (
    <div className="App">
      <h1>React Chart.js Example</h1>
      <LineGraphComponent />
    </div>
  );
};

export default App;

Data Customization

Each chart receives its data through a data object. For example, the Line Graph uses:

const data = {
  labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
  datasets: [
    {
      label: 'Website Traffic',
      data: [500, 600, 700, 800],
      borderColor: 'blue',
      fill: false,
    },
  ],
};

You can update this data for your own use cases.

Contributing

Contributions are welcome! If you have any ideas or suggestions for improving this project, feel free to open a pull request or create an issue.

To contribute:

  1. Fork the project.
  2. Create your feature branch (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature/new-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

This project showcases various types of charts (Bar, Line, Area, Scatter, Pie, Column, Bubble, and Pictograph) using React and Chart.js. The charts use random generated or example data to illustrate how each type can be implemented.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published