@@ -14,7 +14,7 @@ To use the library in your gradle project add the following to your build.gradle
1414
1515``` groovy
1616dependencies {
17- compile "com.androidplot:androidplot-core:1.5.7"
17+ implementation "com.androidplot:androidplot-core:1.5.7"
1818}
1919```
2020
@@ -55,6 +55,32 @@ directly within your Plot's XML, prefixing each property with "androidPlot". Ex
5555androidPlot.title="My Plot"
5656```
5757
58+ Add these files to your ** /res/xml** directory:
59+
60+ #### /res/xml/line_point_formatter_with_labels.xml
61+ ``` xml
62+ <?xml version =" 1.0" encoding =" utf-8" ?>
63+ <config
64+ linePaint.strokeWidth=" 5dp"
65+ linePaint.color=" #00AA00"
66+ vertexPaint.color=" #007700"
67+ vertexPaint.strokeWidth=" 20dp"
68+ fillPaint.color=" #00000000"
69+ pointLabelFormatter.textPaint.color=" #CCCCCC" />
70+ ```
71+
72+ #### /res/xml/line_point_formatter_with_labels_2.xml
73+ ``` xml
74+ <?xml version =" 1.0" encoding =" utf-8" ?>
75+ <config
76+ linePaint.strokeWidth=" 5dp"
77+ linePaint.color=" #0000AA"
78+ vertexPaint.strokeWidth=" 20dp"
79+ vertexPaint.color=" #000099"
80+ fillPaint.color=" #00000000"
81+ pointLabelFormatter.textPaint.color=" #CCCCCC" />
82+ ```
83+
5884# Create an Activity
5985Now let's create an Activity to display the XYPlot we just defined in ` simple_xy_plot_example.xml ` .
6086The basic steps are:
@@ -151,7 +177,6 @@ public class SimpleXYPlotActivity extends Activity {
151177}
152178```
153179
154-
155180One potentially confusing section of the code above are the initializations of LineAndPointFormatter
156181You probably noticed that they take a mysterious reference to an xml resource file. This is actually
157182using [ Fig] ( https://github.com/halfhp/fig ) to configure the instance properties from XML.
@@ -173,31 +198,5 @@ In general XML configuration should be used over programmatic configuration when
173198more flexibility in terms of defining properties by screen density etc.. For more details on how to
174199programmatically configure Formatters etc. consult the latest Javadocs.
175200
176- Continuing with the original example above, add these files to your ** /res/xml** directory:
177-
178- #### /res/xml/line_point_formatter_with_labels.xml
179- ``` xml
180- <?xml version =" 1.0" encoding =" utf-8" ?>
181- <config
182- linePaint.strokeWidth=" 5dp"
183- linePaint.color=" #00AA00"
184- vertexPaint.color=" #007700"
185- vertexPaint.strokeWidth=" 20dp"
186- fillPaint.color=" #00000000"
187- pointLabelFormatter.textPaint.color=" #CCCCCC" />
188- ```
189-
190- #### /res/xml/line_point_formatter_with_labels_2.xml
191- ``` xml
192- <?xml version =" 1.0" encoding =" utf-8" ?>
193- <config
194- linePaint.strokeWidth=" 5dp"
195- linePaint.color=" #0000AA"
196- vertexPaint.strokeWidth=" 20dp"
197- vertexPaint.color=" #000099"
198- fillPaint.color=" #00000000"
199- pointLabelFormatter.textPaint.color=" #CCCCCC" />
200- ```
201-
202201# Whats Next?
203202Learn about [ Plot Composition] ( plot_composition.md ) or continue with [ XYPlots] ( xyplot.md ) .
0 commit comments