bmarrdev / android-DecoView-charting

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

addEdgeDetail works correctly only for 0.5f values, when setShowPointWhenEmpty(false) is not set #22

Closed target33 closed 8 years ago

target33 commented 8 years ago

If you use addEdgeDetail() with a value different from 0.5f (for example 0.2f), it works fine only if setShowPointWhenEmpty(false) is set. Otherwise it keeps on drawing edge detail with 0.5f value.

This works correctly:

      SeriesItem seriesItem1 = new SeriesItem.Builder(Color.argb(255, 64, 196, 0))
              .setRange(0, 100, 0)
              .setInitialVisibility(false)
              .setLineWidth(32f)
              .addEdgeDetail(new EdgeDetail(EdgeDetail.EdgeType.EDGE_OUTER, Color.parseColor("#22000000"), 0.2f))
              .setShowPointWhenEmpty(false)
              .build();

This draws a edge detail of 0.5f, instead of 0.2f:

      SeriesItem seriesItem1 = new SeriesItem.Builder(Color.argb(255, 64, 196, 0))
              .setRange(0, 100, 0)
              .setInitialVisibility(false)
              .setLineWidth(32f)
              .addEdgeDetail(new EdgeDetail(EdgeDetail.EdgeType.EDGE_OUTER, Color.parseColor("#22000000"), 0.2f))
              .build();
bmarrdev commented 8 years ago

After some trial and error I was able to reproduce this issue. It only occurs when executing EventType.EVENT_SHOW on the DecoView in addition to the conditions mentioned. I will try to allocate some time to resolve this issue next weekend.

bmarrdev commented 8 years ago

This is resolved in v1.2. Update your gradle file with the dependency:

compile 'com.github.bmarrdev:android-DecoView-charting:v1.2'