halfhp / androidplot

Charts and plots for Android
http://androidplot.com
Apache License 2.0
505 stars 159 forks source link

setLinesPerRangeLabel() Doesn't Do What It Says #114

Closed KennethEvans closed 2 years ago

KennethEvans commented 2 years ago

It is labeling every minor grid line, not every major grid line. It does indicate the major and minor grid lines. Such labeling, of course, is not what you want.

The screen dump is the result of this code:

        XYSeriesFormatter<XYRegionFormatter> formatter =
                new LineAndPointFormatter(Color.RED, null, null, null);
        formatter.setLegendIconEnabled(false);
        mSeries = new SimpleXYSeries(SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,
                "Series 1", 0, 10, 20, 30, 40, 50, 60, 70, 80, 90);
        mPlot.addSeries(mSeries, formatter);
        mPlot.setRangeStep(StepMode.INCREMENT_BY_VAL, 1);
        mPlot.setLinesPerRangeLabel(10);

Screenshot_Androidplot_Test small

Estacio7u7 commented 2 years ago

I have the same problem and I think this repository is actually death and with no maintenance. I will have to use other library.

KennethEvans commented 2 years ago

I agree the response has been underwhelming. It should not be hard to fix. What are you planning to use?

Estacio7u7 commented 2 years ago

I actually figured out how to do what I needed using the label renderer. I Just needed the round values between 0 and 6 and compared the text as string in that class. Then if it corresponds with that numbers return the labels, else, return the label with transparent color. Here's the code:

image

And heres how it looks like:

image

PD: I have to say that i'm using Kotlin instead of Java because of commodity PD2: Maybe for larger DataSets it's quite tricky to do the same

KennethEvans commented 2 years ago

It's a kludge, but it looks like it would work. In my case I already decided to just not use y labels. I will keep this in mind. Thanks.

halfhp commented 2 years ago

fixed in 1.5.10