Who worked with TeeChart Java for Android? Help is needed. Actually, I need to draw a Gannt diagram, but I cannot adjust this diagram. I draw it like this:
public class GantActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Series ser = new Gantt(); TChart chart = new TChart(this); ser = chart.addSeries(gan); ser.add(SetGantt("2012-04-04 13:40"), SetGantt("2012-04-04 17:20")); ser.add(SetGantt("2012-04-05 12:00"), SetGantt("2012-04-05 13:00")); setContentView(chart); } // Тут мы преобразовываем строку в дату-время public double SetGantt(String dateBegin) { DateTime cal = (DateTime) DateTime.getToday(); try { String str_date = dateBegin; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Date date1 = formatter.parse(str_date); cal.set(DateTime.DAY_OF_MONTH, date1.getDay()); cal.set(DateTime.YEAR, date1.getYear()); cal.set(DateTime.MONTH, date1.getMonth()); cal.set(DateTime.HOUR_OF_DAY, date1.getHours()); cal.set(DateTime.MINUTE, date1.getMinutes()); } catch (Exception e) { } double ti = cal.toDouble(); return ti; } }
as stated in the certificate:
int add(double start, double endDate, double y) Adds a new Gantt bar with start and end coordinates to the Series.
I don’t understand what I’m doing wrong ... he draws me 2 bands with incomprehensible date / time and a type of long. Instead of double, substituted DateTime, but also did not bring anything
Also help offers:
int add(DateTime start, DateTime endDate, double y, Color color) Adds a new Gantt point to the series, at the start and endDate positions. int add(DateTime start, DateTime endDate, double y, java.lang.String text) int add(DateTime start, DateTime endDate, double y, java.lang.String text, Color color) void add(double[] xValues, double[] yValues, boolean append) int add(double x, double y) Adds a new point with specified x and y values. int add(double start, double endDate, double y) Adds a new Gantt bar with start and end coordinates to the Series. int add(double start, double endDate, double y, Color color) Adds a new Gantt bar with start and end coordinates and color. int add(double start, double endDate, double y, java.lang.String text) Adds a new Gantt bar with start and end coordinates and label. int add(double start, double endDate, double y, java.lang.String text, Color color) Adds a new Gantt bar with start and end coordinates, label and color. protected void addSampleValues(int numValues) Adds random values to series.
Moreover, fillSampleValues () fills everything nicely, but I cannot find out what parameters it conveys.