Skip to content

Commit 7844647

Browse files
committed
Add legacy Entries to help migration to 5.1
1 parent bb444a6 commit 7844647

6 files changed

Lines changed: 265 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package info.appdev.charting.data
2+
3+
import android.graphics.drawable.Drawable
4+
5+
6+
@Deprecated("The replacement is BarEntryFloat, or use BarEntryDouble for higher precision. BarEntry is retained for backward compatibility but will be removed in a future version.")
7+
open class BarEntry : BarEntryFloat {
8+
9+
/**
10+
* Constructor for normal bars (not stacked).
11+
*/
12+
constructor(x: Float, y: Float) : super(x, y)
13+
14+
/**
15+
* Constructor for normal bars (not stacked).
16+
*
17+
* @param x
18+
* @param y
19+
* @param data - Spot for additional data this Entry represents.
20+
*/
21+
constructor(x: Float, y: Float, data: Any?) : super(x, y, data)
22+
23+
/**
24+
* Constructor for normal bars (not stacked).
25+
*
26+
* @param x
27+
* @param y
28+
* @param icon - icon image
29+
*/
30+
constructor(x: Float, y: Float, icon: Drawable?) : super(x, y, icon)
31+
32+
/**
33+
* Constructor for normal bars (not stacked).
34+
*
35+
* @param x
36+
* @param y
37+
* @param icon - icon image
38+
* @param data - Spot for additional data this Entry represents.
39+
*/
40+
constructor(x: Float, y: Float, icon: Drawable?, data: Any?) : super(x, y, icon, data)
41+
42+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package info.appdev.charting.data
2+
3+
import android.annotation.SuppressLint
4+
import android.graphics.drawable.Drawable
5+
6+
@Deprecated("The replacement is BubbleEntryFloat, or use BubbleEntryDouble for higher precision. BubbleEntry is retained for backward compatibility but will be removed in a future version.")
7+
class BubbleEntry : BubbleEntryFloat {
8+
9+
/**
10+
* Constructor.
11+
*
12+
* @param x The value on the x-axis.
13+
* @param y The value on the y-axis.
14+
* @param size The size of the bubble.
15+
*/
16+
constructor(x: Float, y: Float, size: Float) : super(x, y, size) {
17+
this.size = size
18+
}
19+
20+
/**
21+
* Constructor.
22+
*
23+
* @param x The value on the x-axis.
24+
* @param y The value on the y-axis.
25+
* @param size The size of the bubble.
26+
* @param data Spot for additional data this Entry represents.
27+
*/
28+
constructor(x: Float, y: Float, size: Float, data: Any?) : super(x, y, size, data) {
29+
this.size = size
30+
}
31+
32+
/**
33+
* Constructor.
34+
*
35+
* @param x The value on the x-axis.
36+
* @param y The value on the y-axis.
37+
* @param size The size of the bubble.
38+
* @param icon Icon image
39+
*/
40+
constructor(x: Float, y: Float, size: Float, icon: Drawable?) : super(x, y, size, icon) {
41+
this.size = size
42+
}
43+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package info.appdev.charting.data
2+
3+
import android.graphics.drawable.Drawable
4+
5+
@Deprecated("The replacement is CandleEntryFloat, or use CandleEntryDouble for higher precision. CandleEntry is retained for backward compatibility but will be removed in a future version.")
6+
class CandleEntry : CandleEntryFloat {
7+
8+
/**
9+
* Constructor.
10+
*
11+
* @param x The value on the x-axis
12+
* @param shadowH The (shadow) high value
13+
* @param shadowL The (shadow) low value
14+
* @param open The open value
15+
* @param close The close value
16+
*/
17+
constructor(x: Float, shadowH: Float, shadowL: Float, open: Float, close: Float) : super(x, shadowH, shadowL, open, close) {
18+
this.high = shadowH
19+
this.low = shadowL
20+
this.open = open
21+
this.close = close
22+
}
23+
24+
/**
25+
* Constructor.
26+
*
27+
* @param x The value on the x-axis
28+
* @param shadowH The (shadow) high value
29+
* @param shadowL The (shadow) low value
30+
* @param data Spot for additional data this Entry represents
31+
*/
32+
constructor(
33+
x: Float, shadowH: Float, shadowL: Float, open: Float, close: Float,
34+
data: Any?
35+
) : super(x, shadowH, shadowL, open, close) {
36+
this.high = shadowH
37+
this.low = shadowL
38+
this.open = open
39+
this.close = close
40+
}
41+
42+
/**
43+
* Constructor.
44+
*
45+
* @param x The value on the x-axis
46+
* @param shadowH The (shadow) high value
47+
* @param shadowL The (shadow) low value
48+
* @param icon Icon image
49+
*/
50+
constructor(
51+
x: Float, shadowH: Float, shadowL: Float, open: Float, close: Float,
52+
icon: Drawable?
53+
) : super(x, shadowH, shadowL, open, close) {
54+
this.high = shadowH
55+
this.low = shadowL
56+
this.open = open
57+
this.close = close
58+
}
59+
60+
/**
61+
* Constructor.
62+
*
63+
* @param x The value on the x-axis
64+
* @param shadowH The (shadow) high value
65+
* @param shadowL The (shadow) low value
66+
* @param icon Icon image
67+
* @param data Spot for additional data this Entry represents
68+
*/
69+
constructor(
70+
x: Float, shadowH: Float, shadowL: Float, open: Float, close: Float,
71+
icon: Drawable?, data: Any?
72+
) : super(x, shadowH, shadowL, open, close) {
73+
this.high = shadowH
74+
this.low = shadowL
75+
this.open = open
76+
this.close = close
77+
}
78+
79+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package info.appdev.charting.data
2+
3+
import android.R.attr.data
4+
import android.R.attr.x
5+
import android.R.attr.y
6+
import android.graphics.drawable.Drawable
7+
import android.os.Build
8+
import android.os.Parcel
9+
import android.os.ParcelFormatException
10+
import android.os.Parcelable
11+
import info.appdev.charting.utils.Utils
12+
import java.io.Serializable
13+
import kotlin.math.abs
14+
15+
/**
16+
* Class representing one entry in the chart. Might contain multiple values.
17+
* Might only contain a single value depending on the used constructor.
18+
*/
19+
@Deprecated("The replacement is EntryFloat, or use EntryDouble for higher precision. Entry is retained for backward compatibility but will be removed in a future version.")
20+
class Entry : EntryFloat {
21+
22+
constructor()
23+
24+
/**
25+
* An EntryFloat represents one single entry in the chart.
26+
*
27+
* @param x the x value
28+
* @param y the y value (the actual value of the entry)
29+
*/
30+
constructor(x: Float, y: Float) : super(x = x, y = y)
31+
32+
/**
33+
* An EntryFloat represents one single entry in the chart.
34+
*
35+
* @param x the x value
36+
* @param y the y value (the actual value of the entry)
37+
* @param data Spot for additional data this Entry represents.
38+
*/
39+
constructor(x: Float, y: Float, data: Any?) : super(x = x, y = y, data = data)
40+
41+
/**
42+
* An EntryFloat represents one single entry in the chart.
43+
*
44+
* @param x the x value
45+
* @param y the y value (the actual value of the entry)
46+
* @param icon icon image
47+
*/
48+
constructor(x: Float, y: Float, icon: Drawable?) : super(x = x, y = y, icon = icon)
49+
50+
/**
51+
* An EntryFloat represents one single entry in the chart.
52+
*
53+
* @param x the x value
54+
* @param y the y value (the actual value of the entry)
55+
* @param icon icon image
56+
* @param data Spot for additional data this EntryFloat represents.
57+
*/
58+
constructor(x: Float, y: Float, icon: Drawable?, data: Any?) : super(x = x, y = y, icon = icon, data = data)
59+
60+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package info.appdev.charting.data
2+
3+
import android.graphics.drawable.Drawable
4+
5+
@Deprecated("The replacement is PieEntryFloat, or use PieEntryDouble for higher precision. PieEntry is retained for backward compatibility but will be removed in a future version.")
6+
class PieEntry : PieEntryFloat {
7+
8+
constructor(value: Float) : super(0f)
9+
10+
constructor(value: Float, data: Any?) : super(value, data)
11+
12+
constructor(value: Float, icon: Drawable?) : super(value, icon)
13+
14+
constructor(value: Float, icon: Drawable?, data: Any?) : super(value, icon, data)
15+
16+
constructor(value: Float, label: String?) : super(value) {
17+
this.label = label
18+
}
19+
20+
constructor(value: Float, label: String?, data: Any?) : super(value, data) {
21+
this.label = label
22+
}
23+
24+
constructor(value: Float, label: String?, icon: Drawable?) : super(value, icon) {
25+
this.label = label
26+
}
27+
28+
constructor(value: Float, label: String?, icon: Drawable?, data: Any?) : super(value, icon, data) {
29+
this.label = label
30+
}
31+
32+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package info.appdev.charting.data
2+
3+
@Deprecated("The replacement is RadarEntryFloat, or use RadarEntryDouble for higher precision. RadarEntry is retained for backward compatibility but will be removed in a future version.")
4+
class RadarEntry : RadarEntryFloat {
5+
constructor(value: Float) : super(value)
6+
7+
constructor(value: Float, data: Any?) : super(value, data)
8+
9+
}

0 commit comments

Comments
 (0)