Skip to content

Commit 9861812

Browse files
committed
Merge readme.
2 parents 3e0fc2e + 570d269 commit 9861812

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Questions & Issues
1919

2020
If you are having questions or problems, feel free to contact me. Since I would very much like that other users of this library **can also benefit** from your question, I am asking you to contact me via e-mail **only as a last option**. Instead, you should:
2121

22-
- Open questions on [**stackoverflow**](https://stackoverflow.com) with the `mpandroidchart` tag
22+
- Open questions on [**stackoverflow**](https://stackoverflow.com/search?q=mpandroidchart) with the `mpandroidchart` tag
2323
- Create Issues here on GitHub
2424

2525
Please let me know via e-mail that you have opened a stackoverflow question so that I can get to answering it right away. Thank you.
@@ -36,6 +36,9 @@ Features
3636
- Read .txt file chart-data
3737
- Predefined color templates
3838
- Legends (generated automatically, customizeable)
39+
- Labels (both x- and y-axis, customizeable)
40+
- Animations (build up animations, on both x- and y-axis)
41+
- Limit lines (providing additional information, maximums, ...)
3942
- Fully customizeable (paints, typefaces, legends, colors, background, gestures, dashed lines, ...)
4043

4144
**Chart types:**
@@ -111,11 +114,10 @@ or create it in code (and then **add it to a layout**):
111114
- <code>setValuePaintColor(int color)</code>: Sets the color used for drawing the values if <code>setDrawYValues(...)</code> is enabled.
112115
- <code>setValueTypeface(Typeface t)</code>: Sets the <code>Typeface</code> used for drawing the values if <code>setDrawYValues(...)</code> is enabled.
113116
- <code>setValueDigits(int digits)</code>: Sets the number of digits to use for all printed values.
114-
- <code>setColorTemplate(ColorTemplate ct)</code>: Sets a <code>ColorTemplate</code> for the chart containing all colors. More information below.
115117
- <code>setPaint(Paint p, int which)</code>: Replaces the specified default <code>Paint</code> object with a new one. This method can be used to replace any predefined <code>Paint</code> object with an own <code>Paint</code> object and develop a completely personalized design.
116118

117119
**Getters and convenience:**
118-
- <code>public ChartData getData()</code>: Returns the <code>ChartData</code> object the chart currently displays. It contains all information concerning the displayed values such as minimum and maximum values, value counts, value sums, ...
120+
- <code>public ChartData getDataCurrent()</code>: Returns the <code>ChartData</code> object the chart currently displays. It contains all information concerning the displayed values such as minimum and maximum values, value counts, value sums, ...
119121
- <code>public float getScaleX()</code>: Returns the current scale factor on the x-axis.
120122
- <code>public float getYChartMin()</code>: Returns the current minimum y-value that can be displayed by the chart - bottom line.
121123
- <code>public float getYChartMax()</code>: Returns the current maximum y-value that can be displayed by the chart - top line.
@@ -313,6 +315,43 @@ yl.setLabelCount(6); // set how many label entries should be displayed
313315

314316
```
315317

318+
**Limit Lines:**
319+
320+
Limit lines (class `LimitLine`) are (as the name might indicate) plain and simple lines that can be set for all `Line-, Bar- and ScatterData` objects. They can be used to **provide additional information** for the user.
321+
322+
As an example, your chart might display various blood pressure measurement results the user logged with an application. In order to inform the user that a systolic blood pressure of over 140 mmHg is considered to be a health risk, you could add a `LimitLine` at 140 to provide that information.
323+
324+
```java
325+
326+
LineData ld = new LineData(...);
327+
328+
LimitLine ll = new LimitLine(140f);
329+
ll.setLineColor(Color.RED);
330+
ll.setLineWidth(4f);
331+
// .. and more styling options
332+
333+
ld.addLimitLine(ll);
334+
```
335+
336+
**Animations:**
337+
338+
All chart types support animations that can be used to create / build up the chart in an awesome looking way. Three different kinds of animation methods exist that animate either both, or x- and y-axis separately:
339+
340+
- `animateX(int durationMillis)`: Animates the charts values on the horizontal axis, meaning that the chart will build up within the specified time from left to right.
341+
- `animateY(int durationMillis)`: Animates the charts values on the vertical axis, meaning that the chart will build up within the specified time from bottom to top.
342+
- `animateXY(int xDuration, int yDuration)`: Animates both horizontal and vertical axis, resulting in a left/right bottom/top build-up.
343+
344+
```java
345+
mChart.animateX(3000f); // animate horizontal 3000 milliseconds
346+
// or:
347+
mChart.animateY(3000f); // animate vertical 3000 milliseconds
348+
// or:
349+
mChart.animateXY(3000f, 3000f); // animate horizontal and vertical 3000 milliseconds
350+
```
351+
352+
If `animate(...)` (of any kind) is called, no further calling of `invalidate()` is necessary to refresh the chart.
353+
354+
In order to support animations below Honeycomb, this library makes use of the awesome [**nineoldandroids library**](https://github.com/JakeWharton/NineOldAndroids) developed by Jake Wharton.
316355

317356
More documentation and example code coming soon.
318357

0 commit comments

Comments
 (0)