MCPcopy Create free account
hub / github.com/codemistic/Web-Development / ChartBar

Function ChartBar

Expense Tracker/src/components/Chart/ChartBar.js:3–22  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

1import React from "react";
2import './ChartBar.css';
3function ChartBar(props){
4 let barFillHeight='0%';
5 if (props.maxValue>0){
6 barFillHeight=Math.round((props.value/props.maxValue)*100)+'%';
7 }
8
9
10 return (
11 <div className="chart-bar">
12 <div className="chart-bar__inner">
13 <div className="chart-bar__fill" style={{height:barFillHeight}}></div>
14 </div>
15 <div className="chart-bar__label">{props.label}</div>
16 </div>
17
18
19 );
20
21
22}
23export default ChartBar;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected