0.0.9 • Published 9 months ago

@tanmaya_pradhan/react-native-charts v0.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

react-native-charts

Installation

npm i @tanmaya_pradhan/react-native-charts npm install --save @react-native-svg

Features

  • Bar Chart
  • Stacked Bar chart
  • line chart
  • multilinechart
  • Combination of Line, Bar, Stack Bar chart, multi line chart
  • clickable
  • toot tip

Declarative Usage

    import { View } from 'react-native'
    import React from 'react'
    import { StackedBarChart,ChartType } from '@tanmaya_pradhan/react-native-charts'
    
    const App = () => {
      return (
        <View style={{ flex: 1 }}>
          <StackedBarChart
            containerHeight={400}
            backgroundColor='#000'
            yAxisSubstring= ''
            y2AxisSubstring=''
            showGrid={false}
            chartType={ChartType.ALL}
            y2Axis={true}
            chartData = {[
                { month: 'Jan', barValues: [100, 150, 120], lineValue: 125, multiLineValues: [100, 200] },
                { month: 'Feb', barValues: [140, 80, 120], lineValue: 250, multiLineValues: [100, 200] },
                { month: 'Mar', barValues: [70, 150, 90], lineValue: 500, multiLineValues: [100, 200] },
                { month: 'Apr', barValues: [70, 150, 90], lineValue: 400, multiLineValues: [100, 200] },
            ]}
            showTooltipPopup={false}
            onPressLineItem={(item) => console.log(item)}
            multiLineChartColors = {['red', 'blue']}
          />
        </View>
      )
    }
    
    export default App

Properties

ParameterTypeDescription
containerHeightintegerchart height
containerWidthintegerchart width
chartTypestringall, barchart, linechart
backgroundColorstringbackground color
axisColorstringaxis color
showAxisTicksbooleanit shows x, y axis ticks
showGridXbooleanit shows x-axis grid
showGridYbooleanit shows y-axis grid
gridColorstringbackground grid color
yAxisSubstringstringadd substring to y axis label
y2AxisSubstringstringadd substring to y2 axis label
y2Axisbooleanit shows another y axis at the right side when both line chart and bar chart data are available
lineColorstringline chart color
circleColorstringline chart circle color
circleColorHighPrioritybooleancircle color set as high priority color on line chart
axisFontColorstringx,y axis font color
circleRadiusintegerall circle radius
axisWidthintegerx,y axis width
axisFontSizeintegerx,y axis font size
axisFontFamilystringx,y axis font family
barWidthintegerbar chart width
line_chart_widthintegerline chart width
show_barchart_tooltipsbooleanshow tooltip on the chart
barchart_tooltip_axis_colorstringtooltip line color
barchart_tooltip_colorstringtooltip color
showTooltipPopupbooleanshow tooltip popup on the chart
toolTipContainerStylestringtoolTip container style
toolTipTextStylestringtoolTip text style
scrollEnablebooleanchart with scrollable
toolTipTextStylestringtoolTip text style
onPressItemfunctionreturns clickable bar chart item
onPressLineItemfunctionreturns clickable line chart item
chartDataobjectdata required to show the chart
chartColorsarraydata required to show the chart colors
multiLineChartColorsarraydata required to show the lien chart colors
0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

11 months ago

0.0.1

11 months ago