Giter Club home page Giter Club logo

barchart's Introduction

Dynamic Graphical Bar Chart Visualization Tool Created for the Lighthouse Labs stretch project for Lighthouse Labs prep work modules.

API functions

  • User can query db for data and feed to JS function

Functions

  • The drawBarChart function comprises of sub-functions that create the wrappers for each value (createBarWrapper), as well as the separate X (createXDivs) and Y (createYdivs) divs that display the values of each axis.
  • drawBarChart is fed a variable referencing the element in which to append the bars, an a nested array filled with objects with individual bar values (borObjectArray) and an object with stylistic “options” (optionsObject)
  • Each these arguments are fed to almost all sub-functions
  • createBarWrapper uses a for loop to create a separate wrapper for every nested array inside the barObjectArray.
  • For each BarWrapper that is created, the createMultiBars function is called .
  • createMultiBars uses another for loop to create a bar for every object inside the nested array in the barObjectArray.
  • For each bar that is created. the styleBar function is called which styles each bar with the key values in the optionsObject.
  • setTitle creates a title in the header with customizable font.
  • findMaxValue finds the highest bar value provided and rounds it up to the nearest 100. This function is used to determine the amount of divs on the y-axis.
  • The generateColor function is used for backgrounds and all color values in the multi-bar example.
  • The randomBetween function is used to create random values for the multi-bar example.
  • jQuery event handlers and empty method are used to clear the chart when a user clicks on one of a serious of radio buttons used to pass different objects through the drawBarChart function

A list of known issues / bugs

  • Values are not exactly perfect with y-axis

Roadmap Features

  • Perfect y-axis accuracy
  • Text labels rendered on top of each bar
  • Individual value margin-width parameters
  • Automatically generated radio buttons with dynamic labels depending on how many objects are present

External Resources Used

The Odin Project MDN Stack Overflow W3 Schools Youtube

barchart's People

Contributors

jaredgoldman avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.