It you're already familiar with with Android's layout xml, then you're all set. Here's an example of how you can embed an XY Chart in your application:
<zeitdata.chart.view.LineChart android:id="@+id/myChart" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp" zeitdata:chartLabel="Cookie Consumption" zeitdata:xAxisLabel="Volume" zeitdata:yAxisLabel="Frequency" />
You can interact with your charts just like any other view in Android. Adding data is easy:
// Create builders for each series to add:
NumericSeries.Builder series1Builder = new NumericSeries.Builder();
series1Builder.withTitle("Number of interviews");
NumericSeries.Builder series2Builder = new NumericSeries.Builder();
series2Builder.withColor(Color.BLUE).withTitle("Job Offers");
// Build points..
NumericPoint point1 = new NumericPoint.Builder(3, 40).build();
// Add points to your series builder:
NumericSeries interviews = series1Builder.addPoints(point1, ...).build();
NumericSeries jobOffers = series2Builder.addPoints(otherPoint1, ...).build();
// Create a data object with your series and inject into the chart
NumericData.Builder ndb = new NumericData.Builder();
NumericData dataForChart = ndb.addSeries(interviews, jobOffers).build();
LineChart chart = (LineChart) findViewById(R.id.myChart);
chart.setNumericData(dataForChart);
You can prototype your charts quickly, within your layout preview in Eclipse or IntelliJ by injecting your own sample data too. No more waiting on your emulator:
.. zeitdata:numericDataPrototype="Interviews=[(3,40),(4,12),(6,69),(20,4),(42,15)], Offers=[(1,5),(2,3),(3,2),(4,6),(5,1)]" ..
You can dig into our entire API here:
We've spent a lot of time building Zeitdata Charts beta. Offering it to you for free gets us crucial feedback. Please email us at feedback@zeitdata.com with any suggestions, feature requests, or other feedback you may have.