2016-07-12 3 views

답변

0

이, 아니 거기를 List<string>, LineDataSet을 허용하는 생성자입니다. 사용 가능한 생성자는 다음과 같습니다.

public LineData() { 
    super(); 
} 

public LineData(ILineDataSet... dataSets) { 
    super(dataSets); 
} 

public LineData(List<ILineDataSet> dataSets) { 
    super(dataSets); 
} 

전체 클래스 정의 here을 읽을 수 있습니다.

x 값을 다르게 설정해야합니다. This 예제가 도움이됩니다.

-1
XAxis xAxis = lineChart.getXAxis(); 
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); 
xAxis.setDrawGridLines(true); 
xAxis.setDrawAxisLine(true); 
xAxis.setTextSize(10f); 
date.clear(); 
for (int i = 0; i < size; i++) { 
    date.add("第" + i + "天"); 


} 
//Set the X axis below the data (not the same as the previous version) 

xAxis.setValueFormatter(new AxisValueFormatter() { 
    @Override 
    public String getFormattedValue(float value, AxisBase axis) { 
     axis.setGranularityEnabled(true); 
     axis.resetAxisMaxValue(); 
     axis.isAxisMaxCustom(); 
     int a = (int) value; 

     return date.get(a);// Data below 
    } 

    @Override 
    public int getDecimalDigits() { 
     return 0; 
    } 
}); 

어쩌면 당신이

+0

친절에도 큰 도움이 될 것이다 영어 코드 주석을 번역 답변 – Naga2Raja

+0

에 대해 좀 더 설명을 제공하는 데 도움이됩니다. – Laurel

관련 문제