bmarrdev / android-DecoView-charting

DecoView: Android arc based animated charting library
Apache License 2.0
991 stars 194 forks source link

SeriesItem not starting at 0 #9

Closed mzilian closed 8 years ago

mzilian commented 8 years ago

Is it possible to add a SeriesItem that reaches for example from 25% to 50%, without having to overdraw the first 25%?

bmarrdev commented 8 years ago

When creating the series the setRange function lets you set the range as well as the initial position:

public Builder setRange(final float minValue, final float maxValue, final float initialValue)

In your case something like this should do the trick:

DecoView arcView = (DecoView)findViewById(R.id.dynamicArcView); SeriesItem seriesItem1 = new SeriesItem.Builder(Color.RED).setRange(0, 100, 25).build(); int series1Index = arcView.addSeries(seriesItem1); arcView.addEvent(new DecoEvent.Builder(50).setIndex(series1Index).setDelay(1000).build());

mzilian commented 8 years ago

But with this the red item starts at 0 and not at 25. I would like that there is only between 25 and 50 the red item. Am I missing something?

bmarrdev commented 8 years ago

If you want the total range of the series to run from 25 to 50 use setRange(25, 50, 25).