Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
gradient-barchart
Advanced tools
Readme
A ReactJS component for simple bar charts drawn with CSS linear-gradient
.
Import the component into your project...
import BarChart from 'gradient-barcharts';
Then use component...
<BarChart data={DATA} width={500} height={100}/>
<BarChart/>
accepts several props
:
height
and width
: Number. Determines the size of the bar chart. If the height
is greater than the width
, the bar chart will be vertical, with the data starting at the top. width
greater than height
? Horizontal bar chart, with the data laying out left to right.className
: String. A className
for the component (duh). Will default to bar-chart
.handleClick
: Function. What to do if someone were to click on the component.data
: Array of objects. Your data should have the following shape:const DATA = [
{
name: <element name>,
value: <REQUIRED amount of element>,
color: <REQUIRED valid color hex, rgb, hsl, or name>
}
];
The basic idea for this component is pretty sound and performant. It should render quickly, with minimal markup. Animating the component with CSS transitions should be straightforward.
One major drawback over SVG or multi-div
-based bar chart components is that it's not obvious how to provide tooltips when you hover over individual sections. I plan to add tooltips by detecting cursor position relative to the component.
Got an idea or improvement? Open and issue or submit a PR! 🎉
FAQs
Simple bar charts with React and CSS linear-gradient
The npm package gradient-barchart receives a total of 1 weekly downloads. As such, gradient-barchart popularity was classified as not popular.
We found that gradient-barchart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.