From 31c58765984b5c91159f07dd36fa79d3c8b5ca06 Mon Sep 17 00:00:00 2001 From: Farzad Abdolhosseini Date: Sun, 11 Dec 2016 11:35:22 +0330 Subject: [PATCH] added option wordWrap to legend. usage: <*Chart legend={{enabled:true, wordWrap:true}} .../> --- .../cn/mandata/react_native_mpchart/MPBarLineChartManager.java | 1 + .../cn/mandata/react_native_mpchart/MPPieRadarChartManager.java | 1 + 2 files changed, 2 insertions(+) diff --git a/android/src/main/java/cn/mandata/react_native_mpchart/MPBarLineChartManager.java b/android/src/main/java/cn/mandata/react_native_mpchart/MPBarLineChartManager.java index 3c89ec1..d1b2bd2 100644 --- a/android/src/main/java/cn/mandata/react_native_mpchart/MPBarLineChartManager.java +++ b/android/src/main/java/cn/mandata/react_native_mpchart/MPBarLineChartManager.java @@ -338,6 +338,7 @@ public void setLegend(BarLineChartBase chart,ReadableMap v){ if(v.hasKey("direction")) legend.setDirection(Legend.LegendDirection.valueOf(v.getString("direction"))); if(v.hasKey("legendForm")) legend.setForm(Legend.LegendForm.valueOf(v.getString("legendForm"))); + if(v.hasKey("wordWrap")) legend.setWordWrapEnabled(v.getBoolean("wordWrap")); if(v.hasKey("textColor")) legend.setTextColor(Color.parseColor(v.getString("textColor"))); if(v.hasKey("textSize")) legend.setTextSize((float) v.getDouble("textSize")); diff --git a/android/src/main/java/cn/mandata/react_native_mpchart/MPPieRadarChartManager.java b/android/src/main/java/cn/mandata/react_native_mpchart/MPPieRadarChartManager.java index 069e610..c75989d 100644 --- a/android/src/main/java/cn/mandata/react_native_mpchart/MPPieRadarChartManager.java +++ b/android/src/main/java/cn/mandata/react_native_mpchart/MPPieRadarChartManager.java @@ -92,6 +92,7 @@ public void setLegend(PieRadarChartBase chart,ReadableMap v){ if(v.hasKey("direction")) legend.setDirection(Legend.LegendDirection.valueOf(v.getString("direction"))); if(v.hasKey("legendForm")) legend.setForm(Legend.LegendForm.valueOf(v.getString("legendForm"))); + if(v.hasKey("wordWrap")) legend.setWordWrapEnabled(v.getBoolean("wordWrap")); if(v.hasKey("textColor")) legend.setTextColor(Color.parseColor(v.getString("textColor"))); if(v.hasKey("textSize")) legend.setTextSize((float) v.getDouble("textSize"));