Java源码示例:com.github.mikephil.charting.components.IMarker
示例1
@Deprecated
public void setMarkerView(IMarker v) {
setMarker(v);
}
示例2
@Deprecated
public IMarker getMarkerView() {
return getMarker();
}
示例3
@Deprecated
public void setMarkerView(IMarker v) {
setMarker(v);
}
示例4
@Deprecated
public IMarker getMarkerView() {
return getMarker();
}
示例5
@Deprecated
public void setMarkerView(IMarker v) {
setMarker(v);
}
示例6
@Deprecated
public IMarker getMarkerView() {
return getMarker();
}
示例7
public void setXMarker(IMarker marker) {
mXMarker = marker;
}
示例8
public void setXMarker(IMarker marker) {
mXMarker = marker;
}
示例9
public DateGraph(Context context, LineChart chart, String name) {
mChart = chart;
mChartName = name;
mChart.setDoubleTapToZoomEnabled(true);
mChart.setHorizontalScrollBarEnabled(true);
mChart.setVerticalScrollBarEnabled(true);
mChart.setAutoScaleMinMaxEnabled(true);
mChart.setDrawBorders(true);
mChart.setNoDataText(context.getString(R.string.no_chart_data_available));
IMarker marker = new DateGraphMarkerView(mChart.getContext(), R.layout.graph_markerview, mChart);
mChart.setMarker(marker);
mContext = context;
// get the legend (only possible after setting data)
Legend l = mChart.getLegend();
l.setEnabled(false);
XAxis xAxis = mChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setTextColor(ColorTemplate.getHoloBlue());
xAxis.setDrawAxisLine(true);
xAxis.setDrawGridLines(true);
xAxis.setCenterAxisLabels(false);
xAxis.setGranularity(1); // 1 jour
xAxis.setValueFormatter(new IAxisValueFormatter() {
private SimpleDateFormat mFormat = new SimpleDateFormat("dd-MMM"); // HH:mm:ss
@Override
public String getFormattedValue(float value, AxisBase axis) {
//long millis = TimeUnit.HOURS.toMillis((long) value);
mFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Date tmpDate = new Date((long) DateConverter.nbMilliseconds(value)); // Convert days in milliseconds
return mFormat.format(tmpDate);
}
});
YAxis leftAxis = mChart.getAxisLeft();
leftAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
leftAxis.setTextColor(ColorTemplate.getHoloBlue());
leftAxis.setDrawGridLines(true);
leftAxis.setGranularityEnabled(true);
leftAxis.setGranularity((float) 0.5);
leftAxis.resetAxisMinimum();
mChart.getAxisRight().setEnabled(false);
}
示例10
/**
* sets the marker that is displayed when a value is clicked on the chart
*
* @param marker
*/
public void setMarker(IMarker marker) {
mMarker = marker;
}
示例11
/**
* returns the marker that is set as a marker view for the chart
*
* @return
*/
public IMarker getMarker() {
return mMarker;
}
示例12
/**
* sets the marker that is displayed when a value is clicked on the chart
*
* @param marker
*/
public void setMarker(IMarker marker) {
mMarker = marker;
}
示例13
/**
* returns the marker that is set as a marker view for the chart
*
* @return
*/
public IMarker getMarker() {
return mMarker;
}
示例14
/**
* sets the marker that is displayed when a value is clicked on the chart
*
* @param marker
*/
public void setMarker(IMarker marker) {
mMarker = marker;
}
示例15
/**
* returns the marker that is set as a marker view for the chart
*
* @return
*/
public IMarker getMarker() {
return mMarker;
}