Skip to content

Commit 9bc999a

Browse files
committed
增加横向滚动,支持更多自定义图表,提供案例
1 parent f3f1dd6 commit 9bc999a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1758
-280
lines changed

README.en.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,25 @@
22

33
------
44
* [Chinese README](/README.md/)
5+
### version 1.4
6+
> support horizontal rolling and set width ratio.
7+
> to provide more cases
8+
>
9+
! [animation] (/img/zuoping.jpg)
510

11+
12+
! [animation] (/img/gif/tip.gif)
13+
### version 1.2 features
14+
15+
#### supports Tip and MarkView is highly customizable
16+
! [animation] (/img/gif/tip.gif)
17+
18+
### version 1.1 features
19+
20+
#### 1. ViewPager and a list of gestures to solve the conflict
21+
! [gesture conflict] (/img/gif/viewpager.gif)
22+
2. #### text rotation axis
23+
! [spin] (/img/gif/rotate_axis_value.gif)
624
* SmartChart is an Android chart framework that supports linear diagrams (broken lines, curves, scatter points) bar charts, area charts, pie charts, and 3D columnar diagrams to support a variety of configurations.
725
* [apk download url](/img/smartChart.apk)
826
## Function display
@@ -99,7 +117,7 @@ allprojects {
99117
> *Step 2. Add the dependency
100118
```gradle
101119
dependencies {
102-
compile 'com.github.huangyanbin:SmartChart:1.1'
120+
compile 'com.github.huangyanbin:SmartChart:1.4'
103121
}
104122
```
105123

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@
77

88
* [apk下载地址](/img/smartChart.apk)
99

10-
## 功能展示
1110

1211

13-
### 未来版本功能
14-
> 从实践看,还有很多需要开放更多功能。如果修改代码,可以满足几乎所有图表展示的功能。后面我将持续完善图表扩展内容。
12+
### 1.4 版本
13+
> 支持横向滚动,设置宽度比。
14+
> 提供更多案例
15+
> 后面将补充所有方法注释
1516
17+
![动画](/img/zuoping.jpg)
18+
19+
20+
![动画](/img/gif/tip.gif)
1621
### 1.2版本功能
1722

1823
#### 支持Tip和MarkView高度可定制化
@@ -124,7 +129,7 @@ allprojects {
124129
> *Step 2. Add the dependency
125130
```gradle
126131
dependencies {
127-
       compile 'com.github.huangyanbin:SmartChart:1.3.3'
132+
       compile 'com.github.huangyanbin:SmartChart:1.4'
128133
}
129134
```
130135

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<activity android:name=".Pie3DChartActivity"/>
3535
<activity android:name=".RotateActivity"/>
3636
<activity android:name=".CustomLineChartActivity"/>
37-
37+
<activity android:name=".TestChartActivity"/>
3838
</application>
3939

4040
</manifest>

app/src/main/java/com/bin/david/smartchart/AreaChartActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.daivd.chart.data.style.PointStyle;
2525
import com.daivd.chart.listener.OnClickColumnListener;
2626
import com.daivd.chart.provider.component.mark.BubbleMarkView;
27+
import com.daivd.chart.provider.component.point.LegendPoint;
2728
import com.daivd.chart.provider.component.point.Point;
2829

2930
import java.util.ArrayList;
@@ -134,7 +135,7 @@ protected void onCreate(Bundle savedInstanceState) {
134135
levelLine.getLineStyle().setEffect(effects2);
135136
lineChart.getProvider().addLevelLine(levelLine);
136137
lineChart.getLegend().setDirection(IComponent.BOTTOM);
137-
Point legendPoint = (Point) lineChart.getLegend().getPoint();
138+
LegendPoint legendPoint = (LegendPoint) lineChart.getLegend().getPoint();
138139
PointStyle style = legendPoint.getPointStyle();
139140
style.setShape(PointStyle.CIRCLE);
140141
lineChart.getLegend().setPercent(0.2f);
@@ -442,7 +443,7 @@ private void showLegendStyle(ChartStyle c) {
442443

443444
@Override
444445
public void onItemClick(String s, int position) {
445-
Point legendPoint = (Point) lineChart.getLegend().getPoint();
446+
LegendPoint legendPoint = (LegendPoint) lineChart.getLegend().getPoint();
446447
PointStyle style = legendPoint.getPointStyle();
447448
if(position == 0){
448449
style.setShape(PointStyle.SQUARE);

app/src/main/java/com/bin/david/smartchart/Bar3DChartActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.daivd.chart.data.style.PointStyle;
1717
import com.daivd.chart.listener.OnClickColumnListener;
1818
import com.daivd.chart.provider.component.mark.BubbleMarkView;
19+
import com.daivd.chart.provider.component.point.LegendPoint;
1920
import com.daivd.chart.provider.component.point.Point;
2021

2122
import java.util.ArrayList;
@@ -72,7 +73,7 @@ protected void onCreate(Bundle savedInstanceState) {
7273
levelLine.getLineStyle().setWidth(this,1).setColor(res.getColor(R.color.arc23)).setEffect(effects);
7374
bar3DChart.getProvider().addLevelLine(levelLine);
7475
bar3DChart.getProvider().setMarkView(new BubbleMarkView(this));
75-
Point legendPoint = (Point) bar3DChart.getLegend().getPoint();
76+
LegendPoint legendPoint = (LegendPoint) bar3DChart.getLegend().getPoint();
7677
PointStyle style = legendPoint.getPointStyle();
7778
style.setShape(PointStyle.CIRCLE);
7879
BaseAxis vaxis = bar3DChart.getLeftVerticalAxis();

app/src/main/java/com/bin/david/smartchart/BarChartActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.daivd.chart.data.style.PointStyle;
1717
import com.daivd.chart.listener.OnClickColumnListener;
1818
import com.daivd.chart.provider.component.mark.BubbleMarkView;
19+
import com.daivd.chart.provider.component.point.LegendPoint;
1920
import com.daivd.chart.provider.component.point.Point;
2021

2122
import java.util.ArrayList;
@@ -73,7 +74,7 @@ protected void onCreate(Bundle savedInstanceState) {
7374
barChart.getProvider().addLevelLine(levelLine);
7475
barChart.getLeftVerticalAxis().getGridStyle().setEffect(effects);
7576
barChart.getProvider().setMarkView(new BubbleMarkView(this));
76-
Point legendPoint = (Point) barChart.getLegend().getPoint();
77+
LegendPoint legendPoint = (LegendPoint) barChart.getLegend().getPoint();
7778
PointStyle style = legendPoint.getPointStyle();
7879
style.setShape(PointStyle.CIRCLE);
7980
BaseAxis vaxis = barChart.getLeftVerticalAxis();

app/src/main/java/com/bin/david/smartchart/BarLineChartActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.daivd.chart.provider.component.cross.DoubleDriCross;
2424
import com.daivd.chart.provider.component.level.LevelLine;
2525
import com.daivd.chart.provider.component.mark.BubbleMarkView;
26+
import com.daivd.chart.provider.component.point.LegendPoint;
2627
import com.daivd.chart.provider.component.point.Point;
2728

2829
import java.util.ArrayList;
@@ -112,7 +113,7 @@ protected void onCreate(Bundle savedInstanceState) {
112113
levelLine.getLineStyle().setEffect(effects2);
113114
barLineChart.getProvider().addLevelLine(levelLine);
114115
barLineChart.getLegend().setDirection(IComponent.BOTTOM);
115-
Point legendPoint = (Point)barLineChart.getLegend().getPoint();
116+
LegendPoint legendPoint = (LegendPoint) barLineChart.getLegend().getPoint();
116117
PointStyle style = legendPoint.getPointStyle();
117118
style.setShape(PointStyle.RECT);
118119
barLineChart.getLegend().setPercent(0.2f);
@@ -416,7 +417,7 @@ private void showLegendStyle(ChartStyle c) {
416417

417418
@Override
418419
public void onItemClick(String s, int position) {
419-
Point legendPoint = (Point)barLineChart.getLegend().getPoint();
420+
LegendPoint legendPoint = (LegendPoint) barLineChart.getLegend().getPoint();
420421
PointStyle style = legendPoint.getPointStyle();
421422
if(position == 0){
422423
style.setShape(PointStyle.SQUARE);

app/src/main/java/com/bin/david/smartchart/CustomLineChartActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.daivd.chart.listener.OnClickColumnListener;
2929
import com.daivd.chart.provider.component.cross.VerticalCross;
3030
import com.daivd.chart.provider.component.level.LevelLine;
31+
import com.daivd.chart.provider.component.point.LegendPoint;
3132
import com.daivd.chart.provider.component.point.Point;
3233
import com.daivd.chart.provider.component.tip.MultiLineBubbleTip;
3334
import com.daivd.chart.utils.DensityUtils;
@@ -151,7 +152,7 @@ public String[] format(LineData lineData, int position) {
151152
levelLine.getLineStyle().setEffect(effects2);
152153
lineChart.getProvider().addLevelLine(levelLine);
153154
lineChart.getLegend().setDirection(IComponent.BOTTOM);
154-
Point legendPoint = (Point)lineChart.getLegend().getPoint();
155+
LegendPoint legendPoint = (LegendPoint)lineChart.getLegend().getPoint();
155156
PointStyle style = legendPoint.getPointStyle();
156157
style.setShape(PointStyle.RECT);
157158
lineChart.getLegend().setPercent(0.2f);

app/src/main/java/com/bin/david/smartchart/LineChartActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.daivd.chart.data.style.PointStyle;
3535
import com.daivd.chart.listener.OnClickColumnListener;
3636
import com.daivd.chart.provider.component.point.IPoint;
37+
import com.daivd.chart.provider.component.point.LegendPoint;
3738
import com.daivd.chart.provider.component.point.Point;
3839
import com.daivd.chart.provider.component.tip.MultiLineBubbleTip;
3940
import com.daivd.chart.utils.DensityUtils;
@@ -165,7 +166,7 @@ public String[] format(LineData lineData, int position) {
165166
levelLine.getLineStyle().setEffect(effects2);
166167
lineChart.getProvider().addLevelLine(levelLine);
167168
lineChart.getLegend().setDirection(IComponent.BOTTOM);
168-
Point legendPoint = (Point) lineChart.getLegend().getPoint();
169+
LegendPoint legendPoint = (LegendPoint) lineChart.getLegend().getPoint();
169170
PointStyle style = legendPoint.getPointStyle();
170171
style.setShape(PointStyle.RECT);
171172
lineChart.getLegend().setPercent(0.2f);
@@ -494,7 +495,7 @@ private void showLegendStyle(ChartStyle c) {
494495

495496
@Override
496497
public void onItemClick(String s, int position) {
497-
Point legendPoint = (Point) lineChart.getLegend().getPoint();
498+
LegendPoint legendPoint = (LegendPoint) lineChart.getLegend().getPoint();
498499
PointStyle style = legendPoint.getPointStyle();
499500
if (position == 0) {
500501
style.setShape(PointStyle.SQUARE);

app/src/main/java/com/bin/david/smartchart/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ protected void onCreate(Bundle savedInstanceState) {
3535
items.add(new MainItem(RadarChartActivity.class,"Radar chart"));
3636
items.add(new MainItem(RoseChartActivity.class,"Rose chart"));
3737
items.add(new MainItem(BarLineChartActivity.class,"Bar line chart"));
38-
items.add(new MainItem(CustomLineChartActivity.class,"Custom line chart"));
38+
items.add(new MainItem(TestChartActivity.class,"Custom line chart1"));
39+
items.add(new MainItem(CustomLineChartActivity.class,"Custom line chart2"));
3940
items.add(new MainItem(ZoomChartListActivity.class,"scale chart List(Solving gesture conflict)"));
4041
items.add(new MainItem(RotateChartListActivity.class,"rotate chart List(Solving gesture conflict)"));
4142
itemAdapter = new ItemAdapter(items);

0 commit comments

Comments
 (0)