@urvish-procare/react-native-charts-wrapper 0.6.0
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/README.md +258 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/MPAndroidChartPackage.java +49 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/BarChartManager.java +46 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/BarLineChartBaseManager.java +415 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/BubbleChartManager.java +32 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/CandleStickChartManager.java +31 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/ChartBaseManager.java +605 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/ChartGroupHolder.java +80 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/CombinedChartManager.java +62 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/ConfigurableMinimumLinePositionFillFormatter.java +19 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/CustomFormatter.java +25 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/DateFormatter.java +34 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/HorizontalBarChartManager.java +23 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/IndexValueFormatter.java +102 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/LabelByXValueFormatter.java +25 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/LineChartManager.java +31 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/PieChartManager.java +147 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/RadarChartManager.java +118 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/ScatterChartManager.java +32 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/charts/YAxisChartBase.java +51 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/BarDataExtract.java +106 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/BubbleDataExtract.java +74 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/CandleDataExtract.java +102 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/CombinedDataExtract.java +70 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/DataExtract.java +77 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/LineDataExtract.java +130 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/PieDataExtract.java +101 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/RadarDataExtract.java +58 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/data/ScatterDataExtract.java +75 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartGestureListener.java +129 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/listener/RNOnChartValueSelectedListener.java +52 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/markers/RNCircleMarkerView.java +19 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/markers/RNRectangleMarkerView.java +134 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/BridgeUtils.java +52 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/ChartDataSetConfigUtils.java +197 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/ConversionUtil.java +144 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/DrawableUtils.java +51 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/EasingFunctionHelper.java +128 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/EntryToWritableMapUtils.java +147 -0
- package/android/src/main/java/com/github/wuxudong/rncharts/utils/TypefaceUtils.java +47 -0
- package/android/src/main/res/drawable-nodpi/circle_marker.xml +8 -0
- package/android/src/main/res/drawable-nodpi/oval_marker.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker.9.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker_left.9.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker_right.9.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker_top.9.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker_top_left.9.png +0 -0
- package/android/src/main/res/drawable-nodpi/rectangle_marker_top_right.9.png +0 -0
- package/android/src/main/res/layout/circle_marker.xml +13 -0
- package/android/src/main/res/layout/oval_marker.xml +24 -0
- package/android/src/main/res/layout/rectangle_marker.xml +21 -0
- package/index.js +21 -0
- package/ios/ReactNativeCharts/BalloonMarker.swift +240 -0
- package/ios/ReactNativeCharts/ChartGroupHolder.swift +70 -0
- package/ios/ReactNativeCharts/CircleMarker.swift +108 -0
- package/ios/ReactNativeCharts/ConfigurableMinimumLinePositionFillFormatter.swift +19 -0
- package/ios/ReactNativeCharts/CustomChartDateFormatter.swift +64 -0
- package/ios/ReactNativeCharts/DataExtract.swift +80 -0
- package/ios/ReactNativeCharts/IndexValueFormatter.swift +49 -0
- package/ios/ReactNativeCharts/RNBarLineChartBaseManager.swift +115 -0
- package/ios/ReactNativeCharts/RNBarLineChartManagerBridge.h +40 -0
- package/ios/ReactNativeCharts/RNBarLineChartViewBase.swift +294 -0
- package/ios/ReactNativeCharts/RNChartManagerBridge.h +36 -0
- package/ios/ReactNativeCharts/RNChartViewBase.swift +593 -0
- package/ios/ReactNativeCharts/RNCharts-Bridging-Header.h +9 -0
- package/ios/ReactNativeCharts/RNYAxisChartManagerBridge.h +17 -0
- package/ios/ReactNativeCharts/RNYAxisChartViewBase.swift +53 -0
- package/ios/ReactNativeCharts/ReactNativeCharts.xcodeproj/project.pbxproj +376 -0
- package/ios/ReactNativeCharts/bar/BarDataExtract.swift +89 -0
- package/ios/ReactNativeCharts/bar/RNBarChartManager.swift +53 -0
- package/ios/ReactNativeCharts/bar/RNBarChartManagerBridge.m +17 -0
- package/ios/ReactNativeCharts/bar/RNBarChartView.swift +41 -0
- package/ios/ReactNativeCharts/bar/RNBarChartViewBase.swift +27 -0
- package/ios/ReactNativeCharts/bar/RNHorizontalBarChartManager.swift +45 -0
- package/ios/ReactNativeCharts/bar/RNHorizontalBarChartManagerBridge.m +16 -0
- package/ios/ReactNativeCharts/bar/RNHorizontalBarChartView.swift +41 -0
- package/ios/ReactNativeCharts/bubble/BubbleDataExtract.swift +61 -0
- package/ios/ReactNativeCharts/bubble/RNBubbleChartManager.swift +53 -0
- package/ios/ReactNativeCharts/bubble/RNBubbleChartManagerBridge.m +15 -0
- package/ios/ReactNativeCharts/bubble/RNBubbleChartView.swift +39 -0
- package/ios/ReactNativeCharts/candlestick/CandleDataExtract.swift +101 -0
- package/ios/ReactNativeCharts/candlestick/RNCandleStickChartManager.swift +53 -0
- package/ios/ReactNativeCharts/candlestick/RNCandleStickChartManagerBridge.m +16 -0
- package/ios/ReactNativeCharts/candlestick/RNCandleStickChartView.swift +44 -0
- package/ios/ReactNativeCharts/combine/CombinedDataExtract.swift +81 -0
- package/ios/ReactNativeCharts/combine/RNCombinedChartManager.swift +53 -0
- package/ios/ReactNativeCharts/combine/RNCombinedChartManagerBridge.m +19 -0
- package/ios/ReactNativeCharts/combine/RNCombinedChartView.swift +61 -0
- package/ios/ReactNativeCharts/formatters/ChartDateFormatter.swift +38 -0
- package/ios/ReactNativeCharts/formatters/LabelByXValueFormatter.swift +35 -0
- package/ios/ReactNativeCharts/formatters/LargeValueFormatter.swift +72 -0
- package/ios/ReactNativeCharts/line/LineDataExtract.swift +178 -0
- package/ios/ReactNativeCharts/line/RNLineChartManager.swift +53 -0
- package/ios/ReactNativeCharts/line/RNLineChartManagerBridge.m +14 -0
- package/ios/ReactNativeCharts/line/RNLineChartView.swift +41 -0
- package/ios/ReactNativeCharts/pie/PieDataExtract.swift +97 -0
- package/ios/ReactNativeCharts/pie/RNPieChartManager.swift +19 -0
- package/ios/ReactNativeCharts/pie/RNPieChartManagerBridge.m +30 -0
- package/ios/ReactNativeCharts/pie/RNPieChartView.swift +192 -0
- package/ios/ReactNativeCharts/radar/RNRadarChartManager.swift +19 -0
- package/ios/ReactNativeCharts/radar/RNRadarChartManagerBridge.m +25 -0
- package/ios/ReactNativeCharts/radar/RNRadarChartView.swift +99 -0
- package/ios/ReactNativeCharts/radar/RadarDataExtract.swift +50 -0
- package/ios/ReactNativeCharts/scatter/RNScatterChartManager.swift +53 -0
- package/ios/ReactNativeCharts/scatter/RNScatterChartManagerBridge.m +15 -0
- package/ios/ReactNativeCharts/scatter/RNScatterChartView.swift +43 -0
- package/ios/ReactNativeCharts/scatter/ScatterDataExtract.swift +76 -0
- package/ios/ReactNativeCharts/utils/BridgeUtils.swift +333 -0
- package/ios/ReactNativeCharts/utils/ChartDataSetConfigUtils.swift +147 -0
- package/ios/ReactNativeCharts/utils/EntryToDictionaryUtils.swift +66 -0
- package/ios/ReactNativeCharts/utils/FontUtils.swift +29 -0
- package/ios/ReactNativeCharts/utils/HighlightUtils.swift +41 -0
- package/lib/AxisIface.js +102 -0
- package/lib/BarChart.js +43 -0
- package/lib/BarLineChartBase.js +86 -0
- package/lib/BubbleChart.js +40 -0
- package/lib/CandleStickChart.js +40 -0
- package/lib/ChartBase.js +131 -0
- package/lib/ChartDataConfig.js +263 -0
- package/lib/ChartDataSetConfig.js +80 -0
- package/lib/CombinedChart.js +43 -0
- package/lib/HighlightEnhancer.js +15 -0
- package/lib/HorizontalBarChart.js +43 -0
- package/lib/LineChart.js +39 -0
- package/lib/MoveEnhancer.js +49 -0
- package/lib/PieChart.js +64 -0
- package/lib/PieRadarChartBase.js +18 -0
- package/lib/RadarChart.js +52 -0
- package/lib/ScaleEnhancer.js +16 -0
- package/lib/ScatterChart.js +38 -0
- package/lib/ScrollEnhancer.js +15 -0
- package/package.json +40 -0
- package/react-native-charts-wrapper.podspec +26 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
7
|
+
import com.github.mikephil.charting.charts.CombinedChart;
|
|
8
|
+
import com.github.mikephil.charting.data.Entry;
|
|
9
|
+
import com.github.wuxudong.rncharts.data.CombinedDataExtract;
|
|
10
|
+
import com.github.wuxudong.rncharts.data.DataExtract;
|
|
11
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
12
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
13
|
+
|
|
14
|
+
import java.util.ArrayList;
|
|
15
|
+
import java.util.List;
|
|
16
|
+
|
|
17
|
+
public class CombinedChartManager extends BarLineChartBaseManager<CombinedChart, Entry> {
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
public String getName() {
|
|
21
|
+
return "RNCombinedChart";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
protected CombinedChart createViewInstance(ThemedReactContext reactContext) {
|
|
26
|
+
CombinedChart combinedChart = new CombinedChart(reactContext);
|
|
27
|
+
combinedChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(combinedChart));
|
|
28
|
+
combinedChart.setOnChartGestureListener(new RNOnChartGestureListener(combinedChart));
|
|
29
|
+
return combinedChart;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ReactProp(name = "drawOrder")
|
|
33
|
+
public void setDrawOrder(CombinedChart chart, ReadableArray array) {
|
|
34
|
+
List<CombinedChart.DrawOrder> orders = new ArrayList<>();
|
|
35
|
+
|
|
36
|
+
for (int i = 0; i < array.size(); i++) {
|
|
37
|
+
orders.add(CombinedChart.DrawOrder.valueOf(array.getString(i)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
chart.setDrawOrder(orders.toArray(new CombinedChart.DrawOrder[orders.size()]));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactProp(name = "drawValueAboveBar")
|
|
44
|
+
public void setDrawValueAboveBar(CombinedChart chart, boolean enabled) {
|
|
45
|
+
chart.setDrawValueAboveBar(enabled);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactProp(name = "drawBarShadow")
|
|
49
|
+
public void setDrawBarShadow(CombinedChart chart, boolean enabled) {
|
|
50
|
+
chart.setDrawBarShadow(enabled);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactProp(name = "highlightFullBarEnabled")
|
|
54
|
+
public void setHighlightFullBarEnabled(CombinedChart chart, boolean enabled) {
|
|
55
|
+
chart.setHighlightFullBarEnabled(enabled);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@Override
|
|
59
|
+
DataExtract getDataExtract() {
|
|
60
|
+
return new CombinedDataExtract();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.github.mikephil.charting.formatter.IFillFormatter;
|
|
4
|
+
import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider;
|
|
5
|
+
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
|
|
6
|
+
|
|
7
|
+
public class ConfigurableMinimumLinePositionFillFormatter implements IFillFormatter {
|
|
8
|
+
private final float min;
|
|
9
|
+
|
|
10
|
+
public ConfigurableMinimumLinePositionFillFormatter(float min) {
|
|
11
|
+
|
|
12
|
+
this.min = min;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
|
|
17
|
+
return min;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.github.mikephil.charting.components.AxisBase;
|
|
4
|
+
import com.github.mikephil.charting.data.Entry;
|
|
5
|
+
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
|
|
6
|
+
import com.github.mikephil.charting.formatter.IValueFormatter;
|
|
7
|
+
import com.github.mikephil.charting.formatter.ValueFormatter;
|
|
8
|
+
import com.github.mikephil.charting.utils.ViewPortHandler;
|
|
9
|
+
|
|
10
|
+
import java.text.DecimalFormat;
|
|
11
|
+
|
|
12
|
+
public class CustomFormatter extends ValueFormatter {
|
|
13
|
+
|
|
14
|
+
private DecimalFormat mFormat;
|
|
15
|
+
|
|
16
|
+
public CustomFormatter(String value) {
|
|
17
|
+
mFormat = new DecimalFormat(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public String getFormattedValue(float value) {
|
|
22
|
+
return mFormat.format(value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.github.mikephil.charting.formatter.ValueFormatter;
|
|
4
|
+
|
|
5
|
+
import java.text.DateFormat;
|
|
6
|
+
import java.text.SimpleDateFormat;
|
|
7
|
+
import java.util.Date;
|
|
8
|
+
import java.util.concurrent.TimeUnit;
|
|
9
|
+
import java.util.Locale;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Created by dougl on 05/09/2017.
|
|
13
|
+
*/
|
|
14
|
+
public class DateFormatter extends ValueFormatter {
|
|
15
|
+
|
|
16
|
+
private DateFormat mFormat;
|
|
17
|
+
|
|
18
|
+
private long since = 0;
|
|
19
|
+
|
|
20
|
+
private TimeUnit timeUnit;
|
|
21
|
+
|
|
22
|
+
public DateFormatter(String pattern, long since, TimeUnit timeUnit, Locale locale) {
|
|
23
|
+
mFormat = new SimpleDateFormat(pattern, locale);
|
|
24
|
+
|
|
25
|
+
this.since = since;
|
|
26
|
+
|
|
27
|
+
this.timeUnit = timeUnit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public String getFormattedValue(float value) {
|
|
32
|
+
return mFormat.format(new Date(since + timeUnit.toMillis((long) value)));
|
|
33
|
+
}
|
|
34
|
+
}
|
package/android/src/main/java/com/github/wuxudong/rncharts/charts/HorizontalBarChartManager.java
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
4
|
+
import com.github.mikephil.charting.charts.BarChart;
|
|
5
|
+
import com.github.mikephil.charting.charts.HorizontalBarChart;
|
|
6
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
7
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
8
|
+
|
|
9
|
+
public class HorizontalBarChartManager extends BarChartManager {
|
|
10
|
+
|
|
11
|
+
@Override
|
|
12
|
+
public String getName() {
|
|
13
|
+
return "RNHorizontalBarChart";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
protected BarChart createViewInstance(ThemedReactContext reactContext) {
|
|
18
|
+
HorizontalBarChart horizontalBarChart = new HorizontalBarChart(reactContext);
|
|
19
|
+
horizontalBarChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(horizontalBarChart));
|
|
20
|
+
horizontalBarChart.setOnChartGestureListener(new RNOnChartGestureListener(horizontalBarChart));
|
|
21
|
+
return horizontalBarChart;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.github.mikephil.charting.data.BarEntry;
|
|
4
|
+
import com.github.mikephil.charting.data.BubbleEntry;
|
|
5
|
+
import com.github.mikephil.charting.data.CandleEntry;
|
|
6
|
+
import com.github.mikephil.charting.data.Entry;
|
|
7
|
+
import com.github.mikephil.charting.data.PieEntry;
|
|
8
|
+
import com.github.mikephil.charting.data.RadarEntry;
|
|
9
|
+
import com.github.mikephil.charting.formatter.ValueFormatter;
|
|
10
|
+
|
|
11
|
+
import java.util.Collection;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This formatter is used for passing an array of x-axis labels, on whole x steps.
|
|
15
|
+
*/
|
|
16
|
+
public class IndexValueFormatter extends ValueFormatter {
|
|
17
|
+
private String[] mValues = new String[]{};
|
|
18
|
+
private int mValueCount = 0;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An empty constructor.
|
|
22
|
+
* Use `setValues` to set the axis labels.
|
|
23
|
+
*/
|
|
24
|
+
public IndexValueFormatter() {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Constructor that specifies value labels.
|
|
29
|
+
*
|
|
30
|
+
* @param values The values string array
|
|
31
|
+
*/
|
|
32
|
+
public IndexValueFormatter(String[] values) {
|
|
33
|
+
if (values != null)
|
|
34
|
+
setValues(values);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Constructor that specifies value labels.
|
|
39
|
+
*
|
|
40
|
+
* @param values The values string array
|
|
41
|
+
*/
|
|
42
|
+
public IndexValueFormatter(Collection<String> values) {
|
|
43
|
+
if (values != null)
|
|
44
|
+
setValues(values.toArray(new String[values.size()]));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public String[] getValues() {
|
|
48
|
+
return mValues;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public void setValues(String[] values) {
|
|
52
|
+
if (values == null)
|
|
53
|
+
values = new String[]{};
|
|
54
|
+
|
|
55
|
+
this.mValues = values;
|
|
56
|
+
this.mValueCount = values.length;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@Override
|
|
60
|
+
public String getBarLabel(BarEntry barEntry) {
|
|
61
|
+
return getFormattedValue(barEntry);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@Override
|
|
65
|
+
public String getBarStackedLabel(float value, BarEntry stackedEntry) {
|
|
66
|
+
return getFormattedValue(stackedEntry);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
public String getPointLabel(Entry entry) {
|
|
71
|
+
return getFormattedValue(entry);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Override
|
|
75
|
+
public String getPieLabel(float value, PieEntry pieEntry) {
|
|
76
|
+
return getFormattedValue(pieEntry);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@Override
|
|
80
|
+
public String getRadarLabel(RadarEntry radarEntry) {
|
|
81
|
+
return getFormattedValue(radarEntry);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@Override
|
|
85
|
+
public String getBubbleLabel(BubbleEntry bubbleEntry) {
|
|
86
|
+
return getFormattedValue(bubbleEntry);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@Override
|
|
90
|
+
public String getCandleLabel(CandleEntry candleEntry) {
|
|
91
|
+
return getFormattedValue(candleEntry);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private String getFormattedValue(Entry entry) {
|
|
95
|
+
int index = Math.round(entry.getX());
|
|
96
|
+
|
|
97
|
+
if (index < 0 || index >= mValueCount || index != (int) entry.getX())
|
|
98
|
+
return "";
|
|
99
|
+
|
|
100
|
+
return mValues[index];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.github.mikephil.charting.data.Entry;
|
|
4
|
+
import com.github.mikephil.charting.formatter.ValueFormatter;
|
|
5
|
+
|
|
6
|
+
import java.util.Map;
|
|
7
|
+
|
|
8
|
+
public class LabelByXValueFormatter extends ValueFormatter {
|
|
9
|
+
private Map<Float, String> labelsByXValue;
|
|
10
|
+
|
|
11
|
+
public LabelByXValueFormatter(Map<Float, String> labelsByXValue) {
|
|
12
|
+
this.labelsByXValue = labelsByXValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public String getFormattedValue(float value) {
|
|
17
|
+
String label = this.labelsByXValue.get(Float.valueOf(value));
|
|
18
|
+
return (label != null) ? label : "";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public String getPointLabel(Entry entry) {
|
|
23
|
+
return this.getFormattedValue(entry.getX());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
+
import com.github.mikephil.charting.charts.LineChart;
|
|
6
|
+
import com.github.mikephil.charting.data.Entry;
|
|
7
|
+
import com.github.wuxudong.rncharts.data.DataExtract;
|
|
8
|
+
import com.github.wuxudong.rncharts.data.LineDataExtract;
|
|
9
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
10
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
11
|
+
|
|
12
|
+
public class LineChartManager extends BarLineChartBaseManager<LineChart, Entry> {
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
public String getName() {
|
|
16
|
+
return "RNLineChart";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
protected LineChart createViewInstance(ThemedReactContext reactContext) {
|
|
21
|
+
LineChart lineChart = new LineChart(reactContext);
|
|
22
|
+
lineChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(lineChart));
|
|
23
|
+
lineChart.setOnChartGestureListener(new RNOnChartGestureListener(lineChart));
|
|
24
|
+
return lineChart;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@Override
|
|
28
|
+
DataExtract getDataExtract() {
|
|
29
|
+
return new LineDataExtract();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
4
|
+
import com.facebook.react.bridge.ReadableType;
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
6
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
7
|
+
import com.github.mikephil.charting.charts.PieChart;
|
|
8
|
+
import com.github.mikephil.charting.data.PieEntry;
|
|
9
|
+
import com.github.wuxudong.rncharts.data.DataExtract;
|
|
10
|
+
import com.github.wuxudong.rncharts.data.PieDataExtract;
|
|
11
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
12
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
13
|
+
import com.github.wuxudong.rncharts.utils.BridgeUtils;
|
|
14
|
+
import com.github.wuxudong.rncharts.utils.TypefaceUtils;
|
|
15
|
+
|
|
16
|
+
public class PieChartManager extends ChartBaseManager<PieChart, PieEntry> {
|
|
17
|
+
|
|
18
|
+
@Override
|
|
19
|
+
public String getName() {
|
|
20
|
+
return "RNPieChart";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
protected PieChart createViewInstance(ThemedReactContext reactContext) {
|
|
25
|
+
PieChart pieChart = new PieChart(reactContext);
|
|
26
|
+
pieChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(pieChart));
|
|
27
|
+
pieChart.setOnChartGestureListener(new RNOnChartGestureListener(pieChart));
|
|
28
|
+
return pieChart;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Override
|
|
32
|
+
DataExtract getDataExtract() {
|
|
33
|
+
return new PieDataExtract();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@ReactProp(name = "extraOffsets")
|
|
37
|
+
public void setExtraOffsets(PieChart chart, ReadableMap propMap) {
|
|
38
|
+
double left = 0, top = 0, right = 0, bottom = 0;
|
|
39
|
+
|
|
40
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "left")) {
|
|
41
|
+
left = propMap.getDouble("left");
|
|
42
|
+
}
|
|
43
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "top")) {
|
|
44
|
+
top = propMap.getDouble("top");
|
|
45
|
+
}
|
|
46
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "right")) {
|
|
47
|
+
right = propMap.getDouble("right");
|
|
48
|
+
}
|
|
49
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "bottom")) {
|
|
50
|
+
bottom = propMap.getDouble("bottom");
|
|
51
|
+
}
|
|
52
|
+
chart.setExtraOffsets((float) left, (float) top, (float) right, (float) bottom);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@ReactProp(name = "drawEntryLabels")
|
|
56
|
+
public void setDrawEntryLabels(PieChart chart, boolean enabled) {
|
|
57
|
+
chart.setDrawEntryLabels(enabled);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@ReactProp(name = "usePercentValues")
|
|
61
|
+
public void setUsePercentValues(PieChart chart, boolean enabled) {
|
|
62
|
+
chart.setUsePercentValues(enabled);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@ReactProp(name = "centerText")
|
|
66
|
+
public void setCenterText(PieChart chart, String text) {
|
|
67
|
+
chart.setCenterText(text);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@ReactProp(name = "styledCenterText")
|
|
71
|
+
public void setStyledCenterText(PieChart chart, ReadableMap propMap) {
|
|
72
|
+
if (BridgeUtils.validate(propMap, ReadableType.String, "text")) {
|
|
73
|
+
chart.setCenterText(propMap.getString("text"));
|
|
74
|
+
} else {
|
|
75
|
+
chart.setCenterText("");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "color")) {
|
|
79
|
+
chart.setCenterTextColor(propMap.getInt("color"));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "size")) {
|
|
83
|
+
chart.setCenterTextSize((float) propMap.getDouble("size"));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (BridgeUtils.validate(propMap, ReadableType.String, "fontFamily")) {
|
|
87
|
+
chart.setCenterTextTypeface(TypefaceUtils.getTypeface(chart, propMap));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@ReactProp(name = "centerTextRadiusPercent")
|
|
92
|
+
public void setCenterTextRadiusPercent(PieChart chart, float radiusPercent) {
|
|
93
|
+
chart.setCenterTextRadiusPercent(radiusPercent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@ReactProp(name = "holeRadius")
|
|
97
|
+
public void setHoleRadius(PieChart chart, float percent) {
|
|
98
|
+
chart.setHoleRadius(percent);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@ReactProp(name = "holeColor")
|
|
102
|
+
public void setHoleColor(PieChart chart, Integer color) {
|
|
103
|
+
chart.setHoleColor(color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@ReactProp(name = "transparentCircleRadius")
|
|
107
|
+
public void setTransparentCircleRadius(PieChart chart, float percent) {
|
|
108
|
+
chart.setTransparentCircleRadius(percent);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@ReactProp(name = "transparentCircleColor")
|
|
112
|
+
public void setTransparentCircleColor(PieChart chart, Integer color) {
|
|
113
|
+
chart.setTransparentCircleColor(color);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@ReactProp(name = "entryLabelColor")
|
|
117
|
+
public void setEntryLabelColor(PieChart chart, Integer color) {
|
|
118
|
+
chart.setEntryLabelColor(color);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@ReactProp(name = "entryLabelTextSize")
|
|
122
|
+
public void setEntryLabelTextSize(PieChart chart, float size) {
|
|
123
|
+
chart.setEntryLabelTextSize(size);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@ReactProp(name = "entryLabelFontFamily")
|
|
127
|
+
public void setEntryLabelFontFamily(PieChart chart, String fontFamily) {
|
|
128
|
+
chart.setEntryLabelTypeface(TypefaceUtils.getTypeface(chart, fontFamily));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@ReactProp(name = "maxAngle")
|
|
132
|
+
public void setMaxAngle(PieChart chart, float maxAngle) {
|
|
133
|
+
chart.setMaxAngle(maxAngle);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@ReactProp(name = "rotationEnabled")
|
|
137
|
+
public void setRotationEnabled(PieChart chart, boolean enabled) {
|
|
138
|
+
chart.setRotationEnabled(enabled);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@ReactProp(name = "rotationAngle")
|
|
142
|
+
public void setRotationAngle(PieChart chart, float angle) {
|
|
143
|
+
chart.setRotationAngle(angle);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
5
|
+
import com.facebook.react.bridge.ReadableType;
|
|
6
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
7
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
8
|
+
import com.github.mikephil.charting.charts.Chart;
|
|
9
|
+
import com.github.mikephil.charting.charts.RadarChart;
|
|
10
|
+
import com.github.mikephil.charting.components.YAxis;
|
|
11
|
+
import com.github.mikephil.charting.data.RadarEntry;
|
|
12
|
+
import com.github.wuxudong.rncharts.data.DataExtract;
|
|
13
|
+
import com.github.wuxudong.rncharts.data.RadarDataExtract;
|
|
14
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
15
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
16
|
+
import com.github.wuxudong.rncharts.utils.BridgeUtils;
|
|
17
|
+
|
|
18
|
+
public class RadarChartManager extends YAxisChartBase<RadarChart, RadarEntry> {
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public String getName() {
|
|
22
|
+
return "RNRadarChart";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
protected RadarChart createViewInstance(ThemedReactContext reactContext) {
|
|
27
|
+
RadarChart radarChart = new RadarChart(reactContext);
|
|
28
|
+
radarChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(radarChart));
|
|
29
|
+
radarChart.setOnChartGestureListener(new RNOnChartGestureListener(radarChart));
|
|
30
|
+
return radarChart;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
DataExtract getDataExtract() {
|
|
35
|
+
return new RadarDataExtract();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@Override
|
|
39
|
+
public void setYAxis(Chart chart, ReadableMap propMap) {
|
|
40
|
+
RadarChart radarChart = (RadarChart) chart;
|
|
41
|
+
YAxis axis = radarChart.getYAxis();
|
|
42
|
+
|
|
43
|
+
setCommonAxisConfig(chart, axis, propMap);
|
|
44
|
+
setYAxisConfig(axis, propMap);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ReactProp(name = "skipWebLineCount")
|
|
48
|
+
public void setSkipWebLineCount(RadarChart chart, int count) {
|
|
49
|
+
chart.setSkipWebLineCount(count);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@ReactProp(name = "webLineWidth")
|
|
53
|
+
public void setWebLineWidth(RadarChart chart, float width) {
|
|
54
|
+
chart.setWebLineWidth(width);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@ReactProp(name = "webLineWidthInner")
|
|
58
|
+
public void setWebLineWidthInner(RadarChart chart, float width) {
|
|
59
|
+
chart.setWebLineWidthInner(width);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@ReactProp(name = "webAlpha")
|
|
63
|
+
public void setWebAlpha(RadarChart chart, int alpha) {
|
|
64
|
+
chart.setWebAlpha(alpha);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@ReactProp(name = "webColor")
|
|
68
|
+
public void setWebColor(RadarChart chart, int color) {
|
|
69
|
+
chart.setWebColor(color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@ReactProp(name = "webColorInner")
|
|
74
|
+
public void setWebColorInner(RadarChart chart, int color) {
|
|
75
|
+
chart.setWebColorInner(color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@ReactProp(name = "drawWeb")
|
|
79
|
+
public void setDrawWeb(RadarChart chart, boolean enabled) {
|
|
80
|
+
chart.setDrawWeb(enabled);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@ReactProp(name = "minOffset")
|
|
84
|
+
public void setMinOffset(RadarChart chart, float minOffset) {
|
|
85
|
+
chart.setMinOffset(minOffset);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@ReactProp(name = "extraOffsets")
|
|
89
|
+
public void setExtraOffsets(RadarChart chart, ReadableMap propMap) {
|
|
90
|
+
double left = 0, top = 0, right = 0, bottom = 0;
|
|
91
|
+
|
|
92
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "left")) {
|
|
93
|
+
left = propMap.getDouble("left");
|
|
94
|
+
}
|
|
95
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "top")) {
|
|
96
|
+
top = propMap.getDouble("top");
|
|
97
|
+
}
|
|
98
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "right")) {
|
|
99
|
+
right = propMap.getDouble("right");
|
|
100
|
+
}
|
|
101
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "bottom")) {
|
|
102
|
+
bottom = propMap.getDouble("bottom");
|
|
103
|
+
}
|
|
104
|
+
chart.setExtraOffsets((float) left, (float) top, (float) right, (float) bottom);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@ReactProp(name = "rotationEnabled")
|
|
108
|
+
public void setRotationEnabled(RadarChart chart, boolean enabled) {
|
|
109
|
+
chart.setRotationEnabled(enabled);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@ReactProp(name = "rotationAngle")
|
|
113
|
+
public void setRotationAngle(RadarChart chart, float angle) {
|
|
114
|
+
chart.setRotationAngle(angle);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
+
import com.github.mikephil.charting.charts.ScatterChart;
|
|
6
|
+
import com.github.mikephil.charting.data.Entry;
|
|
7
|
+
import com.github.wuxudong.rncharts.data.DataExtract;
|
|
8
|
+
import com.github.wuxudong.rncharts.data.ScatterDataExtract;
|
|
9
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartGestureListener;
|
|
10
|
+
import com.github.wuxudong.rncharts.listener.RNOnChartValueSelectedListener;
|
|
11
|
+
|
|
12
|
+
public class ScatterChartManager extends BarLineChartBaseManager<ScatterChart, Entry> {
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
public String getName() {
|
|
16
|
+
return "RNScatterChart";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
protected ScatterChart createViewInstance(ThemedReactContext reactContext) {
|
|
21
|
+
ScatterChart scatterChart = new ScatterChart(reactContext);
|
|
22
|
+
scatterChart.setOnChartValueSelectedListener(new RNOnChartValueSelectedListener(scatterChart));
|
|
23
|
+
scatterChart.setOnChartGestureListener(new RNOnChartGestureListener(scatterChart));
|
|
24
|
+
return scatterChart;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@Override
|
|
29
|
+
DataExtract getDataExtract() {
|
|
30
|
+
return new ScatterDataExtract();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
package com.github.wuxudong.rncharts.charts;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
4
|
+
import com.facebook.react.bridge.ReadableType;
|
|
5
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
6
|
+
import com.github.mikephil.charting.charts.Chart;
|
|
7
|
+
import com.github.mikephil.charting.components.YAxis;
|
|
8
|
+
import com.github.mikephil.charting.data.Entry;
|
|
9
|
+
import com.github.wuxudong.rncharts.utils.BridgeUtils;
|
|
10
|
+
|
|
11
|
+
public abstract class YAxisChartBase<T extends Chart, U extends Entry> extends ChartBaseManager<T, U> {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* yAxis config details: https://github.com/PhilJay/MPAndroidChart/wiki/YAxis
|
|
15
|
+
*/
|
|
16
|
+
@ReactProp(name = "yAxis")
|
|
17
|
+
public abstract void setYAxis(Chart chart, ReadableMap propMap);
|
|
18
|
+
|
|
19
|
+
protected void setYAxisConfig(YAxis axis, ReadableMap propMap) {
|
|
20
|
+
|
|
21
|
+
if (BridgeUtils.validate(propMap, ReadableType.Boolean, "inverted")) {
|
|
22
|
+
axis.setInverted(propMap.getBoolean("inverted"));
|
|
23
|
+
}
|
|
24
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "spaceTop")) {
|
|
25
|
+
axis.setSpaceTop((float) propMap.getDouble("spaceTop"));
|
|
26
|
+
}
|
|
27
|
+
if (BridgeUtils.validate(propMap, ReadableType.Number, "spaceBottom")) {
|
|
28
|
+
axis.setSpaceBottom((float) propMap.getDouble("spaceBottom"));
|
|
29
|
+
}
|
|
30
|
+
if (BridgeUtils.validate(propMap, ReadableType.String, "position")) {
|
|
31
|
+
axis.setPosition(YAxis.YAxisLabelPosition.valueOf(propMap.getString("position")));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// TODO docs says the remaining config needs to be applied before setting data. Test it
|
|
35
|
+
// zero line
|
|
36
|
+
if (BridgeUtils.validate(propMap, ReadableType.Map, "zeroLine")) {
|
|
37
|
+
ReadableMap zeroLineConfig = propMap.getMap("zeroLine");
|
|
38
|
+
|
|
39
|
+
if (BridgeUtils.validate(zeroLineConfig, ReadableType.Boolean, "enabled")) {
|
|
40
|
+
axis.setDrawZeroLine(zeroLineConfig.getBoolean("enabled"));
|
|
41
|
+
}
|
|
42
|
+
if (BridgeUtils.validate(zeroLineConfig, ReadableType.Number, "lineWidth")) {
|
|
43
|
+
axis.setZeroLineWidth((float) zeroLineConfig.getDouble("lineWidth"));
|
|
44
|
+
}
|
|
45
|
+
if (BridgeUtils.validate(zeroLineConfig, ReadableType.Number, "lineColor")) {
|
|
46
|
+
axis.setZeroLineColor(zeroLineConfig.getInt("lineColor"));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|