New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-bullet-graph

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-bullet-graph

Customizable Bullet Graph component for React Native apps.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-native-bullet-graph

Add customizable bullet graphs to your React Native apps.

Stable Release npm npm npm npm

Demo - https://react-native-bullet-graph.web.app/

Android
iOS
macOS
react-native-web

Installation 🚀

npm i react-native-bullet-graph

Usage

Follow the example below to use the graph:

import {
  SimpleBulletGraph,
  BetterBulletGraph,
} from "react-native-bullet-graph";

// Data required for setup of Simple Bullet Graph
var simpleBulletGraphData = {
  upper: 40000, // upper value for the upper range
  actual: 22000, // actual value for the current progress
  target: 27500, // target value for expected target
};

// Data required for setup of Better Bullet Graph
var betterBulletGraphData = {
  upper: 50000,
  actual: 30000,
  target: 35000,
  lower: 15000, // lower value for the bad range
  medium: 28000, // medium value for the satisfactory range
};

const App = () => {
  return (
    <>
      <SimpleBulletGraph
        data={simpleBulletGraphData}
        barHeight={30}
        barWidth={85}
        barColor={colors?.yellow}
        barBorderRadius={2}
        targetBarHeight={60}
        targetBarWidth={5}
        targetBarColor={colors?.black}
        targetTextColor={colors?.black}
        actualBarColor={colors?.green}
        actualTextColor={colors?.black}
        numericSize={12}
        timelineFontSize={12}
        hideActualValue={false}
        hideTargetValue={false}
        numberPrefix={"₹"}
        internationalNumberSystem={false}
        hideScale={false}
      />

      <BetterBulletGraph
        data={betterBulletGraphData}
        barHeight={30}
        barWidth={85}
        barColor={colors?.green}
        barBorderRadius={2}
        targetBarHeight={60}
        targetBarWidth={5}
        targetBarColor={colors?.black}
        targetTextColor={colors?.black}
        actualBarColor={colors?.black}
        actualTextColor={colors?.white}
        actualBarHeight={15}
        lowerBarColor={colors?.red}
        mediumBarColor={colors?.yellow}
        numericSize={12}
        timelineFontSize={12}
        hideActualValue={false}
        hideTargetValue={false}
        numberPrefix={"₹"}
        internationalNumberSystem={false}
        hideScale={false}
      />
    </>
  );
};

Configuration

Available props to configure the graph according to your needs:

NameTypeDefault valueDescription
dataObject (required)nullMandatory data prop which will contain upper, actual and target values
barHeightNumber20Height of the main bar, values must be entered in pixels
barWidthNumber90Width of the main bar, values will be entered used as percentage and not as pixels
barColorString"#f7b801"Fill color for the main bar
barBorderRadiusNumber10Border radius of entire graph
targetBarHeightNumber40Height of the target bar
targetBarWidthNumber5Width of the target bar
targetBarColorString"#000000"Fill color for target bar
targetTextColorString"#000000"Text color of the target amount shown on bar
actualBarColorString"#a1c181"Fill color for denoting actual progress value
actualTextColorString"#000000"Text color of the target amount shown on bar
actualBarHeightNumber15Height of actual bar (Performance Bar)
lowerBarColorString"#ff595e"Fill color for the Lower bar (Bad Range)
mediumBarColorString"#ffca3a"Fill color for the Medium bar (Satisfactory Range)
numericSizeNumber12Font size of target and actual values
timelineFontSizeNumber12Font size of timeline values
hideActualValueBooleanfalseShow or hide the actual value shown on bar
hideTargetValueBooleanfalseShow or hide the target value shown on bar
numberPrefixStringnullPrefix value to be added to all values
internationalNumberSystemBooleantrue2 or 3 digit comma separator for numeric values
hideScaleBooleanfalseShow or hide range scale
scaleColorString"#000000"Text and bar color of the scale

License

MIT

Keywords

react native

FAQs

Package last updated on 23 Nov 2023

Did you know?

Socket

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.

Install

Related posts