本文整理汇总了Java中com.github.mikephil.charting.charts.Chart.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Chart.setDescription方法的具体用法?Java Chart.setDescription怎么用?Java Chart.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.charts.Chart
的用法示例。
在下文中一共展示了Chart.setDescription方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
/**
* 设置字体
*
* @param chart
*/
protected void setup(Chart<?> chart) {
mTy = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
chart.setDescription("");
chart.setNoDataTextDescription("You need to provide data for the chart.");
chart.setTouchEnabled(true);
if (chart instanceof BarLineChartBase) {
BarLineChartBase mChart = (BarLineChartBase) chart;
mChart.setDrawGridBackground(false);
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
mChart.setPinchZoom(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
leftAxis.setTypeface(mTy);
leftAxis.setTextSize(8f);
leftAxis.setTextColor(Color.WHITE);
XAxis xAxis = mChart.getXAxis();
xAxis.setLabelRotationAngle(-50);//设置x轴字体显示角度
xAxis.setTypeface(mTy);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextSize(8f);
xAxis.setTextColor(Color.WHITE);
mChart.getAxisRight().setEnabled(false);
}
}
示例2: setDescription
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
@ReactProp(name = "description")
public void setDescription(Chart chart, ReadableMap propMap) {
if (BridgeUtils.validate(propMap, ReadableType.String, "text")) {
chart.setDescription(propMap.getString("text"));
}
if (BridgeUtils.validate(propMap, ReadableType.String, "textColor")) {
chart.setDescriptionColor(Color.parseColor(propMap.getString("textColor")));
}
if (BridgeUtils.validate(propMap, ReadableType.Number, "textSize")) {
chart.setDescriptionTextSize((float) propMap.getDouble("textSize"));
}
if (BridgeUtils.validate(propMap, ReadableType.Number, "positionX") &&
BridgeUtils.validate(propMap, ReadableType.Number, "positionY")) {
chart.setDescriptionPosition((float) propMap.getDouble("positionX"), (float) propMap.getDouble("positionY"));
}
if (BridgeUtils.validate(propMap, ReadableType.String, "fontFamily") ||
BridgeUtils.validate(propMap, ReadableType.Number, "fontStyle")) {
chart.setDescriptionTypeface(BridgeUtils.parseTypeface(chart.getContext(), propMap, "fontStyle", "fontFamily"));
}
}
示例3: setup
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void setup(Chart<?> chart) {
mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
// no description text
chart.setDescription("");
chart.setNoDataTextDescription("You need to provide data for the chart.");
// enable touch gestures
chart.setTouchEnabled(true);
if (chart instanceof BarLineChartBase) {
BarLineChartBase mChart = (BarLineChartBase) chart;
mChart.setDrawGridBackground(false);
// enable scaling and dragging
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
// if disabled, scaling can be done on x- and y-axis separately
mChart.setPinchZoom(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
leftAxis.setTypeface(mTf);
leftAxis.setTextSize(8f);
leftAxis.setTextColor(Color.WHITE);
// leftAxis.setValueFormatter(new PercentFormatter());
XAxis xAxis = mChart.getXAxis();
xAxis.setLabelRotationAngle(-50);//设置x轴字体显示角度
xAxis.setTypeface(mTf);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextSize(8f);
xAxis.setTextColor(Color.WHITE);
mChart.getAxisRight().setEnabled(false);
}
}
示例4: setup
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void setup(Chart<?> chart) {
mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
// no description text
chart.setDescription("");
chart.setNoDataTextDescription("You need to provide data for the chart.");
// enable touch gestures
chart.setTouchEnabled(true);
if (chart instanceof BarLineChartBase) {
BarLineChartBase mChart = (BarLineChartBase) chart;
mChart.setDrawGridBackground(false);
// enable scaling and dragging
mChart.setDragEnabled(true);
mChart.setScaleEnabled(true);
// if disabled, scaling can be done on x- and y-axis separately
mChart.setPinchZoom(false);
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
leftAxis.setTypeface(mTf);
leftAxis.setTextSize(8f);
leftAxis.setTextColor(Color.DKGRAY);
leftAxis.setValueFormatter(new PercentFormatter());
XAxis xAxis = mChart.getXAxis();
xAxis.setTypeface(mTf);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextSize(8f);
xAxis.setTextColor(Color.DKGRAY);
mChart.getAxisRight().setEnabled(false);
}
}
示例5: configureChartDefaults
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void configureChartDefaults(Chart<?> chart) {
chart.setDescription("");
// if enabled, the chart will always start at zero on the y-axis
chart.setNoDataText(getString(R.string.chart_no_data_synchronize));
// disable value highlighting
chart.setHighlightPerTapEnabled(false);
// enable touch gestures
chart.setTouchEnabled(true);
setupLegend(chart);
}
示例6: initChart
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
private void initChart(Panel panel, Chart chart) {
Context context = chart.getContext();
chart.setDescription(panel.getDescription(context));
chart.setHardwareAccelerationEnabled(true);
chart.setDescriptionTextSize(13f);
chart.setNoDataText(context.getString(R.string.exception_chart_no_data));
chart.setHighlightEnabled(true);
}
示例7: setupDescription
import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
private void setupDescription(Chart chart) {
chart.setDescription(null);
}