Giter Club home page Giter Club logo

react-native-chart's Introduction

react-native-chart

NOTE: I have not been able to maintain this repo. Recommend switching to Victory Charts.

Screenshot

Getting Started

NPM

  1. npm i react-native-chart --save

Link ART to your project

  1. Right click Libraries and click 'Add Files to {YourProject}'

screen shot 2016-06-17 at 3 39 24 pm

  1. Navigate to your project's node_modules/react-native/Libraries/ART and select 'ART.xcodeproj'

screen shot 2016-06-17 at 3 39 42 pm

  1. Go to Build Phases -> Link Binary With Libraries

screen shot 2016-06-17 at 3 40 00 pm

4 Click the '+', and add libART.a

screen shot 2016-06-17 at 3 40 03 pm

Then rebuild.

Usage

import React, { StyleSheet, View, Component } from 'react-native';
import Chart from 'react-native-chart';

const styles = StyleSheet.create({
	container: {
		flex: 1,
		justifyContent: 'center',
		alignItems: 'center',
		backgroundColor: 'white',
	},
	chart: {
		width: 200,
		height: 200,
	},
});

const data = [[
	[0, 1],
	[1, 3],
	[3, 7],
	[4, 9],
]];

class SimpleChart extends Component {
	render() {
		return (
			<View style={styles.container}>
				<Chart
					style={styles.chart}
					data={data}
					verticalGridStep={5}
					type="line"
					showDataPoint={true}
					color={['#e1cd00']}
				 />
			</View>
		);
	}
}

Properties

Use '' y-values to signify the 'render but empty' data points.

Property Type Description Required Default
data Array< Array< [number, number] > > An array of arrays of [x, y] pairs. Yes
type string pie/bar/line Yes bar
color Array < string > Color of bars/line in line chart No #4DC4E6
cornerRadius number Corner radius of bars in bar chart No 0
fillColor Array < string > Fill area colors in line chart No
dataPointColor Array < string > Stroke colors for line chart data point No
dataPointFillColor Array < string > Fill colors for line chart data point No
dataPointRadius number Radius of the data point No 3
lineWidth number Width of line chart line No 1
showDataPoint boolean Show data points on line chart No false
sliceColors Array < string > Array of colors for pie chart slices Yes [ < random colors > ]
axisColor string Color of axis lines No #333333
axisLabelColor string Color of axis test No #333333
axisLineWidth number Width of axis lines No 1
gridColor string Color of grid lines No #333333
gridLineWidth number Width of grid lines No 0.5
hideHorizontalGridLines boolean Hide grid lines going from LTR No false
hideVerticalGridLines boolean Hide grid lines going up -> down No false
showAxis boolean Show the X and Y axes No true
showGrid boolean Show the grid No true
showXAxisLabels boolean Show X-Axis labels No true
showYAxisLabels boolean Show Y-Axis labels No true
style object Style on the container No {}
tightBounds boolean Tighten min and max bounds strictly to min/max in dataset No false
verticalGridStep number How many vertical grid lines to show No 4
horizontalGridStep number How many horizontal grid lines to show No all
xAxisHeight number Height of X-axis container No 20
yAxisTransform Function Transform data point to y-axis label No (_) => _
xAxisTransform Function Transform data point to x-axis label No (_) => _
yAxisWidth number Width of the Y-axis container No 30
yAxisUseDecimal boolean Show decimals on Y-axis labels No false
yAxisShortLabel boolean Shorten yAxis labels with K, M, B for thousand<->billion, etc No false

TODO

  • Code cleanup
  • Multi-line chart
  • Horizontal line chart
  • Scatter chart

react-native-chart's People

Contributors

bt404 avatar chen90git avatar colinrtaylor avatar gitter-badger avatar hyuncho avatar jakkra avatar johnnyoshika avatar kauffecup avatar lwansbrough avatar mahlon-gumbs avatar mokto avatar msom avatar tomauty avatar uruk avatar zakhttp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-chart's Issues

horizontalGridStep

Hello thanks for this awesome component! I have a quick question about the coming features.

  1. Will there be support for setting horizontalGripStep soon?
  2. Will I be able to put the name of the data beside the end of the line?

Do you have plan implementing the above features? Thanks for the help!

No manager class found for view with module name "RNChartView"

2015-05-25 17:11:20.941 [warn][tid:com.facebook.React.ShadowQueue][RCTUIManager.m:776] No manager class found for view with module name "RNChartView"

I can not see anything in the position of RNChart. Thanks.

          <View style = { styles.container }>
            <Text style = { styles.city_day }> 
              { this.state.current.city } / { this.state.current.date }
            </Text>
            <Text style = { styles.status }>
              { this.state.current.weather } { this.state.current.temp }° 
            </Text> 
            <Text style = { styles.current }> 
              { this.state.current.icon } 
            </Text> 
            <RNChart style={styles.chart}
                chartData={chartData}
                verticalGridStep="5"
                xLabels={xLabels}
                chartTitle="My Simple Chart"
                chartFontSize="22"
                xAxisTitle="X Axis"
                yAxisTitle="Y Axis"            
                onTouchEnd={this._onTouchEnd}>
            </RNChart>
          </View>

Couldn't locate libRNChart.a

I've followed the first three steps and stuck at the fourth step. Can't find "libRNChart.a" in the list of "Link Binary with Libraries" or in the source folder.

In XCode, in the project navigator, select your project. Add libRNChart.a to your project's Build Phases ➜ Link Binary With Libraries

How to plot X-Y data series that does not have constant X sample step?

For example 3 data points that are not evenly spaced on the distance X axis; at 0m, 16m, and 139m.

screen shot 2016-03-25 at 12 32 56 pm

Plot as evenly spaced because the X value is not part of the data series. This is not what is needed.

screen shot 2016-03-25 at 12 34 20 pm

Does your API have a way to plot X and Y values?

X Y
00.00 1.00
16.13 3.00
139.59 6.00

It seems like I need to create a data series with 150 null points to cover 150 meters, then round up to nearest, and set the non-null data points at locations

data[0]= 1
data[16] = 3
data[140] = 6.00

Thanks in advance,

use `dataPointFillColor` in chartData error

I don't know how to change dataPointFillColor at js side, when I directly specify string value #98E489 below error occured,
maybe I'll call processColor() somewhere?,

could you help me? thanks..

JSON value '#98E489' of type NSString cannot be converted to a UIColor. Did you forget to call processColor() on the JS side?

make horizontal chart?

very smart project, may I have two suggestion here?

  1. how could I make horizontal chart when I choose type: 'bar'
  2. any options that making chart interactively? maybe highlight is enough.

thanks for your time..

Example code not working

Hi, I'm having some trouble getting the readme example to work. I'm only seeing a red border around where the chart should be displayed. I'm using react native 0.21.0 and iOS 9.2.

Support 'pieCenterRatio' prop

Right now you can just create a donut by appending a white circle over the piechart, but it would be nice to have that included in this lib as well.

labelFontSize doesn't work

labelFontSize isn't working.

Example 1: labelFontSize 7

        <RNChart style={styles.chart}
          chartData={chartData}
          verticalGridStep={5}
          xLabels={xLabels}
          labelFontSize={7}>
        </RNChart>

image

Example 2: labelFontSize 12

        <RNChart style={styles.chart}
          chartData={chartData}
          verticalGridStep={5}
          xLabels={xLabels}
          labelFontSize={12}>
        </RNChart>

image

Regardless of the labelFontSize setting, the font size remains the same.

Bar chart not displaying single data point properly

From all I can see in the docs, there isn't a way to customize the display of specific bars in the chart- only the styles of the chart as a whole.

This becomes problematic when trying to display a bar chart containing only a single data point (e.g. chart data being something like [30]) - it's showing the data from the very left, instead of getting centered on the chart. I set xLabels to ['0'].

From a bar chart taken from the example in the readme and slightly modified to contain a single data point, I'm getting something like this:

screen shot 2016-03-18 at 12 22 34 pm

Is there any way to center the data?

Interactive Chart ?

Is it possible to make the chart more interactive , by say tapping on a data point to show a modal with the values.

Thanks

Remove support for multiple charts

This would fundamentally change the API, but I don't understand the need for an array of chart data vs one chart per component. Could someone enlighten me on the use case for this? It's becoming more complicated to support new chart types when it's possible to have more than one per component (e.g. Pie chart)

Support fillGradient

Support an array of two color values such that it will create a gradient starting at [0], ending at [1].

Maintainer?

Are you looking for a maintainer for this project? I'm willing to put in some work if you are. This is a project that the community is dying to use.

crashed while all chartData.data values are 0

Hi,
I get a strange error while i am trying to render a chart with all 0s in y-axis. I would expect a straight line on the x-axis but get the following error. Is this caused due to my misuse of the lib or to some bugs?

2016-03-25 13:10:53.784 [info][tid:com.facebook.React.JavaScript] [ 'Thu Mar 24 2016 13:00:00',
'Thu Mar 24 2016 14:00:00',
'Thu Mar 24 2016 15:00:00',
'Thu Mar 24 2016 16:00:00',
'Thu Mar 24 2016 17:00:00',
'Thu Mar 24 2016 18:00:00',
'Thu Mar 24 2016 19:00:00',
'Thu Mar 24 2016 20:00:00',
'Thu Mar 24 2016 21:00:00',
'Thu Mar 24 2016 22:00:00',
'Thu Mar 24 2016 23:00:00',
'Fri Mar 25 2016 00:00:00',
'Fri Mar 25 2016 01:00:00',
'Fri Mar 25 2016 02:00:00',
'Fri Mar 25 2016 03:00:00',
'Fri Mar 25 2016 04:00:00',
'Fri Mar 25 2016 05:00:00',
'Fri Mar 25 2016 06:00:00',
'Fri Mar 25 2016 07:00:00',
'Fri Mar 25 2016 08:00:00',
'Fri Mar 25 2016 09:00:00',
'Fri Mar 25 2016 10:00:00',
'Fri Mar 25 2016 11:00:00',
'Fri Mar 25 2016 12:00:00',
'Fri Mar 25 2016 13:00:00' ]
2016-03-25 13:10:53.785 [info][tid:com.facebook.React.JavaScript] [ { name: 'LineChart',
color: 'gray',
lineWidth: 2,
showDataPoint: true,
data: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] } ]
2016-03-25 13:10:53.811 Sentry[12583:439969] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [6.9 nan]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107ba2e65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000106da6deb objc_exception_throw + 48
2 CoreFoundation 0x0000000107ba2d9d +[NSException raise:format:] + 205
3 QuartzCore 0x0000000109238a86 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
4 QuartzCore 0x0000000109238bf9 -[CALayer setPosition:] + 44
5 QuartzCore 0x000000010923925d -[CALayer setFrame:] + 650
6 Sentry 0x0000000106747f3a -[RNChartPlotAreaView drawDataPoints:] + 3130
7 Sentry 0x0000000106743f0b -[RNChartPlotAreaView drawCharts] + 859
8 Sentry 0x000000010674cb58 -[RNChartView buildChart] + 5960
9 Sentry 0x000000010674b2fc -[RNChartView layoutSubviews] + 92
10 UIKit 0x00000001095774a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
11 QuartzCore 0x000000010924159a -[CALayer layoutSublayers] + 146
12 QuartzCore 0x0000000109235e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
13 QuartzCore 0x0000000109235cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
14 QuartzCore 0x000000010922a475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
15 QuartzCore 0x0000000109257c0a _ZN2CA11Transaction6commitEv + 486
16 QuartzCore 0x000000010925837c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
17 CoreFoundation 0x0000000107ace367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23
18 CoreFoundation 0x0000000107ace2d7 __CFRunLoopDoObservers + 391
19 CoreFoundation 0x0000000107ac3f2b __CFRunLoopRun + 1147
20 CoreFoundation 0x0000000107ac3828 CFRunLoopRunSpecific + 488
21 GraphicsServices 0x000000010b928ad2 GSEventRunModal + 161
22 UIKit 0x00000001094c0610 UIApplicationMain + 171
23 Sentry 0x000000010662be2f main + 111
24 libdyld.dylib 0x000000010b17a92d start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

error with react-native version 0.13.0-rc

Hi, I install the module by npm install https://github.com/onefold/react-native-chart --save,and the version of react-native I installed is 0.13.0-rc. The console now shows as below and I have a runtime error in RNChartView.m line 55. The message is Error setting property 'verticalGridStep' of RNChartView with tag #8: JSON value '5' of type NSString cannot be converted to NSNumber.

Unable to resolve module ReactPropTypes from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module ReactNativeViewAttributes from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module createReactNativeComponentClass from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module StyleSheet from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module NativeMethodsMixin from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module flattenStyle from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js
Unable to resolve module merge from /Users/MLS/mls/biz/dc_native/SexyDc/node_modules/react-native-chart/Chart.ios.js

How can I solve the problem? Thanks.

npm install implies a dependency on React Native 0.4.0

I don't know if this is true or not, but when installing react-native-chart via npm, I get an error that implies that there's a dependency on React Native version 0.4.0. Is this true? If not, you'll probably want to remove the dependency error:

image

Lines doesn't start at minBounds when using tightBounds and fillColor

Awesome lib,

I'm using tightBounds with a vertical range about 1500-1520 and i realize that lines doesn't start at the bottom (1500), It starts in a long way down, instead of the minBounds of the tightBounds.

I've slow down the animationDuration to show it, you can also see the fillColor ended much higher than expected.
issue

It's only occurs when sets fillColor property.

I've played a little bit on the path scale, but no success yet, any progress i'd pull request, any help would be appreciated.

Invalid directory /Users/node_modules/ReactPropTypes

I get this issue with below description

Unable to resolve module ReactPropTypes from /Users/jovi/AwesomeProject/node_modules/react-native-chart/Chart.ios.js: Invalid directory /Users/node_modules/ReactPropTypes

but I indeed follow step from getting-started

could anybody help me ?
thanks..

Support chart type 'horizontalBar'

Title should explain. Will appear horizontal. This might behave strangely with another chart that isn't a horizontalBar, so will have to investigate a solution. Any suggestions for how to handle this would be appreciated.

Pie chart off-centre

Pie chart centring is slightly off to the right. This can be seen in the screenshot from the readme.md, as well as my own application (shown in screenshot)

screen shot 2016-02-29 at 10 55 00 am

Support X-Axis Angle

Hi, Do you plan to provide a xaxis label angle props that allowed labels display in a certain angle? because if i put a long x axis label, it will overlapped to each other, any idea of it?

Android support?

I don't believe there is but do you plan on having Android support?

Thanks so much

BarChart has not the correct alignment

Hello,

i use you react native module and it's realy nice, but i see, that a bar plot is not corrected aligned on the x-axis. You can see it in the scrrenshot:
bildschirmfoto 2015-08-06 um 22 33 48

How can i fix that ?

Thanks
Marcel

Screenshots?

Would make it easier to evaluate this module.

Interactive Chart

Here's my first draft of what an interactive chart might be comprised of:

The press event

{
  coordinates: {
    x: number,    // X-coordinate on the device
    y: number,    // Y-coordinate on the device
  },
  didPressDataPoint: boolean,   // to help you decide whether or not to show a view or some such thing
  closestDataPoint: DataPoint   // this will make more sense as 2.0 gets fleshed out, but an instance of a DataPoint object
}

The events
onPressIn
onPressOut

The Chart will emit these events, and as such you will be able to attach listeners to them via the ref.

Please feel free to comment about feedback, questions, etc. I want this to be as community-involved as possible.

Incompatible with React Native ^0.15.0

• Uses outdated requires
• Uses createNativeComponentClass instead of requireNativeComponent and setNativeProps
• Uses NativeMethodsMixin

Throws errors like:

2015-12-15 10:20:02.399 [error][tid:main] Unable to resolve module ReactPropTypes
from /Workspace/NameOfProject/node_modules/react-native-chart/Chart.ios.js:
Invalid directory /node_modules/ReactPropTypes

2015-12-15 10:24:31.510 [error][tid:main] Unable to resolve module
ReactNativeViewAttributes from /Workspace/NameOfProject/node_modules/
react-native-chart/Chart.ios.js:
Invalid directory /node_modules/ReactNativeViewAttributes

linking error while integrating react-native-chart

I am getting following error while adding onefold react native chart in my application . It is a linking error but i have already added all library .

Ld /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/AwesomeProject1.app/AwesomeProject1 normal x86_64
cd /Users/shanba6/AwesomeProject1/ios
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator -F/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator -filelist /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Intermediates/AwesomeProject1.build/Debug-iphonesimulator/AwesomeProject1.build/Objects-normal/x86_64/AwesomeProject1.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.1 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libReact.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -Xlinker -dependency_info -Xlinker /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Intermediates/AwesomeProject1.build/Debug-iphonesimulator/AwesomeProject1.build/Objects-normal/x86_64/AwesomeProject1_dependency_info.dat -o /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/AwesomeProject1.app/AwesomeProject1

ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartAxisView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartPlotAreaView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartViewManager.o)) was built for newer iOS version (9.0) than being linked (7.1)
Undefined symbols for architecture x86_64:
"_RCTCopyProperty", referenced from:
-[RNChartViewManager set_chartData:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_verticalGridStep:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_animationDuration:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showGrid:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridColor:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridLineWidth:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showAxis:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
...
"_RCTSetProperty", referenced from:
-[RNChartViewManager set_chartData:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_verticalGridStep:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_animationDuration:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showGrid:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridColor:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridLineWidth:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showAxis:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ld /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/AwesomeProject1.app/AwesomeProject1 normal x86_64
cd /Users/shanba6/AwesomeProject1/ios
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator -F/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator -filelist /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Intermediates/AwesomeProject1.build/Debug-iphonesimulator/AwesomeProject1.build/Objects-normal/x86_64/AwesomeProject1.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.1 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libReact.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -Xlinker -dependency_info -Xlinker /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Intermediates/AwesomeProject1.build/Debug-iphonesimulator/AwesomeProject1.build/Objects-normal/x86_64/AwesomeProject1_dependency_info.dat -o /Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/AwesomeProject1.app/AwesomeProject1

ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartAxisView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartPlotAreaView.o)) was built for newer iOS version (9.0) than being linked (7.1)
ld: warning: object file (/Users/shanba6/Library/Developer/Xcode/DerivedData/AwesomeProject1-ezoxvgkiizqjhsftoxrkntfykjsp/Build/Products/Debug-iphonesimulator/libRNChart.a(RNChartViewManager.o)) was built for newer iOS version (9.0) than being linked (7.1)
Undefined symbols for architecture x86_64:
"_RCTCopyProperty", referenced from:
-[RNChartViewManager set_chartData:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_verticalGridStep:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_animationDuration:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showGrid:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridColor:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridLineWidth:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showAxis:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
...
"_RCTSetProperty", referenced from:
-[RNChartViewManager set_chartData:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_verticalGridStep:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_animationDuration:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showGrid:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridColor:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_gridLineWidth:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
-[RNChartViewManager set_showAxis:forView:withDefaultView:] in libRNChart.a(RNChartViewManager.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Crash when data series is all zero, and showDataPoint is true

A single chart with all zero data is fine.

If data series is all zero, and showDataPoint is true, I always get a crash in iOS 6s simulator

    let willCrash = true;
    const charts = [{
      type: 'line',
      showDataPoint: crash,
      data: [0, 0],
    }];

It is something to do with zero and showDataPoint because matching data: [1,1] does not crash.

dladdr(0x1, 0x7fda7dbab270)
dyld_image_header_containing_address(0x1064aeefa)
_dyld_get_image_slide(0x106168000)
_dyld_get_image_slide(0x106168000)
2016-03-25 12:58:20.954 FieldPlanner[41520:372927] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [111.5 nan]'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001062b4d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001054a8deb objc_exception_throw + 48
    2   CoreFoundation                      0x00000001062b4cbd +[NSException raise:format:] + 205
    3   QuartzCore                          0x0000000107fd8e4a _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
    4   QuartzCore                          0x0000000107fd8fbd -[CALayer setPosition:] + 44
    5   QuartzCore                          0x0000000107fd9624 -[CALayer setFrame:] + 650
    6   FieldPlanner                        0x000000010476b41a -[RNChartPlotAreaView drawDataPoints:] + 3050
    7   FieldPlanner                        0x0000000104767906 -[RNChartPlotAreaView drawCharts] + 854
    8   FieldPlanner                        0x000000010476fc77 -[RNChartView buildChart] + 5527
    9   FieldPlanner                        0x000000010476e5cc -[RNChartView layoutSubviews] + 92
    10  UIKit                               0x000000010832d980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
    11  QuartzCore                          0x0000000107fe1c00 -[CALayer layoutSublayers] + 146
    12  QuartzCore                          0x0000000107fd608e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
    13  QuartzCore                          0x0000000107fd5f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
    14  QuartzCore                          0x0000000107fca3c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
    15  QuartzCore                          0x0000000107ff8086 _ZN2CA11Transaction6commitEv + 486
    16  QuartzCore                          0x0000000107ff87f8 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    17  CoreFoundation                      0x00000001061d9c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    18  CoreFoundation                      0x00000001061d9ba7 __CFRunLoopDoObservers + 391
    19  CoreFoundation                      0x00000001061cf7fb __CFRunLoopRun + 1147
    20  CoreFoundation                      0x00000001061cf0f8 CFRunLoopRunSpecific + 488
    21  GraphicsServices                    0x000000010b7b3ad2 GSEventRunModal + 161
    22  UIKit                               0x0000000108272f09 UIApplicationMain + 171
    23  FieldPlanner                        0x0000000104634f8f main + 111
    24  libdyld.dylib                       0x000000010a2c592d start + 1
    25  ???                                 0x0000000000000001 0x0 + 1

)

Unable to do npm install of the react-native-chart

I was unable to do npm install due to the following error with my react-native 0.12.0. I appears that the dependency of the react-native-chart prevent npm from going forward. It looks like this repository is still stuck in the old react-native 0.4.0

$ npm install react-native-chart --save
npm WARN peerDependencies The peer dependency react-native@^0.4.0 included from react-native-chart will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/Eric/.nvm/versions/node/v4.1.2/bin/node" "/Users/Eric/.nvm/versions/node/v4.1.2/bin/npm" "install" "react-native-chart" "--save"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants react-native@^0.4.0

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Eric/GitHub/Mi-KPI/npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.