com.github.mikephil.charting.charts.RadarChart Java Examples

The following examples show how to use com.github.mikephil.charting.charts.RadarChart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RadarChartRenderer.java    From NetKnight with Apache License 2.0 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);

    mHighlightCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
 
Example #2
Source File: RadarChartRenderer.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);
}
 
Example #3
Source File: RadarChartRenderer.java    From iMoney with Apache License 2.0 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);
}
 
Example #4
Source File: RealmDatabaseActivityRadar.java    From Stayfit with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_radarchart_noseekbar);

    mChart = (RadarChart) findViewById(R.id.chart1);
    setup(mChart);

    mChart.getYAxis().setEnabled(false);
    mChart.setWebAlpha(180);
    mChart.setWebColorInner(Color.DKGRAY);
    mChart.setWebColor(Color.GRAY);
}
 
Example #5
Source File: RadarChartRenderer.java    From android-kline with Apache License 2.0 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);

    mHighlightCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
 
Example #6
Source File: RadarChartRenderer.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);

    mHighlightCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
 
Example #7
Source File: RadarChartManager.java    From react-native-mp-android-chart with MIT License 5 votes vote down vote up
@Override
public void setYAxis(Chart chart, ReadableMap propMap) {
    RadarChart radarChart = (RadarChart) chart;
    YAxis axis = radarChart.getYAxis();

    setCommonAxisConfig(chart, axis, propMap);
    setYAxisConfig(axis, propMap);
}
 
Example #8
Source File: RadarChartRenderer.java    From StockChart-MPAndroidChart with MIT License 5 votes vote down vote up
public RadarChartRenderer(RadarChart chart, ChartAnimator animator,
                          ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mHighlightPaint.setStyle(Paint.Style.STROKE);
    mHighlightPaint.setStrokeWidth(2f);
    mHighlightPaint.setColor(Color.rgb(255, 187, 115));

    mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mWebPaint.setStyle(Paint.Style.STROKE);

    mHighlightCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
 
Example #9
Source File: RadarChartManager.java    From react-native-mp-android-chart with MIT License 4 votes vote down vote up
@Override
protected RadarChart createViewInstance(ThemedReactContext reactContext) {
    return new RadarChart(reactContext);
}
 
Example #10
Source File: XAxisRendererRadarChart.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}
 
Example #11
Source File: PieRadarChartTouchListener.java    From Notification-Analyser with MIT License 4 votes vote down vote up
@Override
public boolean onSingleTapUp(MotionEvent e) {

    OnChartGestureListener l = mChart.getOnChartGestureListener();

    if (l != null) {
        l.onChartSingleTapped(e);
    }

    float distance = mChart.distanceToCenter(e.getX(), e.getY());

    // check if a slice was touched
    if (distance > mChart.getRadius()) {

        // if no slice was touched, highlight nothing
        mChart.highlightValues(null);
        mLastHighlight = null;

    } else {

        float angle = mChart.getAngleForPoint(e.getX(), e.getY());
        int index = mChart.getIndexForAngle(angle);

        // check if the index could be found
        if (index < 0) {

            mChart.highlightValues(null);
            mLastHighlight = null;

        } else {

            ArrayList<SelInfo> valsAtIndex = mChart.getYValsAtIndex(index);

            int dataSetIndex = 0;

            // get the dataset that is closest to the selection (PieChart
            // only
            // has one DataSet)
            if (mChart instanceof RadarChart) {

                dataSetIndex = Utils.getClosestDataSetIndex(valsAtIndex, distance
                        / ((RadarChart) mChart).getFactor());
            }

            Highlight h = new Highlight(index, dataSetIndex);

            if (h.equalTo(mLastHighlight)) {

                mChart.highlightTouch(null);
                mLastHighlight = null;
            } else {

                mChart.highlightTouch(h);
                mLastHighlight = h;
            }
        }
    }

    return true;
}
 
Example #12
Source File: YAxisRendererRadarChart.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
    super(viewPortHandler, yAxis, null);

    this.mChart = chart;
}
 
Example #13
Source File: PieRadarChartTouchListener.java    From NetKnight with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onSingleTapUp(MotionEvent e) {

    mLastGesture = ChartGesture.SINGLE_TAP;

    OnChartGestureListener l = mChart.getOnChartGestureListener();

    if (l != null) {
        l.onChartSingleTapped(e);
    }

    if(!mChart.isHighlightPerTapEnabled()) {
        return false;
    }

    float distance = mChart.distanceToCenter(e.getX(), e.getY());

    // check if a slice was touched
    if (distance > mChart.getRadius()) {

        // if no slice was touched, highlight nothing

        if (mLastHighlighted == null)
            mChart.highlightValues(null); // no listener callback
        else
            mChart.highlightTouch(null); // listener callback

        mLastHighlighted = null;

    } else {

        float angle = mChart.getAngleForPoint(e.getX(), e.getY());

        if (mChart instanceof PieChart) {
            angle /= mChart.getAnimator().getPhaseY();
        }

        int index = mChart.getIndexForAngle(angle);

        // check if the index could be found
        if (index < 0) {

            mChart.highlightValues(null);
            mLastHighlighted = null;

        } else {

            List<SelectionDetail> valsAtIndex = mChart.getSelectionDetailsAtIndex(index);

            int dataSetIndex = 0;

            // get the dataset that is closest to the selection (PieChart
            // only
            // has one DataSet)
            if (mChart instanceof RadarChart) {

                dataSetIndex = Utils.getClosestDataSetIndexByValue(
                        valsAtIndex,
                        distance / ((RadarChart) mChart).getFactor(),
                        null);
            }

            if (dataSetIndex < 0) {
                mChart.highlightValues(null);
                mLastHighlighted = null;
            } else {
                Highlight h = new Highlight(index, dataSetIndex);
                performHighlight(h, e);
            }
        }
    }

    return true;
}
 
Example #14
Source File: RadarChartActivitry.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_radarchart);

    mChart = (RadarChart) findViewById(R.id.chart1);

    tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

    mChart.setDescription("");

    mChart.setWebLineWidth(1.5f);
    mChart.setWebLineWidthInner(0.75f);
    mChart.setWebAlpha(100);

    // create a custom MarkerView (extend MarkerView) and specify the layout
    // to use for it
    MyMarkerView mv = new MyMarkerView(this, R.layout.custom_marker_view);

    // set the marker to the chart
    mChart.setMarkerView(mv);

    setData();

    mChart.animateXY(
            1400, 1400,
            Easing.EasingOption.EaseInOutQuad,
            Easing.EasingOption.EaseInOutQuad);

    XAxis xAxis = mChart.getXAxis();
    xAxis.setTypeface(tf);
    xAxis.setTextSize(9f);

    YAxis yAxis = mChart.getYAxis();
    yAxis.setTypeface(tf);
    yAxis.setLabelCount(5, false);
    yAxis.setTextSize(9f);
    yAxis.setAxisMinValue(0f);

    Legend l = mChart.getLegend();
    l.setPosition(LegendPosition.RIGHT_OF_CHART);
    l.setTypeface(tf);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(5f);
}
 
Example #15
Source File: RadarChartManager.java    From react-native-mp-android-chart with MIT License 4 votes vote down vote up
@ReactProp(name = "skipWebLineCount")
public void setSkipWebLineCount(RadarChart chart, int count) {
    chart.setSkipWebLineCount(count);
}
 
Example #16
Source File: YAxisRendererRadarChart.java    From StockChart-MPAndroidChart with MIT License 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
    super(viewPortHandler, yAxis, null);

    this.mChart = chart;
}
 
Example #17
Source File: XAxisRendererRadarChart.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}
 
Example #18
Source File: YAxisRendererRadarChart.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
    super(viewPortHandler, yAxis, null);

    this.mChart = chart;
}
 
Example #19
Source File: PieRadarChartTouchListener.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onSingleTapUp(MotionEvent e) {

    mLastGesture = ChartGesture.SINGLE_TAP;

    OnChartGestureListener l = mChart.getOnChartGestureListener();

    if (l != null) {
        l.onChartSingleTapped(e);
    }

    if(!mChart.isHighlightPerTapEnabled()) {
        return false;
    }

    float distance = mChart.distanceToCenter(e.getX(), e.getY());

    // check if a slice was touched
    if (distance > mChart.getRadius()) {

        // if no slice was touched, highlight nothing

        if (mLastHighlighted == null)
            mChart.highlightValues(null); // no listener callback
        else
            mChart.highlightTouch(null); // listener callback

        mLastHighlighted = null;

    } else {

        float angle = mChart.getAngleForPoint(e.getX(), e.getY());

        if (mChart instanceof PieChart) {
            angle /= mChart.getAnimator().getPhaseY();
        }

        int index = mChart.getIndexForAngle(angle);

        // check if the index could be found
        if (index < 0) {

            mChart.highlightValues(null);
            mLastHighlighted = null;

        } else {

            List<SelectionDetail> valsAtIndex = mChart.getSelectionDetailsAtIndex(index);

            int dataSetIndex = 0;

            // get the dataset that is closest to the selection (PieChart
            // only
            // has one DataSet)
            if (mChart instanceof RadarChart) {

                dataSetIndex = Utils.getClosestDataSetIndex(valsAtIndex, distance
                        / ((RadarChart) mChart).getFactor(), null);
            }

            if (dataSetIndex < 0) {
                mChart.highlightValues(null);
                mLastHighlighted = null;
            } else {
                Highlight h = new Highlight(index, dataSetIndex);
                performHighlight(h, e);
            }
        }
    }

    return true;
}
 
Example #20
Source File: XAxisRendererRadarChart.java    From iMoney with Apache License 2.0 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}
 
Example #21
Source File: YAxisRendererRadarChart.java    From iMoney with Apache License 2.0 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
	super(viewPortHandler, yAxis, null);

	this.mChart = chart;
}
 
Example #22
Source File: PieRadarChartTouchListener.java    From iMoney with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onSingleTapUp(MotionEvent e) {

    OnChartGestureListener l = mChart.getOnChartGestureListener();

    if (l != null) {
        l.onChartSingleTapped(e);
    }

    float distance = mChart.distanceToCenter(e.getX(), e.getY());

    // check if a slice was touched
    if (distance > mChart.getRadius()) {

        // if no slice was touched, highlight nothing
        mChart.highlightValues(null);
        mLastHighlighted = null;

    } else {

        float angle = mChart.getAngleForPoint(e.getX(), e.getY());

        if (mChart instanceof PieChart) {
            angle /= mChart.getAnimator().getPhaseY();
        }

        int index = mChart.getIndexForAngle(angle);

        // check if the index could be found
        if (index < 0) {

            mChart.highlightValues(null);
            mLastHighlighted = null;

        } else {

            List<SelectionDetail> valsAtIndex = mChart.getSelectionDetailsAtIndex(index);

            int dataSetIndex = 0;

            // get the dataset that is closest to the selection (PieChart
            // only
            // has one DataSet)
            if (mChart instanceof RadarChart) {

                dataSetIndex = Utils.getClosestDataSetIndex(valsAtIndex, distance
                        / ((RadarChart) mChart).getFactor(), null);
            }

            if (dataSetIndex < 0) {
                mChart.highlightValues(null);
                mLastHighlighted = null;
            } else {
                Highlight h = new Highlight(index, dataSetIndex);

                if (h.equalTo(mLastHighlighted)) {

                    mChart.highlightTouch(null);
                    mLastHighlighted = null;
                } else {

                    mChart.highlightTouch(h);
                    mLastHighlighted = h;
                }
            }
        }
    }

    return true;
}
 
Example #23
Source File: RadarHighlighter.java    From android-kline with Apache License 2.0 4 votes vote down vote up
public RadarHighlighter(RadarChart chart) {
    super(chart);
}
 
Example #24
Source File: XAxisRendererRadarChart.java    From android-kline with Apache License 2.0 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}
 
Example #25
Source File: YAxisRendererRadarChart.java    From android-kline with Apache License 2.0 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
    super(viewPortHandler, yAxis, null);

    this.mChart = chart;
}
 
Example #26
Source File: RadarHighlighter.java    From Ticket-Analysis with MIT License 4 votes vote down vote up
public RadarHighlighter(RadarChart chart) {
    super(chart);
}
 
Example #27
Source File: XAxisRendererRadarChart.java    From Ticket-Analysis with MIT License 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}
 
Example #28
Source File: YAxisRendererRadarChart.java    From Ticket-Analysis with MIT License 4 votes vote down vote up
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
    super(viewPortHandler, yAxis, null);

    this.mChart = chart;
}
 
Example #29
Source File: RadarHighlighter.java    From StockChart-MPAndroidChart with MIT License 4 votes vote down vote up
public RadarHighlighter(RadarChart chart) {
    super(chart);
}
 
Example #30
Source File: XAxisRendererRadarChart.java    From StockChart-MPAndroidChart with MIT License 4 votes vote down vote up
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
    super(viewPortHandler, xAxis, null);

    mChart = chart;
}