react-native-gifted-charts 1.2.16 → 1.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gifted-charts",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "The most complete library for Bar, Line, Area, Pie, Donut and Stacked Bar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
5
5
  "main": "src/index.tsx",
6
6
  "files": [
@@ -64,6 +64,7 @@ type Props = {
64
64
  patternId?: String;
65
65
  barMarginBottom?: number;
66
66
  onPress?: Function;
67
+ xAxisTextNumberOfLines: number;
67
68
  };
68
69
  type itemType = {
69
70
  value?: number;
@@ -112,6 +113,7 @@ const RenderBars = (props: Props) => {
112
113
  autoShiftLabels,
113
114
  label,
114
115
  labelTextStyle,
116
+ xAxisTextNumberOfLines,
115
117
  } = props;
116
118
 
117
119
  const barMarginBottom =
@@ -161,7 +163,7 @@ const RenderBars = (props: Props) => {
161
163
  ) : (
162
164
  <Text
163
165
  style={labelTextStyle || {textAlign: 'center'}}
164
- numberOfLines={1}>
166
+ numberOfLines={xAxisTextNumberOfLines}>
165
167
  {label || ''}
166
168
  </Text>
167
169
  )}
@@ -204,7 +206,7 @@ const RenderBars = (props: Props) => {
204
206
  ) : (
205
207
  <Text
206
208
  style={labelTextStyle || {textAlign: 'center'}}
207
- numberOfLines={1}>
209
+ numberOfLines={xAxisTextNumberOfLines}>
208
210
  {label || ''}
209
211
  </Text>
210
212
  )}
@@ -38,6 +38,7 @@ type Props = {
38
38
  xAxisThickness: number;
39
39
  barBackgroundPattern?: Function;
40
40
  patternId?: String;
41
+ xAxisTextNumberOfLines: number;
41
42
  };
42
43
  type itemType = {
43
44
  value?: number;
@@ -69,6 +70,7 @@ const RenderStackBars = (props: Props) => {
69
70
  xAxisThickness,
70
71
  label,
71
72
  labelTextStyle,
73
+ xAxisTextNumberOfLines,
72
74
  } = props;
73
75
  const disablePress = props.disablePress || false;
74
76
  const renderLabel = (label: String, labelTextStyle: any) => {
@@ -92,7 +94,7 @@ const RenderStackBars = (props: Props) => {
92
94
  {item.labelComponent ? (
93
95
  item.labelComponent()
94
96
  ) : (
95
- <Text style={[labelTextStyle]} numberOfLines={1}>
97
+ <Text style={[labelTextStyle]} numberOfLines={xAxisTextNumberOfLines}>
96
98
  {label || ''}
97
99
  </Text>
98
100
  )}
@@ -47,6 +47,8 @@ type PropTypes = {
47
47
  yAxisLabelContainerStyle?: any;
48
48
  horizontalRulesStyle?: any;
49
49
  yAxisTextStyle?: any;
50
+ yAxisTextNumberOfLines?: number;
51
+ xAxisTextNumberOfLines?: number;
50
52
  yAxisLabelWidth?: number;
51
53
  hideYAxisText?: Boolean;
52
54
  yAxisSide?: string;
@@ -372,6 +374,8 @@ export const BarChart = (props: PropTypes) => {
372
374
  : props.yAxisThickness || 1;
373
375
  const yAxisColor = props.yAxisColor || 'black';
374
376
  const yAxisTextStyle = props.yAxisTextStyle;
377
+ const yAxisTextNumberOfLines = props.yAxisTextNumberOfLines || 1;
378
+ const xAxisTextNumberOfLines = props.xAxisTextNumberOfLines || 1;
375
379
  const yAxisLabelContainerStyle = props.yAxisLabelContainerStyle;
376
380
  const horizontalRulesStyle = props.horizontalRulesStyle;
377
381
  const showFractionalValues = props.showFractionalValues || false;
@@ -768,7 +772,7 @@ export const BarChart = (props: PropTypes) => {
768
772
  yAxisLabelContainerStyle,
769
773
  ]}>
770
774
  <Text
771
- numberOfLines={1}
775
+ numberOfLines={yAxisTextNumberOfLines}
772
776
  ellipsizeMode={'clip'}
773
777
  style={[
774
778
  yAxisTextStyle,
@@ -875,7 +879,7 @@ export const BarChart = (props: PropTypes) => {
875
879
  yAxisLabelContainerStyle,
876
880
  ]}>
877
881
  <Text
878
- numberOfLines={1}
882
+ numberOfLines={yAxisTextNumberOfLines}
879
883
  ellipsizeMode={'clip'}
880
884
  style={[
881
885
  yAxisTextStyle,
@@ -1399,6 +1403,7 @@ export const BarChart = (props: PropTypes) => {
1399
1403
  labelTextStyle={
1400
1404
  item.labelTextStyle || props.xAxisLabelTextStyle
1401
1405
  }
1406
+ xAxisTextNumberOfLines={xAxisTextNumberOfLines}
1402
1407
  />
1403
1408
  );
1404
1409
  })
@@ -1460,6 +1465,7 @@ export const BarChart = (props: PropTypes) => {
1460
1465
  item.labelTextStyle || props.xAxisLabelTextStyle
1461
1466
  }
1462
1467
  onPress={props.onPress}
1468
+ xAxisTextNumberOfLines={xAxisTextNumberOfLines}
1463
1469
  />
1464
1470
  ))}
1465
1471
  </Fragment>
@@ -154,6 +154,8 @@ type propTypes = {
154
154
  yAxisLabelContainerStyle?: any;
155
155
  horizontalRulesStyle?: any;
156
156
  yAxisTextStyle?: any;
157
+ yAxisTextNumberOfLines?: number;
158
+ xAxisTextNumberOfLines?: number;
157
159
  showFractionalValues?: Boolean;
158
160
  roundToDigits?: number;
159
161
  yAxisLabelWidth?: number;
@@ -1386,6 +1388,8 @@ export const LineChart = (props: propTypes) => {
1386
1388
  props.yAxisThickness === 0 ? 0 : props.yAxisThickness || 1;
1387
1389
  const yAxisColor = props.yAxisColor || 'black';
1388
1390
  const yAxisTextStyle = props.yAxisTextStyle;
1391
+ const yAxisTextNumberOfLines = props.yAxisTextNumberOfLines || 1;
1392
+ const xAxisTextNumberOfLines = props.xAxisTextNumberOfLines || 1;
1389
1393
  const yAxisLabelContainerStyle = props.yAxisLabelContainerStyle;
1390
1394
  const horizontalRulesStyle = props.horizontalRulesStyle;
1391
1395
  const showFractionalValues = props.showFractionalValues || false;
@@ -1681,7 +1685,7 @@ export const LineChart = (props: propTypes) => {
1681
1685
  ) : (
1682
1686
  <Text
1683
1687
  style={labelTextStyle || {textAlign: 'center'}}
1684
- numberOfLines={1}>
1688
+ numberOfLines={xAxisTextNumberOfLines}>
1685
1689
  {label || ''}
1686
1690
  </Text>
1687
1691
  )}
@@ -1719,7 +1723,7 @@ export const LineChart = (props: propTypes) => {
1719
1723
  ) : (
1720
1724
  <Text
1721
1725
  style={labelTextStyle || {textAlign: 'center'}}
1722
- numberOfLines={1}>
1726
+ numberOfLines={xAxisTextNumberOfLines}>
1723
1727
  {label || ''}
1724
1728
  </Text>
1725
1729
  )}
@@ -1899,7 +1903,7 @@ export const LineChart = (props: propTypes) => {
1899
1903
  yAxisLabelContainerStyle,
1900
1904
  ]}>
1901
1905
  <Text
1902
- numberOfLines={1}
1906
+ numberOfLines={yAxisTextNumberOfLines}
1903
1907
  ellipsizeMode={'clip'}
1904
1908
  style={[
1905
1909
  yAxisTextStyle,
@@ -2001,7 +2005,7 @@ export const LineChart = (props: propTypes) => {
2001
2005
  yAxisLabelContainerStyle,
2002
2006
  ]}>
2003
2007
  <Text
2004
- numberOfLines={1}
2008
+ numberOfLines={yAxisTextNumberOfLines}
2005
2009
  ellipsizeMode={'clip'}
2006
2010
  style={[
2007
2011
  yAxisTextStyle,
package/src/todos.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Features
2
2
 
3
- 1. Fix the issue- When `activatePointersOnLongPress` is set to true, sometimes, the pointerLabel doesn't vanish after releasing the scroll. It gets stuck.
3
+ 1. Fix the issue with pointers in Line/Area charts on Android https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues/177
4
4
 
5
5
  ## To-dos in documentation-
6
6