Commit graph

1357 commits

Author SHA1 Message Date
almic
aea2ff3417
Add option to set minimum angles
Allows to force minimum slice angles when drawing charts, which means that any
slices with angles lower than the minimum will be drawn with the minimum angle.

When changing this setting on the fly, you have to call
`notifyDataSetChanged()` and `invalidate()` for the minimum angle to take
effect.

This only functions if all slices can be drawn with the minimum angle. For
example if a chart has 5 slices, the largest functioning minimum angle is
`72f` degrees on a 360 degree chart, or 20% of the chart's `maxAngle`.
2018-11-15 09:51:46 -07:00
almic
42cdba535f
Add Curved Slices to Pie Chart
Finally added support for rounded slices, and somewhat improved the code
for the PieChartRenderer class.
2018-11-12 10:59:48 -07:00
almic
29f4cc5c2c
Remove unnecessary API checks
Also added run configuration for the MPChartExample.
Removed deprecated Legend stuff.
2018-11-11 09:40:37 -07:00
almic
fc0e234298
Remove Deprecated Things
Long deprecated Legend constructor and positioning has been removed, it was
replaced with a new way to position the Legend.

The old Easing options have been removed now, accessing them is as easy as
removing the `EasingOption` part, such that the names look like
`Easing.Linear` or `Easing.EaseInOutQuad` now.
2018-11-07 14:52:25 -07:00
almic
e5b66192e7
New ValueFormatter
I created a simplified value formatter class, which is an abstract class rather
than an interface.

The switch was chosen because the new format has all the methods predefined
(something an interface wouldn't allow) meaning you can extend it and only
change what you want. This also means that you only need one value formatting
class for labels rather than two different classes, it just makes more sense.

Please check the method signatures to learn how to use them, I'm sure you'll
find this new format is much more customizable and faster to use.

I've made the class abstract even though there are no abstract methods or
fields, this is because it would certainly be a mistake to create a
ValueFormatter and not override any methods.

To convert existing code, just use 'extends' instead of 'implements' and change
the names to 'ValueFormatter'. You'll need to change the methods you overwrite
as well, just check the class and use the one you need.
2018-11-07 12:41:53 -07:00
almic
9148f37f9e
Bump version to 3.1.0-alpha 2018-10-29 13:23:18 -06:00
Mick A
6ce99326ae
Merge pull request #2273 from vpop/update/unused-local
Remove unused local variable
2018-10-27 21:56:40 -06:00
Mick A
129ad15fd0
Merge pull request #2187 from vpop/update/redundant-nullcheck
Remove nullcheck for known non-null variable
2018-10-27 21:42:36 -06:00
almic
5030b36c86
More Cleanup
I've removed the realm examples, mainly because the library was buggy.
In the previous commit, I already removed the examples from the list
since they didn't add anything to the overall demonstration. I thought
that if anyone wants to use realm.io with the charts, they can see the
actual library.

The file structure has been updated to match how Android Studio does
things. Some files added way back when have been deleted as they don't
do anything but cause the linter to freak out about 'unused properties'

All 'build.gradle' files have been refreshed as well.

Small addition to the README file to add a quick way to reach sections
of the page.
2018-10-27 18:00:06 -06:00
almic
d67ea481af
Huge Project Refresh
Before anyone freaks out, all these changes are under-the-hood, meaning that you probably won't even notice them at all.

The biggest difference is raising the minSdkVersion from 9 to 14. Recently android bumped this number interally as there are basically no devices running lower than 14 anymore. Sorry but you are just wasting your time if you are trying to support anything lower than 14 now.

The next biggest change is updating the project to the new AndroidX libraries, which changes some imports and nothing else really.

The third biggest change is fixing a few bugs in the code that cause values to be drawn even if there are none, which results in your app crashing. Surprisingly, these checks already existed in a few of the newer chart types, but most lacked this simple check.

Other than those three changes, nothing else is functionally different. Well, saving to gallery works on all charts in the example app now, and you can quickly see the code for each example in the menus.

The only real potential "breaking" change is that charts are now saved as PNGs by default instead of JPGs if you go the route of not specifying as a JPG. You may want to double check your file sizes as PNGs can be larger than low quality JPGs.

I still have more plans for simplifying the API and fixing other issues with the project, for the small few that closely pay attention to individual commits: there's going to be more soon.
2018-10-26 10:30:22 -06:00
Mick A
1485cdc687
Merge pull request #3451 from davidgoli/add-grid-lines-on-top-of-data
Add option to draw limit lines on top of data
2018-05-09 09:12:49 -06:00
Mick A
53de181607
Merge pull request #3478 from MaximPestryakov/patch-1
Refactored LargeValueFormatter
2018-05-09 09:07:06 -06:00
Mick A
9ee3a74633
Merge pull request #4013 from RobertZagorski/bugfix/#2369-legend-offset-is-not-calculated-twice-for-line-chart
Remove mLabelRotatedHeight counted twice, when calculating legend offset
2018-05-09 08:36:07 -06:00
Mick A
73054bedc3
Merge pull request #3642 from pagrzybe/autoscale_restrictions
Option to set restrictions for Y axis autoscaling.
2018-05-09 08:29:22 -06:00
Maxim Pestryakov
5869c9de23
Fixed Javadoc 2018-05-09 16:03:48 +03:00
RobertZagorski
89436221db Remove mLabelRotatedHeight counted twice, when calculating legend offsets. (Fix for #2369).
Removed statements where completely not needed as calculating offsets is alredy done in BarLineCharBase#calculateOffsets(...)
2018-05-09 08:44:22 +02:00
Pawel Grzybek
92c14db5b4 Fixed code review comments. 2018-05-09 08:09:03 +02:00
RobertZagorski
7abc9cd669 Update and reorganise copy data sets methods (Fix for #1604).
Copying class properties is always done in protected copy method.
2018-05-08 16:19:09 +02:00
Mick A
c08ec81fc0
Merge pull request #4001 from oatrice/feature/muti_gradient
[Feature] Multiple gradient color for barchart
2018-05-05 09:18:14 -06:00
Anirut Teerabut
e4ba3cdc20 - multiple gradient color 2018-05-04 04:21:26 +07:00
Mick A
0378e763ae
Merge pull request #2856 from stephenmcbride/master
Fix for missing setters in getInstance method
2018-05-02 10:42:40 -06:00
Mick A
89e50c8c9b
Merge pull request #3982 from almic/yaxis-calc
Remove YAxis Custom Min/Max Check for Padding
2018-05-01 21:29:15 -06:00
Mick A
640208c8ff
Merge pull request #3820 from longup/master
Fix last entry clipping bug #3819
2018-05-01 21:19:05 -06:00
almic
35c9fc937e
refactor(EasingFunction): Simplified EasingFunction
EasingFunction has been simplified greatly, and I've added a MUCH needed
annotation to relevant methods.

Easing.EasingOptions has been deprecated, as well as any methods using
them. Converting is as simple as deleting the "EasingOptions" part.

A new signature is available for animateXY()!

You are now able to pass one EasingFunction to animateXY() if you want
both axes to be animated the same way.

Quietly included are some gradle build updates, incrementing the
appcompat version to 27.1.1, and using the new `javacompiler` to avoid
deprecation of `javacompile`
2018-04-30 12:24:18 -06:00
Mick A
89d18a7f67
Merge pull request #3207 from scottkennedy/weakref-fixes
Fix some potential NPEs with WeakReference usage
2018-04-30 08:15:48 -06:00
Mick A
9997a33524
Merge pull request #3975 from hannesa2/AndroidStudio3.1.2
update to Android Studio 3.1.2
2018-04-28 19:12:26 -06:00
Hannes Achleitner
d8ea67aa21 update to Android Studio 3.1.2 2018-04-28 19:54:22 +02:00
almic
e1411f169e
Remove Custom Check
calculate() no longer checks if min and max is custom, it just adds the padding.
2018-04-27 00:08:27 -06:00
sembozdemir
1e6e58d2c0 Add option for using slice color as value line color
Fixes: #3897
2018-03-28 20:23:51 +03:00
zhanglong
aee6058dbb Avoid that the last label entry in the x-labels clip off the edge of the screen #3819 2018-02-27 15:04:47 +08:00
Pawel Grzybek
e416736ad5 Added option to set restrictions for Y axis autoscaling. 2017-12-10 20:19:06 +01:00
Philipp Jahoda
5e97f561f7 Update version 2017-11-29 16:06:58 +01:00
Philipp Jahoda
f2dedb30de Update gradle and dependencies 2017-11-29 15:23:57 +01:00
Maxim Pestryakov
d3c339da10 Refactored LargeValueFormatter 2017-10-06 17:12:46 +03:00
davidgoli
c97b8d531d add option to draw limit lines on top of data 2017-09-22 18:57:07 -07:00
Daniel Cohen Gindi
72031d33ca Allow locking drag on either axes 2017-09-08 11:00:45 +03:00
Daniel Cohen Gindi
ea93823f63 Fix CombinedChartView not drawing markers 2017-09-08 10:13:12 +03:00
Daniel Cohen Gindi
ed770762fb Add default x spacing (half width) for scatter chart as well 2017-08-25 12:15:42 +03:00
Daniel Cohen Gindi
98f97f0df1 Run view port jobs after applying changes 2017-08-25 12:13:45 +03:00
Scott Kennedy
43ae497ecf Fix some potential NPEs with WeakReference usage
Even if the WeakReference field is not null, the contained value may be null.  Additionally, you always need a strong reference to the value to ensure it isn't garbage collected while you're using it.
2017-06-26 10:51:58 -07:00
Daniel Cohen Gindi
acf985ff0c Clear lastHighlighted when clear is called 2017-04-26 20:45:12 +03:00
PhilJay
557e55653b Remove line width minimum constraint 2017-03-23 16:15:16 +01:00
PhilJay
b564704b82 Updating versions 2017-03-23 16:13:21 +01:00
Stephen McBride
6c54f0b0a9 Fix for missing setters in getInstance method
The zoomAndCenterAnimated method in BarLineChartBase crashes with a NullPointer exception because the yAxis variable is null when onAnimationUpdate is called. The yAxis is null because of missing setters in the getInstance method of AnimatedZoomJob.
2017-02-28 15:58:42 +13:00
Daniel Cohen Gindi
0c919ab02d Consider isEnabled in more axis rendering cases 2017-02-22 17:29:33 +02:00
Daniel Cohen Gindi
3ec493fc0c Merge pull request #2414 from Ewg777/patch-1
Fixed docs typo in AxisBase.java
2017-02-21 16:39:27 +02:00
Daniel Cohen Gindi
31b60225d0 Merge pull request #2622 from patrick-iv/fix_circle_inherit_alpha
Fix circles inherit alpha #2620
2017-02-21 16:38:39 +02:00
Daniel Cohen Gindi
886cc9f85d Merge pull request #2621 from patrick-iv/fix_default_text_size
Fix for default text size being set in PX instead of DP
2017-02-21 16:36:02 +02:00
Daniel Cohen Gindi
28166a01d1 Merge pull request #2814 from travisfw/utf8-javadoc
Set javadoc character encoding to utf8
2017-02-21 16:33:11 +02:00
Daniel Cohen Gindi
a5e0a9b86c Moved auto scale before render of axis lines
https://github.com/danielgindi/Charts/pull/2177
2017-02-21 14:24:13 +02:00