Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/catching up to ios #4787

Merged
merged 27 commits into from
Jan 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
95027fa
Safe guards
danielgindi Jan 22, 2020
6ebf3fa
Added highlightColor parameter for pie charts
danielgindi Jan 22, 2020
1987d7e
Consider axis dependency in Combined chart
danielgindi Jan 22, 2020
634a690
Added an implementation of Douglas Peucker with resultCount input
danielgindi Jan 22, 2020
a4ca1f3
Fixed axis label disappearing when zooming in
danielgindi Jan 22, 2020
2e725e4
Make min/max axis labels configurable
danielgindi Jan 22, 2020
3f54750
Avoid race condition for interval/intervalMagnitude
danielgindi Jan 22, 2020
912427e
Custom text alignment for no-data
danielgindi Jan 22, 2020
4549ae1
Select correct axis for legend distance calculation in horz bar chart
danielgindi Jan 22, 2020
bafb0fb
Use correct color index for bubble chart
danielgindi Jan 22, 2020
ea816e8
Added dataIndex param for highlightValue (combined charts)
danielgindi Jan 22, 2020
34c3cea
Reset min/max when clearing ChartDataSet
danielgindi Jan 22, 2020
8df9eda
Call notifyDataChanged for an opportunity for subclasses
danielgindi Jan 22, 2020
4ce14e6
Add a warning message if pie chart has more than one data set
danielgindi Jan 22, 2020
58545bb
Add option to disable clipping data to contentRect
danielgindi Jan 22, 2020
7752efe
Support for labelXOffset for YAxis label
danielgindi Jan 22, 2020
ae59e7a
This is for the inline bubble selection
danielgindi Jan 22, 2020
c97c8d2
Fixed index out of bounds issue when using stacked bar chart
danielgindi Jan 22, 2020
13aee59
Improve min/max calculation
danielgindi Jan 22, 2020
fcc5af7
Call onChartScale listener after double-tap-zoom
danielgindi Jan 22, 2020
e02e9be
Multiple colors for valueline
danielgindi Jan 22, 2020
14456f4
Renamed values -> entries for consistency
danielgindi Jan 22, 2020
45240c3
Improved negative offset for horz bar chart
danielgindi Jan 22, 2020
34fefd2
maxHeight didn't account for the last label
danielgindi Jan 23, 2020
0668d30
Fixed a bug where a pie slice without highlight enabled is hidden
danielgindi Jan 23, 2020
1de836a
Remove unexpected dash line during linear animation
danielgindi Jan 23, 2020
5e4a32e
Corrected check for line in vertical bounds
danielgindi Jan 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added highlightColor parameter for pie charts
  • Loading branch information
danielgindi committed Jan 22, 2020
commit 6ebf3fa57a2d3ae0a7c7cf57dfd7a31aa1758dab
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

import com.github.mikephil.charting.interfaces.datasets.IPieDataSet;
import com.github.mikephil.charting.utils.Utils;
import android.support.annotation.Nullable;

import java.util.ArrayList;
import java.util.List;
@@ -29,6 +30,7 @@ public class PieDataSet extends DataSet<PieEntry> implements IPieDataSet {
private float mValueLinePart1Length = 0.3f;
private float mValueLinePart2Length = 0.4f;
private boolean mValueLineVariableLength = true;
private Integer mHighlightColor = null;

public PieDataSet(List<PieEntry> yVals, String label) {
super(yVals, label);
@@ -218,6 +220,21 @@ public void setValueLineVariableLength(boolean valueLineVariableLength) {
this.mValueLineVariableLength = valueLineVariableLength;
}

/** Gets the color for the highlighted sector */
@Override
@Nullable
public Integer getHighlightColor()
{
return mHighlightColor;
}

/** Sets the color for the highlighted sector (null for using entry color) */
public void setHighlightColor(@Nullable Integer color)
{
this.mHighlightColor = color;
}


public enum ValuePosition {
INSIDE_SLICE,
OUTSIDE_SLICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.mikephil.charting.interfaces.datasets;

import android.support.annotation.Nullable;

import com.github.mikephil.charting.data.PieDataSet;
import com.github.mikephil.charting.data.PieEntry;

@@ -70,5 +72,11 @@ public interface IPieDataSet extends IDataSet<PieEntry> {
* */
boolean isValueLineVariableLength();

/**
* Gets the color for the highlighted sector
* */
@Nullable
Integer getHighlightColor();

}

Original file line number Diff line number Diff line change
@@ -857,7 +857,10 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {

final boolean accountForSliceSpacing = sliceSpace > 0.f && sliceAngle <= 180.f;

mRenderPaint.setColor(set.getColor(index));
Integer highlightColor = set.getHighlightColor();
if (highlightColor == null)
highlightColor = set.getColor(index);
mRenderPaint.setColor(highlightColor);

final float sliceSpaceAngleOuter = visibleAngleCount == 1 ?
0.f :