You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Questions & Issues
19
19
20
20
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:
21
21
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
23
23
- Create Issues here on GitHub
24
24
25
25
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.
@@ -111,11 +114,10 @@ or create it in code (and then **add it to a layout**):
111
114
- <code>setValuePaintColor(int color)</code>: Sets the color used for drawing the values if <code>setDrawYValues(...)</code> is enabled.
112
115
- <code>setValueTypeface(Typeface t)</code>: Sets the <code>Typeface</code> used for drawing the values if <code>setDrawYValues(...)</code> is enabled.
113
116
- <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.
115
117
- <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.
116
118
117
119
**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, ...
119
121
- <code>public float getScaleX()</code>: Returns the current scale factor on the x-axis.
120
122
- <code>public float getYChartMin()</code>: Returns the current minimum y-value that can be displayed by the chart - bottom line.
121
123
- <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
313
315
314
316
```
315
317
318
+
**LimitLines:**
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 =newLineData(...);
327
+
328
+
LimitLine ll =newLimitLine(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.
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.
0 commit comments