
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@byu-oit/bar-chart
Advanced tools
Generate a bar chart in svg format. Intended to be used to generate an API response.
Generate a bar chart in svg format to be used as an API response.
import barChart from '@byu-oit/bar-chart'
const myData = [10, 12, 14, 24, 38]
const myDataLabels = ['A', 'B', 'C', 'D', 'E']
const chartSvg = barChart({data: myData, labels: myDataLabels})
The bar chart function takes a single configuration parameter.
key | type | required? | description |
---|---|---|---|
data | Array of Numbers, or 2 Dimensional Array of Numbers | required | An array of values to chart. For example, if you want to chart visits per day, your data could be [104, 78, 120, 88] with labels of ['May 13', 'May 14', 'May 15', 'May 16'] . The values may themselves be arrays, but must all have the same length. |
labels | Array of Strings | required | An array of string labels corresponding by index to the associated data element. |
legendLabels | [string labels] | optional | An array of labels for the bar colors. For example, you could chart visits per day, with each browser in a different color. |
stacked | boolean | optional, default is false | If true, the bars will be stacked instead of side-by-side. |
colors | Array of Strings | optional | Supply custom colors for the bars. |
showValues | boolean | optional, default is false | If true, the value will be shown near the top of each bar. |
FAQs
Generate a bar chart in svg format. Intended to be used to generate an API response.
The npm package @byu-oit/bar-chart receives a total of 53 weekly downloads. As such, @byu-oit/bar-chart popularity was classified as not popular.
We found that @byu-oit/bar-chart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.