本文整理汇总了Java中com.github.mikephil.charting.charts.RadarChart类的典型用法代码示例。如果您正苦于以下问题:Java RadarChart类的具体用法?Java RadarChart怎么用?Java RadarChart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RadarChart类属于com.github.mikephil.charting.charts包,在下文中一共展示了RadarChart类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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.getXAxis().setEnabled(false);
mChart.setWebAlpha(180);
mChart.setWebColorInner(Color.DKGRAY);
mChart.setWebColor(Color.GRAY);
}
示例2: RadarChartCustom
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
public RadarChartCustom(RadarChart graphical, ArrayList<Entry> entries, String entriesLegend, ArrayList<String> labels, String chartDecription)
{
this.entries = entries;
this.chart = graphical;
this.dataset = new RadarDataSet(entries, entriesLegend);
this.data = new RadarData(labels, this.dataset);
this.chart.setData(this.data);
this.colors = new ArrayList<>();
this.yAxis = chart.getYAxis();
this.xAxis = chart.getXAxis();
this.legend = chart.getLegend();
this.chart.setSkipWebLineCount(1);
if(chartDecription!= null)
chart.setDescription(chartDecription);
else chart.setDescription("");
setDefaultChart();
setDefaultLegend();
setDefaultAxes();
}
示例3: RadarChartRenderer
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
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);
}
示例4: onCreateView
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_analysis_chart, container, false);
mRadarChart = (RadarChart) view.findViewById(R.id.analysis_fragment_rc);
//mRadarChart.setBackgroundColor(Color.rgb(60, 65, 82));
mRadarChart.getDescription().setEnabled(false);
mRadarChart.setWebLineWidth(1f);
mRadarChart.setWebColor(Color.LTGRAY);
mRadarChart.setWebLineWidthInner(1f);
mRadarChart.setWebColorInner(Color.LTGRAY);
mRadarChart.setWebAlpha(100);
mRadarChart.animateXY(
1400, 1400,
Easing.EasingOption.EaseInOutQuad,
Easing.EasingOption.EaseInOutQuad);
TextView _20TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_20_times_tv);
TextView _40TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_40_times_tv);
TextView _60TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_60_times_tv);
TextView _70TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_70_times_tv);
TextView _90TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_90_times_tv);
TextView _100TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_100_times_tv);
TextView _120TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_120_times_tv);
TextView _120UpTimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_120_up_times_tv);
mTimesTextViewArray = new TextView[]{
_20TimesTextView,
_40TimesTextView,
_60TimesTextView,
_70TimesTextView,
_90TimesTextView,
_100TimesTextView,
_120TimesTextView,
_120UpTimesTextView};
return view;
}
示例5: RadarChartRenderer
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
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);
}
示例6: onCreate
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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);
}
示例7: setYAxis
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@Override
public void setYAxis(Chart chart, ReadableMap propMap) {
RadarChart radarChart = (RadarChart) chart;
YAxis axis = radarChart.getYAxis();
setCommonAxisConfig(chart, axis, propMap);
setYAxisConfig(axis, propMap);
}
示例8: YAxisRendererRadarChart
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
public YAxisRendererRadarChart(ViewPortHandler viewPortHandler, YAxis yAxis, RadarChart chart) {
super(viewPortHandler, yAxis, null);
this.mChart = chart;
}
示例9: XAxisRendererRadarChart
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
public XAxisRendererRadarChart(ViewPortHandler viewPortHandler, XAxis xAxis, RadarChart chart) {
super(viewPortHandler, xAxis, null);
mChart = chart;
}
示例10: RadarHighlighter
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
public RadarHighlighter(RadarChart chart) {
super(chart);
}
示例11: onCreate
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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);
TextView tv = (TextView) findViewById(R.id.textView);
tv.setTypeface(mTfLight);
tv.setTextColor(Color.WHITE);
tv.setBackgroundColor(Color.rgb(60, 65, 82));
mChart = (RadarChart) findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.rgb(60, 65, 82));
mChart.getDescription().setEnabled(false);
mChart.setWebLineWidth(1f);
mChart.setWebColor(Color.LTGRAY);
mChart.setWebLineWidthInner(1f);
mChart.setWebColorInner(Color.LTGRAY);
mChart.setWebAlpha(100);
// create a custom MarkerView (extend MarkerView) and specify the layout
// to use for it
MarkerView mv = new RadarMarkerView(this, R.layout.radar_markerview);
mv.setChartView(mChart); // For bounds control
mChart.setMarker(mv); // Set the marker to the chart
setData();
mChart.animateXY(
1400, 1400,
Easing.EasingOption.EaseInOutQuad,
Easing.EasingOption.EaseInOutQuad);
XAxis xAxis = mChart.getXAxis();
xAxis.setTypeface(mTfLight);
xAxis.setTextSize(9f);
xAxis.setYOffset(0f);
xAxis.setXOffset(0f);
xAxis.setValueFormatter(new IAxisValueFormatter() {
private String[] mActivities = new String[]{"Burger", "Steak", "Salad", "Pasta", "Pizza"};
@Override
public String getFormattedValue(float value, AxisBase axis) {
return mActivities[(int) value % mActivities.length];
}
});
xAxis.setTextColor(Color.WHITE);
YAxis yAxis = mChart.getYAxis();
yAxis.setTypeface(mTfLight);
yAxis.setLabelCount(5, false);
yAxis.setTextSize(9f);
yAxis.setAxisMinimum(0f);
yAxis.setAxisMaximum(80f);
yAxis.setDrawLabels(false);
Legend l = mChart.getLegend();
l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
l.setDrawInside(false);
l.setTypeface(mTfLight);
l.setXEntrySpace(7f);
l.setYEntrySpace(5f);
l.setTextColor(Color.WHITE);
}
示例12: onCreateView
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_analysis, container, false);
mRecordMinterTextView = (TextView) view.findViewById(R.id.analysis_fragment_minutes_tv);
mRecordTimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_record_times_tv);
mAverageDbTextView = (TextView) view.findViewById(R.id.analysis_fragment_average_tv);
mMaxMinTextView = (TextView) view.findViewById(R.id.analysis_fragment_max_min_tv);
mRadarChart = (RadarChart) view.findViewById(R.id.analysis_fragment_rc);
//mRadarChart.setBackgroundColor(Color.rgb(60, 65, 82));
mRadarChart.getDescription().setEnabled(false);
mRadarChart.setWebLineWidth(1f);
mRadarChart.setWebColor(Color.LTGRAY);
mRadarChart.setWebLineWidthInner(1f);
mRadarChart.setWebColorInner(Color.LTGRAY);
mRadarChart.setWebAlpha(100);
mRadarChart.animateXY(
1400, 1400,
Easing.EasingOption.EaseInOutQuad,
Easing.EasingOption.EaseInOutQuad);
TextView _20TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_20_times_tv);
TextView _40TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_40_times_tv);
TextView _60TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_60_times_tv);
TextView _70TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_70_times_tv);
TextView _90TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_90_times_tv);
TextView _100TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_100_times_tv);
TextView _120TimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_120_times_tv);
TextView _120UpTimesTextView = (TextView) view.findViewById(R.id.analysis_fragment_120_up_times_tv);
mTimesTextViewArray = new TextView[]{
_20TimesTextView,
_40TimesTextView,
_60TimesTextView,
_70TimesTextView,
_90TimesTextView,
_100TimesTextView,
_120TimesTextView,
_120UpTimesTextView};
return view;
}
示例13: onSingleTapUp
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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;
}
示例14: onCreate
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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);
}
示例15: onSingleTapUp
import com.github.mikephil.charting.charts.RadarChart; //导入依赖的package包/类
@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;
}