├── app ├── .gitignore ├── testDemoKey.jks ├── src │ ├── main │ │ ├── assets │ │ │ ├── stacked_bars.txt │ │ │ ├── OpenSans-Bold.ttf │ │ │ ├── OpenSans-Light.ttf │ │ │ ├── OpenSans-Italic.ttf │ │ │ ├── OpenSans-Regular.ttf │ │ │ ├── OpenSans-BoldItalic.ttf │ │ │ ├── OpenSans-ExtraBold.ttf │ │ │ ├── OpenSans-Semibold.ttf │ │ │ ├── OpenSans-LightItalic.ttf │ │ │ ├── OpenSans-ExtraBoldItalic.ttf │ │ │ ├── OpenSans-SemiboldItalic.ttf │ │ │ └── n.txt │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── star.png │ │ │ │ ├── marker2.png │ │ │ │ ├── radar_marker.png │ │ │ │ └── fade_red.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ │ └── colors.xml │ │ │ ├── menu │ │ │ │ ├── only_github.xml │ │ │ │ ├── menu_right.xml │ │ │ │ ├── main.xml │ │ │ │ ├── combined.xml │ │ │ │ ├── realtime.xml │ │ │ │ ├── dynamical.xml │ │ │ │ ├── draw.xml │ │ │ │ ├── bubble.xml │ │ │ │ ├── scatter.xml │ │ │ │ ├── bar.xml │ │ │ │ ├── candle.xml │ │ │ │ ├── pie.xml │ │ │ │ ├── radar.xml │ │ │ │ └── line.xml │ │ │ ├── anim │ │ │ │ ├── move_left_in_activity.xml │ │ │ │ ├── move_right_in_activity.xml │ │ │ │ ├── move_left_out_activity.xml │ │ │ │ └── move_right_out_activity.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_mpmain.xml │ │ │ │ ├── frag_simple_bar.xml │ │ │ │ ├── activity_combined.xml │ │ │ │ ├── activity_draw_chart.xml │ │ │ │ ├── activity_piechart_half.xml │ │ │ │ ├── activity_radarchart.xml │ │ │ │ ├── activity_barchart_noseekbar.xml │ │ │ │ ├── activity_realtime_linechart.xml │ │ │ │ ├── activity_linechart_noseekbar.xml │ │ │ │ ├── activity_listview_chart.xml │ │ │ │ ├── list_item_barchart.xml │ │ │ │ ├── list_item_piechart.xml │ │ │ │ ├── list_item_linechart.xml │ │ │ │ ├── frag_simple_line.xml │ │ │ │ ├── frag_simple_pie.xml │ │ │ │ ├── fragment_kline.xml │ │ │ │ ├── frag_simple_scatter.xml │ │ │ │ ├── fragment_one_day.xml │ │ │ │ ├── fragment_five_day.xml │ │ │ │ ├── activity_age_distribution.xml │ │ │ │ ├── activity_awesomedesign.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_stock_detail_land.xml │ │ │ │ ├── custom_marker_view.xml │ │ │ │ ├── list_item_section.xml │ │ │ │ ├── radar_markerview.xml │ │ │ │ ├── list_item.xml │ │ │ │ ├── activity_colored_lines.xml │ │ │ │ ├── activity_linechart_time.xml │ │ │ │ ├── activity_scrollview.xml │ │ │ │ ├── activity_barchart_sinus.xml │ │ │ │ ├── activity_performance_linechart.xml │ │ │ │ └── activity_stock_detail.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ └── java │ │ │ └── com │ │ │ └── android │ │ │ └── stockapp │ │ │ ├── common │ │ │ ├── data │ │ │ │ └── Constants.java │ │ │ ├── viewpager │ │ │ │ └── NoTouchScrollViewpager.java │ │ │ └── adapter │ │ │ │ └── SimpleFragmentPagerAdapter.java │ │ │ ├── ui │ │ │ ├── mpchartexample │ │ │ │ ├── notimportant │ │ │ │ │ └── ContentItem.java │ │ │ │ ├── listviewitems │ │ │ │ │ └── ChartItem.java │ │ │ │ ├── custom │ │ │ │ │ ├── MyFillFormatter.java │ │ │ │ │ ├── YearXAxisFormatter.java │ │ │ │ │ ├── CustomScatterShapeRenderer.java │ │ │ │ │ ├── MyValueFormatter.java │ │ │ │ │ ├── MyCustomXAxisValueFormatter.java │ │ │ │ │ ├── RadarMarkerView.java │ │ │ │ │ ├── MyMarkerView.java │ │ │ │ │ ├── XYMarkerView.java │ │ │ │ │ └── StackedBarsMarkerView.java │ │ │ │ └── fragments │ │ │ │ │ ├── ComplexityFragment.java │ │ │ │ │ └── SineCosineFragment.java │ │ │ ├── base │ │ │ │ ├── BaseApp.java │ │ │ │ └── BaseFragment.java │ │ │ ├── main │ │ │ │ └── MainActivity.java │ │ │ └── market │ │ │ │ └── activity │ │ │ │ └── StockDetailLandActivity.java │ │ │ └── application │ │ │ └── MyApplication.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── android │ │ │ └── stockapp │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── android │ │ └── stockapp │ │ └── ExampleInstrumentedTest.kt ├── stockChartKey.jks ├── proguard-rules.pro └── build.gradle ├── MPChartLib ├── .gitignore ├── ic_launcher-web.png ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── dot.png │ │ │ │ └── ring.png │ │ │ ├── drawable │ │ │ │ └── fade_fill_color.xml │ │ │ ├── drawable-night │ │ │ │ └── fade_fill_color.xml │ │ │ ├── values-night │ │ │ │ └── colors.xml │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── colors.xml │ │ │ ├── values-zh-rTW │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ ├── my_markerview.xml │ │ │ │ ├── view_kline.xml │ │ │ │ └── view_time.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── mikephil │ │ │ │ └── charting │ │ │ │ ├── stockChart │ │ │ │ ├── enums │ │ │ │ │ ├── TimeType.java │ │ │ │ │ └── ChartType.java │ │ │ │ ├── model │ │ │ │ │ ├── CirclePositionTime.java │ │ │ │ │ └── bean │ │ │ │ │ │ ├── EXPMAEntity.java │ │ │ │ │ │ ├── SMAEntity.java │ │ │ │ │ │ ├── KMAEntity.java │ │ │ │ │ │ └── CCIEntity.java │ │ │ │ ├── charts │ │ │ │ │ └── TimeXAxis.java │ │ │ │ ├── markerView │ │ │ │ │ ├── BarBottomMarkerView.java │ │ │ │ │ ├── TimeRightMarkerView.java │ │ │ │ │ ├── LeftMarkerView.java │ │ │ │ │ └── KRightMarkerView.java │ │ │ │ └── event │ │ │ │ │ └── BaseEvent.java │ │ │ │ ├── interfaces │ │ │ │ ├── dataprovider │ │ │ │ │ ├── BubbleDataProvider.java │ │ │ │ │ ├── CandleDataProvider.java │ │ │ │ │ ├── ScatterDataProvider.java │ │ │ │ │ ├── LineDataProvider.java │ │ │ │ │ ├── CombinedDataProvider.java │ │ │ │ │ ├── BarDataProvider.java │ │ │ │ │ ├── BarLineScatterCandleBubbleDataProvider.java │ │ │ │ │ └── ChartInterface.java │ │ │ │ └── datasets │ │ │ │ │ ├── IBarLineScatterCandleBubbleDataSet.java │ │ │ │ │ ├── IBubbleDataSet.java │ │ │ │ │ ├── IRadarDataSet.java │ │ │ │ │ ├── IScatterDataSet.java │ │ │ │ │ ├── ILineScatterCandleRadarDataSet.java │ │ │ │ │ ├── ILineRadarDataSet.java │ │ │ │ │ ├── ICandleDataSet.java │ │ │ │ │ └── IPieDataSet.java │ │ │ │ ├── highlight │ │ │ │ ├── IHighlighter.java │ │ │ │ ├── PieHighlighter.java │ │ │ │ ├── Range.java │ │ │ │ └── PieRadarHighlighter.java │ │ │ │ ├── exception │ │ │ │ └── DrawingDataSetNotCreatedException.java │ │ │ │ ├── animation │ │ │ │ └── EasingFunction.java │ │ │ │ ├── listener │ │ │ │ ├── OnDrawLineChartTouchListener.java │ │ │ │ ├── OnChartValueSelectedListener.java │ │ │ │ └── OnDrawListener.java │ │ │ │ ├── data │ │ │ │ ├── CandleData.java │ │ │ │ ├── LineData.java │ │ │ │ ├── BarLineScatterCandleBubbleData.java │ │ │ │ ├── BubbleData.java │ │ │ │ ├── ScatterData.java │ │ │ │ ├── RadarEntry.java │ │ │ │ ├── RadarData.java │ │ │ │ ├── BarLineScatterCandleBubbleDataSet.java │ │ │ │ └── BubbleDataSet.java │ │ │ │ ├── renderer │ │ │ │ ├── Renderer.java │ │ │ │ └── scatter │ │ │ │ │ ├── IShapeRenderer.java │ │ │ │ │ ├── CrossShapeRenderer.java │ │ │ │ │ ├── ChevronDownShapeRenderer.java │ │ │ │ │ ├── ChevronUpShapeRenderer.java │ │ │ │ │ └── XShapeRenderer.java │ │ │ │ ├── utils │ │ │ │ ├── EntryXComparator.java │ │ │ │ ├── HorizontalViewPortHandler.java │ │ │ │ ├── MPPointD.java │ │ │ │ ├── TransformerHorizontalBarChart.java │ │ │ │ └── FSize.java │ │ │ │ ├── model │ │ │ │ └── GradientColor.java │ │ │ │ ├── formatter │ │ │ │ ├── ColorFormatter.java │ │ │ │ ├── IFillFormatter.java │ │ │ │ ├── IAxisValueFormatter.java │ │ │ │ ├── IValueFormatter.java │ │ │ │ ├── DefaultFillFormatter.java │ │ │ │ ├── DefaultAxisValueFormatter.java │ │ │ │ ├── IndexAxisValueFormatter.java │ │ │ │ ├── PercentFormatter.java │ │ │ │ ├── DefaultValueFormatter.java │ │ │ │ └── VolFormatter.java │ │ │ │ ├── charts │ │ │ │ ├── CandleStickChart.java │ │ │ │ ├── BubbleChart.java │ │ │ │ └── LineChart.java │ │ │ │ ├── jobs │ │ │ │ ├── ViewPortJob.java │ │ │ │ └── MoveViewJob.java │ │ │ │ └── components │ │ │ │ └── IMarker.java │ │ └── AndroidManifest.xml │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── mikephil │ │ └── charting │ │ └── test │ │ └── ApproximatorTest.java ├── .settings │ └── gradle │ │ └── org.springsource.ide.eclipse.gradle.core.prefs ├── project.properties └── proguard-project.txt ├── settings.gradle ├── screenshot ├── kline.jpg ├── stock.png ├── fiveday.jpg ├── oneday.jpg ├── record.gif ├── record.mp4 ├── kline-land.jpg ├── stockChart.png └── oneday-land.jpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── caches │ └── build_file_checksums.ser ├── vcs.xml ├── runConfigurations.xml ├── modules.xml ├── gradle.xml ├── codeStyles │ └── Project.xml └── misc.xml ├── .gitignore ├── gradle.properties └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MPChartLib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.idea -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app',':MPChartLib' 2 | -------------------------------------------------------------------------------- /app/testDemoKey.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/testDemoKey.jks -------------------------------------------------------------------------------- /screenshot/kline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/kline.jpg -------------------------------------------------------------------------------- /screenshot/stock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/stock.png -------------------------------------------------------------------------------- /app/src/main/assets/stacked_bars.txt: -------------------------------------------------------------------------------- 1 | 4#2#6#0 2 | 0#2#8#1 3 | 3#8#2#2 4 | 0#7#0#3 5 | 5#5#2#4 6 | 9#0#0#5 7 | 3#3#6#6 -------------------------------------------------------------------------------- /app/stockChartKey.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/stockChartKey.jks -------------------------------------------------------------------------------- /screenshot/fiveday.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/fiveday.jpg -------------------------------------------------------------------------------- /screenshot/oneday.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/oneday.jpg -------------------------------------------------------------------------------- /screenshot/record.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/record.gif -------------------------------------------------------------------------------- /screenshot/record.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/record.mp4 -------------------------------------------------------------------------------- /screenshot/kline-land.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/kline-land.jpg -------------------------------------------------------------------------------- /screenshot/stockChart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/stockChart.png -------------------------------------------------------------------------------- /screenshot/oneday-land.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/screenshot/oneday-land.jpg -------------------------------------------------------------------------------- /MPChartLib/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/MPChartLib/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/drawable/star.png -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-Light.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable/marker2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/drawable/marker2.png -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-ExtraBold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable/radar_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/drawable/radar_marker.png -------------------------------------------------------------------------------- /MPChartLib/src/main/res/mipmap-xhdpi/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/MPChartLib/src/main/res/mipmap-xhdpi/dot.png -------------------------------------------------------------------------------- /MPChartLib/src/main/res/mipmap-xhdpi/ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/MPChartLib/src/main/res/mipmap-xhdpi/ring.png -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/OpenSans-SemiboldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/assets/OpenSans-SemiboldItalic.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LambdaXiao/StockChart-MPAndroidChart/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #1d1d1f 4 | #242426 5 | #FFFFFF 6 | -------------------------------------------------------------------------------- /app/src/main/res/menu/only_github.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/move_left_in_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/move_right_in_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/stockChart/enums/TimeType.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.stockChart.enums; 2 | 3 | /** 4 | * Created by Administrator on 2018/4/22. 5 | */ 6 | 7 | public enum TimeType { 8 | TIME_HOUR, 9 | TIME_DATE 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/move_left_out_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/move_right_out_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/fade_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 24 18:32:06 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /MPChartLib/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Mon Jan 18 23:02:46 CET 2016 3 | org.springsource.ide.eclipse.gradle.linkedresources= 4 | org.springsource.ide.eclipse.gradle.rootprojectloc=.. 5 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/drawable/fade_fill_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/drawable-night/fade_fill_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/stockapp/common/data/Constants.java: -------------------------------------------------------------------------------- 1 | package com.android.stockapp.common.data; 2 | 3 | /** 4 | * 公共常量 5 | */ 6 | public class Constants { 7 | public static String SP_FILE = "dayNightModeFile";//SharedPreferences存储文件名 8 | public static String DAY_NIGHT_MODE = "dayNightMode";//夜间模式key 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_mpmain.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/BubbleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.data.BubbleData; 4 | 5 | public interface BubbleDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | BubbleData getBubbleData(); 8 | } 9 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/CandleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.data.CandleData; 4 | 5 | public interface CandleDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | CandleData getCandleData(); 8 | } 9 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/ScatterDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.data.ScatterData; 4 | 5 | public interface ScatterDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | ScatterData getScatterData(); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #3F51B5 5 | #3F51B5 6 | 7 | #F5F5F5 8 | #FFFFFF 9 | #333333 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frag_simple_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/test/java/com/android/stockapp/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.android.stockapp 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MPChartLib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/LineDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.components.YAxis; 4 | import com.github.mikephil.charting.data.LineData; 5 | 6 | public interface LineDataProvider extends BarLineScatterCandleBubbleDataProvider { 7 | 8 | LineData getLineData(); 9 | 10 | YAxis getAxis(YAxis.AxisDependency dependency); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_combined.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_draw_chart.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_piechart_half.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_radarchart.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/highlight/IHighlighter.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.highlight; 2 | 3 | /** 4 | * Created by philipp on 10/06/16. 5 | */ 6 | public interface IHighlighter { 7 | 8 | /** 9 | * Returns a Highlight object corresponding to the given x- and y- touch positions in pixels. 10 | * 11 | * @param x 12 | * @param y 13 | * @return 14 | */ 15 | Highlight getHighlight(float x, float y); 16 | } 17 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/CombinedDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.data.CombinedData; 4 | 5 | /** 6 | * Created by philipp on 11/06/16. 7 | */ 8 | public interface CombinedDataProvider extends LineDataProvider, BarDataProvider, BubbleDataProvider, CandleDataProvider, ScatterDataProvider { 9 | 10 | CombinedData getCombinedData(); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_barchart_noseekbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_realtime_linechart.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_linechart_noseekbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ffffff 5 | #323232 6 | #323232 7 | #A7ADBC 8 | #ffffff 9 | #ffffff 10 | #7F2C3840 11 | 12 | 13 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/BarDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.data.BarData; 4 | 5 | public interface BarDataProvider extends BarLineScatterCandleBubbleDataProvider { 6 | 7 | BarData getBarData(); 8 | 9 | boolean isDrawBarShadowEnabled(); 10 | 11 | boolean isDrawValueAboveBarEnabled(); 12 | 13 | boolean isHighlightFullBarEnabled(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_listview_chart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_barchart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_piechart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item_linechart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frag_simple_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frag_simple_pie.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/stockChart/model/CirclePositionTime.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.stockChart.model; 2 | 3 | /** 4 | * Created by Administrator on 2016/9/18. 5 | */ 6 | public class CirclePositionTime { 7 | public float cx; 8 | public float cy; 9 | 10 | @Override 11 | public String toString() { 12 | return "CirclePositionTime{" + 13 | "cx=" + cx + 14 | ", cy=" + cy + 15 | '}'; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_kline.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/exception/DrawingDataSetNotCreatedException.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.exception; 2 | 3 | public class DrawingDataSetNotCreatedException extends RuntimeException { 4 | 5 | /** 6 | * 7 | */ 8 | private static final long serialVersionUID = 1L; 9 | 10 | public DrawingDataSetNotCreatedException() { 11 | super("Have to create a new drawing set first. Call ChartData's createNewDrawingDataSet() method"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/frag_simple_scatter.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_one_day.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | StockApp 3 | 加载中... 4 | 暂无数据 5 | 成交量 6 | 亿手 7 | 万手 8 | 9 | 亿股 10 | 万股 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_five_day.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/animation/EasingFunction.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.animation; 2 | 3 | import android.animation.TimeInterpolator; 4 | import android.annotation.SuppressLint; 5 | 6 | /** 7 | * Interface for creating custom made easing functions. Uses the 8 | * TimeInterpolator interface provided by Android. 9 | */ 10 | @SuppressLint("NewApi") 11 | public interface EasingFunction extends TimeInterpolator { 12 | 13 | @Override 14 | float getInterpolation(float input); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_age_distribution.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_awesomedesign.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/listener/OnDrawLineChartTouchListener.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.listener; 2 | 3 | import android.view.GestureDetector.SimpleOnGestureListener; 4 | import android.view.MotionEvent; 5 | import android.view.View; 6 | import android.view.View.OnTouchListener; 7 | 8 | public class OnDrawLineChartTouchListener extends SimpleOnGestureListener implements OnTouchListener { 9 | 10 | @Override 11 | public boolean onTouch(View v, MotionEvent event) { 12 | return false; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | StockApp 4 | 加載中... 5 | 暫無數據 6 | 成交量 7 | 億手 8 | 萬手 9 | 10 | 億股 11 | 萬股 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/stockapp/ui/mpchartexample/notimportant/ContentItem.java: -------------------------------------------------------------------------------- 1 | package com.android.stockapp.ui.mpchartexample.notimportant; 2 | 3 | /** 4 | * Created by Philipp Jahoda on 07/12/15. 5 | */ 6 | class ContentItem { 7 | 8 | final String name; 9 | final String desc; 10 | boolean isSection = false; 11 | 12 | ContentItem(String n) { 13 | name = n; 14 | desc = ""; 15 | isSection = true; 16 | } 17 | 18 | ContentItem(String n, String d) { 19 | name = n; 20 | desc = d; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/stockChart/charts/TimeXAxis.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.stockChart.charts; 2 | 3 | import android.util.SparseArray; 4 | 5 | import com.github.mikephil.charting.components.XAxis; 6 | 7 | /** 8 | * Created by loro on 2017/2/8. 9 | */ 10 | public class TimeXAxis extends XAxis { 11 | private SparseArray labels; 12 | 13 | public SparseArray getXLabels() { 14 | return labels; 15 | } 16 | 17 | public void setXLabels(SparseArray labels) { 18 | this.labels = labels; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/data/CandleData.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.data; 2 | 3 | import com.github.mikephil.charting.interfaces.datasets.ICandleDataSet; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class CandleData extends BarLineScatterCandleBubbleData { 9 | 10 | public CandleData() { 11 | super(); 12 | } 13 | 14 | public CandleData(List dataSets) { 15 | super(dataSets); 16 | } 17 | 18 | public CandleData(ICandleDataSet... dataSets) { 19 | super(dataSets); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/renderer/Renderer.java: -------------------------------------------------------------------------------- 1 | 2 | package com.github.mikephil.charting.renderer; 3 | 4 | import com.github.mikephil.charting.utils.ViewPortHandler; 5 | 6 | /** 7 | * Abstract baseclass of all Renderers. 8 | * 9 | * @author Philipp Jahoda 10 | */ 11 | public abstract class Renderer { 12 | 13 | /** 14 | * the component that handles the drawing area of the chart and it's offsets 15 | */ 16 | protected ViewPortHandler mViewPortHandler; 17 | 18 | public Renderer(ViewPortHandler viewPortHandler) { 19 | this.mViewPortHandler = viewPortHandler; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/layout/my_markerview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /MPChartLib/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-23 15 | android.library=true 16 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/utils/EntryXComparator.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.utils; 2 | 3 | import com.github.mikephil.charting.data.Entry; 4 | 5 | import java.util.Comparator; 6 | 7 | /** 8 | * Comparator for comparing Entry-objects by their x-value. 9 | * Created by philipp on 17/06/15. 10 | */ 11 | public class EntryXComparator implements Comparator { 12 | @Override 13 | public int compare(Entry entry1, Entry entry2) { 14 | float diff = entry1.getX() - entry2.getX(); 15 | 16 | if (diff == 0f) return 0; 17 | else { 18 | if (diff > 0f) return 1; 19 | else return -1; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/menu/combined.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.datasets; 2 | 3 | import com.github.mikephil.charting.data.Entry; 4 | 5 | /** 6 | * Created by philipp on 21/10/15. 7 | */ 8 | public interface IBarLineScatterCandleBubbleDataSet extends IDataSet { 9 | 10 | /** 11 | * Returns the color that is used for drawing the highlight indicators. 12 | * 13 | * @return 14 | */ 15 | int getHighLightColor(); 16 | 17 | /** 18 | * Returns the line-width in which highlight lines are to be drawn. 19 | * 20 | * @return 21 | */ 22 | float getHighlightLineWidth(); 23 | } 24 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/data/LineData.java: -------------------------------------------------------------------------------- 1 | 2 | package com.github.mikephil.charting.data; 3 | 4 | import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Data object that encapsulates all data associated with a LineChart. 11 | * 12 | * @author Philipp Jahoda 13 | */ 14 | public class LineData extends BarLineScatterCandleBubbleData { 15 | 16 | public LineData() { 17 | super(); 18 | } 19 | 20 | public LineData(ILineDataSet... dataSets) { 21 | super(dataSets); 22 | } 23 | 24 | public LineData(List dataSets) { 25 | super(dataSets); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.dataprovider; 2 | 3 | import com.github.mikephil.charting.components.YAxis.AxisDependency; 4 | import com.github.mikephil.charting.data.BarLineScatterCandleBubbleData; 5 | import com.github.mikephil.charting.utils.Transformer; 6 | 7 | public interface BarLineScatterCandleBubbleDataProvider extends ChartInterface { 8 | 9 | Transformer getTransformer(AxisDependency axis); 10 | 11 | boolean isInverted(AxisDependency axis); 12 | 13 | float getLowestVisibleX(); 14 | 15 | float getHighestVisibleX(); 16 | 17 | @Override 18 | BarLineScatterCandleBubbleData getData(); 19 | } 20 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/model/GradientColor.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.model; 2 | 3 | public class GradientColor { 4 | 5 | private int startColor; 6 | private int endColor; 7 | 8 | public GradientColor(int startColor, int endColor) { 9 | this.startColor = startColor; 10 | this.endColor = endColor; 11 | } 12 | 13 | public int getStartColor() { 14 | return startColor; 15 | } 16 | 17 | public void setStartColor(int startColor) { 18 | this.startColor = startColor; 19 | } 20 | 21 | public int getEndColor() { 22 | return endColor; 23 | } 24 | 25 | public void setEndColor(int endColor) { 26 | this.endColor = endColor; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/realtime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | 20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/android/stockapp/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.android.stockapp 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.android.stockapp", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/stockapp/common/viewpager/NoTouchScrollViewpager.java: -------------------------------------------------------------------------------- 1 | package com.android.stockapp.common.viewpager; 2 | 3 | import android.content.Context; 4 | import androidx.viewpager.widget.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | public class NoTouchScrollViewpager extends ViewPager{ 9 | public NoTouchScrollViewpager(Context context) { 10 | this(context, null); 11 | } 12 | 13 | public NoTouchScrollViewpager(Context context, AttributeSet attrs) { 14 | super(context, attrs); 15 | } 16 | 17 | @Override 18 | public boolean onTouchEvent(MotionEvent ev) { 19 | return false; 20 | } 21 | 22 | @Override 23 | public boolean onInterceptTouchEvent(MotionEvent arg0) { 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IBubbleDataSet.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.interfaces.datasets; 2 | 3 | import com.github.mikephil.charting.data.BubbleEntry; 4 | 5 | /** 6 | * Created by philipp on 21/10/15. 7 | */ 8 | public interface IBubbleDataSet extends IBarLineScatterCandleBubbleDataSet { 9 | 10 | /** 11 | * Sets the width of the circle that surrounds the bubble when highlighted, 12 | * in dp. 13 | * 14 | * @param width 15 | */ 16 | void setHighlightCircleWidth(float width); 17 | 18 | float getMaxSize(); 19 | 20 | boolean isNormalizeSizeEnabled(); 21 | 22 | /** 23 | * Returns the width of the highlight-circle that surrounds the bubble 24 | * @return 25 | */ 26 | float getHighlightCircleWidth(); 27 | } 28 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/data/BarLineScatterCandleBubbleData.java: -------------------------------------------------------------------------------- 1 | 2 | package com.github.mikephil.charting.data; 3 | 4 | import com.github.mikephil.charting.interfaces.datasets.IBarLineScatterCandleBubbleDataSet; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Baseclass for all Line, Bar, Scatter, Candle and Bubble data. 10 | * 11 | * @author Philipp Jahoda 12 | */ 13 | public abstract class BarLineScatterCandleBubbleData> 14 | extends ChartData { 15 | 16 | public BarLineScatterCandleBubbleData() { 17 | super(); 18 | } 19 | 20 | public BarLineScatterCandleBubbleData(T... sets) { 21 | super(sets); 22 | } 23 | 24 | public BarLineScatterCandleBubbleData(List sets) { 25 | super(sets); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/utils/HorizontalViewPortHandler.java: -------------------------------------------------------------------------------- 1 | 2 | package com.github.mikephil.charting.utils; 3 | 4 | /** 5 | * ViewPortHandler for HorizontalBarChart. 6 | */ 7 | public class HorizontalViewPortHandler extends ViewPortHandler { 8 | 9 | 10 | @Override 11 | public void setMinimumScaleX(float xScale) { 12 | setMinimumScaleY(xScale); 13 | } 14 | 15 | @Override 16 | public void setMinimumScaleY(float yScale) { 17 | setMinimumScaleX(yScale); 18 | } 19 | 20 | @Override 21 | public void setMinMaxScaleX(float minScaleX, float maxScaleX) { 22 | setMinMaxScaleY(minScaleX, maxScaleX); 23 | } 24 | 25 | @Override 26 | public void setMinMaxScaleY(float minScaleY, float maxScaleY) { 27 | setMinMaxScaleX(minScaleY, maxScaleY); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/stockapp/ui/mpchartexample/listviewitems/ChartItem.java: -------------------------------------------------------------------------------- 1 | package com.android.stockapp.ui.mpchartexample.listviewitems; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.github.mikephil.charting.data.ChartData; 7 | 8 | /** 9 | * Base class of the Chart ListView items 10 | * @author philipp 11 | * 12 | */ 13 | @SuppressWarnings("unused") 14 | public abstract class ChartItem { 15 | 16 | static final int TYPE_BARCHART = 0; 17 | static final int TYPE_LINECHART = 1; 18 | static final int TYPE_PIECHART = 2; 19 | 20 | ChartData mChartData; 21 | 22 | ChartItem(ChartData cd) { 23 | this.mChartData = cd; 24 | } 25 | 26 | public abstract int getItemType(); 27 | 28 | public abstract View getView(int position, View convertView, Context c); 29 | } 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | -------------------------------------------------------------------------------- /MPChartLib/src/main/res/layout/view_kline.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/stockapp/ui/mpchartexample/custom/MyFillFormatter.java: -------------------------------------------------------------------------------- 1 | package com.android.stockapp.ui.mpchartexample.custom; 2 | 3 | import com.github.mikephil.charting.formatter.IFillFormatter; 4 | import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; 5 | import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; 6 | 7 | /** 8 | * Created by Philipp Jahoda on 12/09/15. 9 | */ 10 | @SuppressWarnings("unused") 11 | public class MyFillFormatter implements IFillFormatter 12 | { 13 | 14 | private float fillPos; 15 | 16 | public MyFillFormatter(float fillPos) { 17 | this.fillPos = fillPos; 18 | } 19 | 20 | @Override 21 | public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) { 22 | // your logic could be here 23 | return fillPos; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/stockChart/enums/ChartType.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.stockChart.enums; 2 | 3 | /** 4 | * 画图类型 5 | */ 6 | public enum ChartType { 7 | ONE_DAY(241),//沪深股票当日分时线总点数 8 | FIVE_DAY(305),//沪深股票五日分时线总点数 9 | HK_ONE_DAY(331),//港股当日分时线总点数 10 | HK_FIVE_DAY(415),//港股五日分时线总点数 11 | US_ONE_DAY(390),//美股当日分时线总点数 12 | US_FIVE_DAY(488),//美股五日分时线总点数 13 | K_DAY_SMALL(100),//竖屏日K展示的总数据条数 14 | K_WEEK_SMALL(100),//竖屏周K展示的总数据条数 15 | K_MONTH_SMALL(100),//竖屏月K展示的总数据条数 16 | K_DAY_BIG(1000),//横屏日K展示的总数据条数 17 | K_WEEK_BIG(1000),//横屏周K展示的总数据条数 18 | K_MONTH_BIG(1000);//横屏月K展示的总数据条数 19 | 20 | 21 | private int pointNum = 0; 22 | 23 | ChartType(int num) { 24 | this.pointNum = num; 25 | } 26 | 27 | public int getPointNum() { 28 | return pointNum; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MPChartLib/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/highlight/PieHighlighter.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.highlight; 2 | 3 | import com.github.mikephil.charting.charts.PieChart; 4 | import com.github.mikephil.charting.data.Entry; 5 | import com.github.mikephil.charting.interfaces.datasets.IPieDataSet; 6 | 7 | /** 8 | * Created by philipp on 12/06/16. 9 | */ 10 | public class PieHighlighter extends PieRadarHighlighter { 11 | 12 | public PieHighlighter(PieChart chart) { 13 | super(chart); 14 | } 15 | 16 | @Override 17 | protected Highlight getClosestHighlight(int index, float x, float y) { 18 | 19 | IPieDataSet set = mChart.getData().getDataSet(); 20 | 21 | final Entry entry = set.getEntryForIndex(index); 22 | 23 | return new Highlight(index, entry.getY(), x, y, 0, set.getAxisDependency()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/formatter/ColorFormatter.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.formatter; 2 | 3 | import com.github.mikephil.charting.data.DataSet; 4 | import com.github.mikephil.charting.data.Entry; 5 | import com.github.mikephil.charting.interfaces.datasets.IDataSet; 6 | 7 | /** 8 | * Interface that can be used to return a customized color instead of setting 9 | * colors via the setColor(...) method of the DataSet. 10 | * 11 | * @author Philipp Jahoda 12 | */ 13 | public interface ColorFormatter { 14 | 15 | /** 16 | * Returns the color to be used for the given Entry at the given index (in the entries array) 17 | * 18 | * @param index index in the entries array 19 | * @param e the entry to color 20 | * @param set the DataSet the entry belongs to 21 | * @return 22 | */ 23 | int getColor(int index, Entry e, IDataSet set); 24 | } -------------------------------------------------------------------------------- /MPChartLib/src/main/java/com/github/mikephil/charting/formatter/IFillFormatter.java: -------------------------------------------------------------------------------- 1 | package com.github.mikephil.charting.formatter; 2 | 3 | import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; 4 | import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; 5 | 6 | /** 7 | * Interface for providing a custom logic to where the filling line of a LineDataSet 8 | * should end. This of course only works if setFillEnabled(...) is set to true. 9 | * 10 | * @author Philipp Jahoda 11 | */ 12 | public interface IFillFormatter { 13 | 14 | /** 15 | * Returns the vertical (y-axis) position where the filled-line of the 16 | * LineDataSet should end. 17 | * 18 | * @param dataSet the ILineDataSet that is currently drawn 19 | * @param dataProvider 20 | * @return 21 | */ 22 | float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider); 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 |