Fix issue in legend renderer concerning CandleStickChart legend
diff --git a/MPChartLib/src/com/github/mikephil/charting/renderer/LegendRenderer.java b/MPChartLib/src/com/github/mikephil/charting/renderer/LegendRenderer.java
index 467de05..a9ac981 100644
--- a/MPChartLib/src/com/github/mikephil/charting/renderer/LegendRenderer.java
+++ b/MPChartLib/src/com/github/mikephil/charting/renderer/LegendRenderer.java
@@ -9,6 +9,7 @@
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.data.ChartData;
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
+import com.github.mikephil.charting.interfaces.datasets.ICandleDataSet;
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
import com.github.mikephil.charting.interfaces.datasets.IPieDataSet;
import com.github.mikephil.charting.utils.ColorTemplate;
@@ -124,6 +125,13 @@
labels.add(pds.getLabel());
}
+ } else if(dataSet instanceof ICandleDataSet && ((ICandleDataSet) dataSet).getDecreasingColor() != ColorTemplate.COLOR_NONE) {
+
+ colors.add(((ICandleDataSet) dataSet).getDecreasingColor());
+ colors.add(((ICandleDataSet) dataSet).getIncreasingColor());
+ labels.add(null);
+ labels.add(dataSet.getLabel());
+
} else { // all others
for (int j = 0; j < clrs.size() && j < entryCount; j++) {