PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.55k stars 9.01k forks source link

LimitLine enableDashedLine not working #494

Closed aint closed 9 years ago

aint commented 9 years ago

Code from example :

        LimitLine ll1 = new LimitLine(130f, "Upper Limit");
        ll1.setLineWidth(4f);
        ll1.enableDashedLine(10f, 10f, 0f); // <--
        ll1.setLabelPosition(LimitLabelPosition.POS_RIGHT);
        ll1.setTextSize(10f);

        LimitLine ll2 = new LimitLine(-30f, "Lower Limit");
        ll2.setLineWidth(4f);
        ll2.enableDashedLine(10f, 10f, 0f);  // <--
        ll2.setLabelPosition(LimitLabelPosition.POS_RIGHT);
        ll2.setTextSize(10f);

screenshot_2015-03-31-18-01-55

mesropd commented 9 years ago

Disable hardware acceleration chart.setHardwareAccelerationEnabled(false);

aint commented 9 years ago

Thanks for quick response, but doesn't work.

mesropd commented 9 years ago

Very strange, it works well on my 3 devices, on which device you run it and which android version?

aint commented 9 years ago

Yes, it's very strange. My device Motorola XT881, Android 4.1.2. Also I have tested on various emulators:

screen shot 2015-03-31 at 8 06 05 pm

PhilJay commented 9 years ago

Are you using the latest version of the library? This works for me.

neotel commented 9 years ago

I have the same problem on Galaxy S4. Any idea?

aint commented 9 years ago

I checked out last commit just now and reproduce this bug if API <= 17. Tested on the standard Android emulators, GenyMotion x86 emulators and on my own device. The most strange thing is that LineDataSet's enableDashedLine() works like a charm.

screen shot 2015-04-02 at 6 48 36 pm

PhilJay commented 9 years ago

Finally found the bug, please try the latest commit :-)