사용자가 시도한 질문/답변 세션에 대한 선 및 막대 그래프를 표시하려고합니다. AndroidPlot 0.6.0
을 사용하고 있습니다. 세션 날짜 시간은 도메인이고 범위는 Yes
또는 No
으로 응답 된 질문의 수입니다.AndroidPlot에 하나의 번호 만 표시됩니다.
문제 : 단일 항목이있는 목록은 그래프에 아무 것도 표시하지 않습니다. 예를 들어, 사용자가 첫 번째 세션 : 두 개 이상의 항목
목록이 제대로 그래프를 보여줍니다. 그래프는 제대로의 도메인 카운트와 같은 날짜에 두 개의 세션을 보여줍니다 예/아니오 범위로하지 :
다음과 같이 선 그래프에 대한 나의 코드는 다음과 같습니다
XYSeries answeredYesSeries = new SimpleXYSeries(answeredYesList,
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,
// Y_VALS_ONLY means use the element index as the x value
"Answered Yes"); // Title of this series
// Create a formatter to use for draw ing a series using
// LineAndPointRenderer
// and configure it from xml:
LineAndPointFormatter series1Format = new LineAndPointFormatter();
series1Format.setPointLabelFormatter(new PointLabelFormatter());
series1Format.configure(getApplicationContext(),
R.xml.line_point_formatter_with_plf1);
// add count of questions answered with yes series to the xyplot:
xyPlot.addSeries(answeredYesSeries, series1Format);
XYSeries answeredNoSeries = new SimpleXYSeries(answeredNoList,
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, // Y_VALS_ONLY means
// use the element
// index as the x
// value
"Answered No"); // Title of this series
// Create a formatter to use for draw ing a series using
// LineAndPointRenderer
// and configure it from xml:
LineAndPointFormatter series2Format = new LineAndPointFormatter();
series2Format.setPointLabelFormatter(new PointLabelFormatter());
series2Format.configure(getApplicationContext(),
R.xml.line_point_formatter_with_plf2);
// add count of questions answered with no series to the xyplot:
xyPlot.addSeries(answeredNoSeries, series2Format);
누군가를합니까 해결책이 있으십니까?
같은 문제가 발생했습니다. –