License
Copyright 2015 AndroidPlot.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Issues Resolved
ANDROIDPLOT-64 - Remove intellij tags from files
ANDROIDPLOT-88 - Create project for quickstart
There is now a Quickstart project under Examples with pre-configured project files IntelliJ and Eclipse ADT evironments.ANDROIDPLOT-106 Adapt Demo App to work on tablets
The AndroidPlot API Demos App is now compatible with tablet devices running Honeycomb, ICS or Jellybean.ANDROIDPLOT-107 AndroidPlot defined xml attributes are not translating resource strings
It is now possible to use localized strings as AndroidPlot xml attributes:
1 2 3 4 5 |
<com.androidplot.xy.XYPlot android:id="@+id/mySimpleXYPlot" android:layout_width="fill_parent" android:layout_height="fill_parent" androidplot.title="@string/myPlotTitle"/> |
ANDROIDPLOT-133 The demo applications on web do not compile [dynamic data and xy simple plot]
Fixed.ANDROIDPLOT-125 Add settitle to SimpleXYSeries
Added.ANDROIDPLOT-133 Is it possible to see the full documentation somewhere?
Not a bug.ANDROIDPLOT-131 Update Sample projects for latest Android SDK
Example project files have all been updated for SDK r14.ANDROIDPLOT-132 Increment Version to .0.5.1 (Currently still shows 0.5.0)
DoneANDROIDPLOT-133 DemoApp Cleanup
Lots of changes here .See Issue work log for details.ANDROIDPLOT-134 Update source with Apache 2.0 license
DoneANDROIDPLOT-136 Minimize recalculation of drawing boundaries in main loop
Implemented a background thread and a ping-pong buffer. See either the issue worklog or api change notes below for further details.ANDROIDPLOT-137 Add support using AndroidPlot in App Widgets
No code changes were necessary. Added an example of how it's done to the Demo Apps. (DemoAppWidgetProvider.java)ANDROIDPLOT-138 Regions not working on ICS
FixedANDROIDPLOT-139 Get rid of XYRenderFactory
It's gone! Creating and using custom renderers should be much simpler now and no longer requires a recompile of AndroidPlot-Core.API Changes
Improved XML Configuration
This is a big one. Plots declared in XML can now be styled more extensively. Any String, int, float, boolean or Enum parameter (includes colors and dimensions) with a public setter can now be set via XML. We've also added support for configuring Formatters or pretty much anything else you'd care to style in XML via Configurator.configure(...) methods. See the Configurator javadoc for usage details. What this means for you the developer is vastly improved facilities for localization and setting layout styles based on screen size and orientation. Here's a quick example: (view/download sample project in Bitbucket here) /res/xml/f1.xml:
1 2 3 4 5 |
<?xml version="1.0" encoding="utf-8"?> <config vertexPaint.color="#00FF00" linePaint.color="#00FF00" linePaint.strokeWidth="2dp"/> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.androidplot.xy.XYPlot android:id="@+id/mySimpleXYPlot" android:layout_width="fill_parent" android:layout_height="150px" android:layout_marginTop="10px" android:layout_marginLeft="10px" android:layout_marginRight="10px" andsroidplot.title="A Simple XYPlot Example" androidplot.ticksPerRangeLabel="4" androidplot.ticksPerDomainLabel="2" androidplot.gridPadding="4dp|4dp|4dp|4dp"/> </LinearLayout> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
public class MyActivity extends Activity { private XYPlot plot; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // initialize our XYPlot reference: plot = (XYPlot) findViewById(R.id.mySimpleXYPlot); // add a new series XYSeries mySeries = new SimpleXYSeries( Arrays.asList(new Integer[]{0, 25, 55, 2, 80, 30, 99, 0, 44, 6}), SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "series1"); plot.addSeries(mySeries, new LineAndPointFormatter( getApplicationContext(), R.xml.f1)); // reposition the domain label to look a little cleaner: plot.position(plot.getDomainLabelWidget(), // the widget to position 45, // x position value, in this case 45 pixels XLayoutStyle.ABSOLUTE_FROM_LEFT, // how the x position value is applied, in this case from the left 0, // y position value YLayoutStyle.ABSOLUTE_FROM_BOTTOM, // how the y position is applied, in this case from the bottom AnchorPosition.LEFT_BOTTOM); // point to use as the origin of the widget being positioned plot.centerOnRangeOrigin(60); plot.centerOnDomainOrigin(5); } } |
Deprecated: Plot.disableAllMarkup()
Markup is now disabled by default and can be enabled by calling Plot.setMarkupEnabled(true). We've left Plot.disableAllMarkup() in 0.5.1 for backwards compatibility but it does absolutely nothing and will be completely removed in 0.5.2.title attribute name change and is no longer mandatory
When defining the title of a plot in XML use androidplot.title instead of title as the attribute name. If title is omitted, "My Plot" will be used as the default. This change was made in order to leverage Configurator's new functionality. See the "Improved XML Configuration" section above.Configurable Render Mode
AndroidPlot can now be configured to use either the main thread or a background thread to do rendering. The default is to use the main thread. In most applications which plot trivial amounts of data, using the main thread for rendering can provide a higher frame rate. Where the line between "trivial" and "non-trivial" lies is arbitrary and varies by device, however we feel that ~150 points is a good rule of thumb. Note that once a plot has been initialized, the rendering mode cannot currently be changed. Configuring render mode via XML:
1 |
TODO |
1 |
XYPlot myPlot = new XYPlot(context "MyPlot", Plot.RenderMode.USE_MAIN_THREAD); |