Giter Club home page Giter Club logo

hellocharts-android's Introduction

HelloCharts for Android

Charting library for Android compatible with API 8+(Android 2.2). Works best when hardware acceleration is available, so API 14+(Android 4.0) is recommended. Apache License 2.0.

Android Arsenal Coverity Scan Build Status Maven Central Release

Features

  • Line chart(cubic lines, filled lines, scattered points)
  • Column chart(grouped, stacked, negative values)
  • Pie chart
  • Bubble chart
  • Combo chart(columns/lines)
  • Preview charts(for column chart and line chart)
  • Zoom(pinch to zoom, double tap zoom), scroll and fling
  • Custom and auto-generated axes(top, bottom, left, right, inside)
  • Animations

Screens and Demos

  • Code of a demo application is in hellocharts-samples directory, requires appcompat v21.
  • The demo app is also ready for download on Google Play.
  • Short video is available on YouTube.

Download and Import

Android Studio/Gradle

  • Maven Central/jCenter, add dependency to your build.gradle:
   dependencies{
		compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
   }
  • JitPack.io, add jitpack.io repositiory and dependency to your build.gradle:
   repositories {
       maven {
           url "https://jitpack.io"
       }
   }
   
   dependencies {
       compile 'com.github.lecho:hellocharts-android:v1.5.8'
   }

Eclipse/ADT

  • Download the latest release jar file.
  • Copy hellocharts-library-<version>.jar into the libs folder of your application project.

Usage

Every chart view can be defined in layout xml file:

   <lecho.lib.hellocharts.view.LineChartView
       android:id="@+id/chart"
       android:layout_width="match_parent"
       android:layout_height="match_parent" />

or created in code and added to layout later:

   LineChartView chart = new LineChartView(context);
   layout.addView(chart);

Use methods from *Chart classes to define chart behaviour, example methods:

   Chart.setInteractive(boolean isInteractive);
   Chart.setZoomType(ZoomType zoomType);
   Chart.setContainerScrollEnabled(boolean isEnabled, ContainerScrollType type);

Use methods from data models to define how chart looks like, example methods:

   ChartData.setAxisXBottom(Axis axisX);
   ColumnChartData.setStacked(boolean isStacked);
   Line.setStrokeWidth(int strokeWidthDp);

Every chart has its own method to set chart data and its own data model, example for line chart:

   List<PointValue> values = new ArrayList<PointValue>();
   values.add(new PointValue(0, 2));
   values.add(new PointValue(1, 4));
   values.add(new PointValue(2, 3));
   values.add(new PointValue(3, 4));

   //In most cased you can call data model methods in builder-pattern-like manner.
   Line line = new Line(values).setColor(Color.BLUE).setCubic(true);
   List<Line> lines = new ArrayList<Line>();
   lines.add(line);

   LineChartData data = new LineChartData();
   data.setLines(lines);

   LineChartView chart = new LineChartView(context);
   chart.setLineChartData(data);

After the chart data has been set you can still modify its attributes but right after that you should call set*ChartData() method again to let chart recalculate and redraw data. There is also an option to use copy constructor for deep copy of chart data. You can safely modify copy in other threads and pass it to set*ChartData() method later.

Contributing

Yes:) If you found a bug, have an idea how to improve library or have a question, please create new issue or comment existing one. If you would like to contribute code fork the repository and send a pull request.

License

HelloCharts	
Copyright 2014 Leszek Wach

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

 HelloCharts library uses code from InteractiveChart sample available 
 on Android Developers page:
 
   http://developer.android.com/training/gestures/scale.html

hellocharts-android's People

Contributors

akperkins avatar andrewdavidmackenzie avatar annie-l avatar ayvazj avatar benoitduffez avatar douglasjunior avatar eyalbira avatar johnjohndoe avatar lecho avatar ofirgeller avatar overflawio avatar tylercarberry avatar zsoltk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hellocharts-android's Issues

Publishing to maven local broken

I want to preface this by saying I'm pretty unfamiliar with Java build systems in general, Gradle included. I suspect if that weren't the case I could give you a pull request with a solution instead of just a problem.

In any case, attempting to publish to the local maven repository as described in the readme doesn't work. Running "gradle clean build publishToMavenLocal" produces an error message like this:

Execution failed for task ':hellocharts-library:publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'MavenLocal'
   > Invalid publication 'maven': artifact file does not exist: <containing dir>/hellocharts-android/hellocharts-library/build/outputs/aar/hellocharts-library.aar'

The issue seems to be that the build step spits out "hellocharts-library-debug.aar" and "hellocharts-library-release.aar". I ran the clean and build steps, copied the release library into a new file named "hellocharts-library.aar" and then ran the publishToMavenLocal step last and everything worked fine. It seems like it's just a naming issue in some Gradle config file, but it's potentially discouraging to new users.

[LineChartView] A problem about filled area

Hi,lecho.

The library is very cool!Thanks for your work.

But now,I have a problem When I create a LineChart,as the charts shows below.

qq 20141231145232

why my shaded area is larger than the range from hello1 to hello4 on the x axis? How can it be corresponded with the exact range from hello1 to 4?

This is my code fragment:

        chart = (LineChartView) mRootView.findViewById(R.id.chart1);
        chart.setOnValueTouchListener(new ValueTouchListener());

        chart.setViewportCalculationEnabled(false);
        Viewport v = new Viewport(0, 8, 6, 0);
        chart.setMaximumViewport(v);
        chart.setCurrentViewport(v);        
        data = new LineChartData();
        List<PointValue> values = new ArrayList<PointValue>();

        values.add(new PointValue(1, 1));
        values.add(new PointValue(2, 2));
        values.add(new PointValue(3, 3));
        values.add(new PointValue(4, 4));       
        Line line = new Line(values);

        line.setShape(shape);
        line.setCubic(isCubic);
        line.setFilled(isFilled);
        line.setHasLabels(hasLabels);
        line.setHasLabelsOnlyForSelected(hasLabelForSelected);
        line.setHasLines(hasLines);
        line.setHasPoints(hasPoints);

        List<Line> lines = new ArrayList<Line>(1);
        lines.add(line);
        data.setLines(lines);

        if (hasAxes) {  
            List<AxisValue> as = new ArrayList<AxisValue>();

            for(int i=1; i<=4; i++){
                as.add(new AxisValue(i, ("hello"+i).toCharArray()));
            }
            Axis axisX = new Axis(as);
            Axis axisY = new Axis();    

            if (hasAxesNames) {
                axisX.setName("Axis X");
                axisY.setName("Axis Y");
            }
            data.setAxisXBottom(axisX);
            data.setAxisYLeft(axisY);
        } else {
            data.setAxisXBottom(null);
            data.setAxisYLeft(null);
        }
        chart.setLineChartData(data);   

Thank you and happy new year :)

If "axis.setAutoGenerated(true)" then does not respect the amount of decimal digits

When we set the parameter "axis.setAutoGenerated(true)", the "AxesRenderer" does not respect the set amount of digits within the "SimpleValueFormatter". Even if I set the SimpleValueFormatter to 3 digits, continues to write 2 digits.
My code

 private final SimpleValueFormatter simpleValueFormatter = new SimpleValueFormatter(3);
...
columnData.setAxisYLeft(new Axis().setMaxLabelChars(6).setAutoGenerated(true).setHasLines(true).setName("Produtividade (ha/h)").setTextSize(TEXT_SIZE).setTextColor(TEXT_COLOR).setFormatter(simpleValueFormatter));
...

AxesRenderer.java

    private void drawAxisVerticalLabels(Canvas canvas, Axis axis, int position) {
        final Rect contentRectMargins = chart.getChartComputator().getContentRectWithMargins();

        int stopsToDrawIndex = 0;

        for (; stopsToDrawIndex < axisValuesToDrawNumTab[position]; ++stopsToDrawIndex) {

            final int numChars;

            if (axis.isAutoGenerated()) { /
                valuesBuff[0] = axisAutoValuesToDrawTab[position][stopsToDrawIndex];
                // here is the problem
                numChars = axis.getFormatter().formatAutoValue(labelBuffer, valuesBuff,
                        axisAutoValuesBufferTab[position].decimals);
            } else {
                valuesBuff[0] = axisValuesToDrawTab[position][stopsToDrawIndex].getValue();

                numChars = axis.getFormatter().formatValue(labelBuffer, valuesBuff,
                        axisValuesToDrawTab[position][stopsToDrawIndex].getLabel());
            }

            canvas.drawText(labelBuffer, labelBuffer.length - numChars, numChars, axisFixedCoordinateTab[position],
                    axisRawValuesTab[position][stopsToDrawIndex], textPaintTab[position]);

        }

        // drawing axis name
        if (!TextUtils.isEmpty(axis.getName())) {
            textPaintTab[position].setTextAlign(Align.CENTER);
            canvas.save();
            canvas.rotate(-90, contentRectMargins.centerY(), contentRectMargins.centerY());
            canvas.drawText(axis.getName(), contentRectMargins.centerY(), axisNameBaselineTab[position],
                    textPaintTab[position]);
            canvas.restore();
        }

    }

This is a bug? Can I fix it?

[LineChartView] Overflow curve line

Hi,

Thanks for the great library!

I have a little problem.

When my values are 0( for example, three straight (1,0) (2,0) (3,0) points), the line goes under the chart and not visible. Same thing happened with three straight max value (in my case it's a percentage chart) so if I have three points like this:
(1,100), (2,100), (3,100)

The line goes above the chart and not visible.

I wonder if there is a fix for this or can I set the line to be straight (instead of curve) so all parts of it will be visible in the chart?

Thanks a lot!


Sorry, I found the solution for straight line (set cubic to false)

However, the problem with the line goes outside the chart stills there.

log-normal scatter plot

Sure it is possible but any guidance would be great on how to use this lib to create a log-normal scatter plot. Thanks!

Is there any way to zoom a chart automatically

Hi, I've been using hellocharts library and it's great!
There is only one thing that I couldn't accomplish yet, is there any way to set up automatic zoom?

I need to show a lot of data including the values, by default it shows everything packed, so the user needs to zoom it manually:

screenshot_2015-01-26-16-15-01

is there any way to do this programatically? so by default is zooms the data showing only a couple of columns?

screenshot_2015-01-26-16-15-11

and then the user just scrolls?
I'm looking at the ChartZoomer class but it's tight to gestures.

Thanks!

setAutoGenerated(true) with Date values

I want to show a set of dates in the X Axis that can adjust the visible range (show/hide) based on zoom level (like the integers when setAutoGenerated(true) is set). How can I do it?

One option for label 45º.

I thought of creating an option for the label is printed in 45º, or the user's choice. As you can see in the picture, the data may be confusing in some cases. What do you think?

Before
screenshot_2014-12-24-09-42-32 - before

After
screenshot_2014-12-24-09-40-54 - after

Something like this:

AxesRenderer.java

    private void drawAxisHorizontalLabels(Canvas canvas, Axis axis, int position) {
        final Rect contentRectMargins = chart.getChartComputator().getContentRectWithMargins();


        for (int valueToDrawIndex = 0; valueToDrawIndex < axisValuesToDrawNumTab[position]; ++valueToDrawIndex) {
            int charsNumber = 0;

            if (axis.isAutoGenerated()) {
                final float value = axisAutoValuesToDrawTab[position][valueToDrawIndex];
                charsNumber = axis.getFormatter().formatValueForAutoGeneratedAxis(labelBuffer, value,
                        axisAutoValuesBufferTab[position].decimals);
            } else {
                AxisValue axisValue = axisValuesToDrawTab[position][valueToDrawIndex];
                charsNumber = axis.getFormatter().formatValueForManualAxis(labelBuffer, axisValue);
            }

            canvas.save(); // here
            canvas.rotate(degrees ,axisRawValuesTab[position][valueToDrawIndex], axisFixedCoordinateTab[position]); // here
            canvas.drawText(labelBuffer, labelBuffer.length - charsNumber, charsNumber,
                    axisRawValuesTab[position][valueToDrawIndex], axisFixedCoordinateTab[position],
                    textPaintTab[position]);
            canvas.restore(); // here
        }


        // Drawing axis name
        if (!TextUtils.isEmpty(axis.getName())) {
            textPaintTab[position].setTextAlign(Align.CENTER);
            canvas.drawText(axis.getName(), contentRectMargins.centerX(), axisNameBaselineTab[position],
                    textPaintTab[position]);
        }
    }

Gradle error

Hi,

I'm trying to put this:

compile 'lecho.lib.hellocharts:hellocharts-library:1.1@aar'
compile 'com.android.support:support-v4:21.0.+'

On the build.gradle in Android Studio and it gives me this error:

Error:A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find lecho.lib.hellocharts:hellocharts-library:1.1.
Searched in the following locations:
https://jcenter.bintray.com/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.pom
https://jcenter.bintray.com/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.aar
file:/C:/android-sdk/extras/android/m2repository/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.pom
file:/C:/android-sdk/extras/android/m2repository/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.aar
file:/C:/android-sdk/extras/google/m2repository/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.pom
file:/C:/android-sdk/extras/google/m2repository/lecho/lib/hellocharts/hellocharts-library/1.1/hellocharts-library-1.1.aar

Any idea why this is appening?

Thanks

Text-Labels on Pie Charts

Is it possible to add text labels (not value labels) to Pie Charts?
Like for example:

Students 70%
Teachers 20%
Admin 10%

So I want the texts of "Students, ..." appear on the pie (or on press).

Out Of Memory Error When Switch Between Activities Which Have Charts

Hello again,

First of all, thanks for the great library and happy new year!

I experienced an out of memory problem in my app. I have two activities which have line charts and bar charts in them. Let's say they are activity A and B.

When I switch between them a lot of time, the amount of memory consumed increased a lot. When I switch back and forth between them at certain amount of time, the app crashed because of out of memory error.

Do you have any tip on solving this problem?

Thanks!

help with multiple lines

goodmorning,

i'm using your library but i have some problem with multiple lines.

  1. it's possible to create two different lines using differents axis without using scale and range?

  2. i use that code:

ArrayList axisValues = new ArrayList();
for (float i = 0; i < maxTime; i += 1000) {
axisValues.add(new AxisValue(i, moreWorkouts
.formatMinutes((long) i)));
}
Axis tempoAxis = new Axis(axisValues)
.setMaxLabelChars(5)
.setTextColor(Color.RED)
.setHasSeparationLine(false)
.setFormatter(
new HeightValueFormater(scale, sub, 1, null, null));

where formatMinutes create char in format hh:mm.
By this the formatter look not work and the value of axis result not scaled.

  1. it's possible to have dinamically decimal number using setFormatter for axis right, like axis without setFormatter.

sorry for my english.
thanks a lot.
nicholas

AxisValue Labels

Perhaps I am just not understanding but how do AxisValue Labels work, I would have assumed it places that text at that point on the axis. Is this not the case (or am I just missing something silly here)

how to set zoom level manually ?

Hi
thanks for this perfect chart library.
i have a small problem , in first time render chart labels are very close.
how i can set zoom manually in startup ?
i found this method , but dose not work

chart.zoom(0,0, -20);

Image

can set the column chart width?

i like PreviewColumnChartView,want to show 50 points,and every column has x label i.e. label1,label2.....label50.but the words overlapped(i changed code in AxesRenderer.java prepareAxisHorizontalCustom to do not hide labels)
1
i set column chart width=1400dp; words not overlapped but it only show the front 30 columns,can not show others. i find the bigger i set the width,the less points can show
i try to use setContentArea or chart.setMaximumViewport, its can not show all points too.

what can i do?
thanks

Error build.gradle last android version (after Update)

Some of us can face this error:

THE ERROR IS:
Library projects cannot set applicationId. applicationId is set to 'lecho.lib.hellocharts' in default config

So on stackoverflow the solution was to comment this line:
"applicationId 'lecho.lib.hellocharts'" on build.gradle file.

But then this second error appears:
A problem occurred configuring project ':hellocharts-library'. Exception thrown while executing model rule: org.gradle.api.publish.plugins.PublishingPlugin$Rules#addConfiguredPublicationsToProjectPublicationRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublicationRegistry, org.gradle.api.publish.PublishingExtension, org.gradle.api.internal.project.ProjectIdentifier) java.lang.NullPointerException (no error message)

So the only working solution till now is to comment all this on the build.gradle file

    /*
        defaultConfig {
            minSdkVersion 8
            targetSdkVersion 19
            versionCode 1
            versionName '1.0'
            applicationId 'lecho.lib.hellocharts'
       }
    */

    // To publish to maven local execute "gradle clean build publishToMavenLocal"
    // To publish to nexus execute "gradle clean build publish"
    /*
    android.libraryVariants
     publishing {
        publications {
            maven(MavenPublication) {
                artifact "${project.buildDir}/outputs/aar/${project.name}.aar"
                artifactId project.name
                groupId android.defaultConfig.applicationId
                version android.defaultConfig.versionName

                artifact androidSourcesJar {
                    classifier "sources"
                 }
             }
         }

        repositories {
            maven {
                    credentials {
                    username 'nexusUser'
                    password 'nexusPass'
                }
                url "http://your-nexus-url/
            }
        }
    }
    */

Like this it's seems to work, but i don't think it's the best solution, maybe you can check it out!

Question regarding SimpleAxisValueFormatter()

Hi,

At first, thank you for the great library.
I am trying to implement a columnchart by following the sample app. While using the SimpleAxisValueFormatter to give value to column names at bottom axis, the class is not recognized by Android Studio. Is it deprecated or what?

The codes i am following : https://github.com/lecho/hellocharts-android/blob/master/hellocharts-samples/src/lecho/lib/hellocharts/samples/TempoChartActivity.java#L116

Also "lecho.lib.hellocharts.util.ChartUtils" is not recognized.
https://github.com/lecho/hellocharts-android/blob/master/hellocharts-samples/src/lecho/lib/hellocharts/samples/ColumnChartActivity.java#L172

Support set step value for Horizontal and Vertical Axis (x/y axis)

Hi, after deeply searching in this lib, I see you do not support for setting these values yet.

For example, I have a bunch of data of temperature of few months, and I want to draw a chart with step in Y axis is 5 degree, and step in X axis is each 7 days, what I want is the gridline always point to that step value.

I see some others chart lib have this feature, but I love this library (the style, animation, setup). Could you please add this in next release ?

Thanks.

PointValue needs to override hashcode() and equals()

First off, this library is great! Keep up the good work!

This is not really an issue, but more of an enhancement. I have an application that is dynamically adding points to a PointValue list at runtime. There are instances where duplicate points can be added, so I was trying to use a HashSet which should eliminate duplicates... but since PointValue doesn't override hashcode() and equals() it can't tell if there are duplicate or not.

http://javarevisited.blogspot.ca/2011/10/override-hashcode-in-java-example.html

Crash when zooming

Internet says that it is DrawerLayout internal error, but it can be repaired by using workaround class.
See more Baseflow/PhotoView#72

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
at android.support.v4.widget.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1011)
at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(DrawerLayout.java:1108)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2055)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2279)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1606)
at android.app.Activity.dispatchTouchEvent(Activity.java:2565)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2227)
at android.view.View.dispatchPointerEvent(View.java:8340)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4743)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4221)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4190)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4301)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4198)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4358)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4221)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4190)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4198)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6517)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6434)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6405)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6370)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6597)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6570)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6616)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:571)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5586)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)

Touching Points

Hello, I was wondering if there was a way to programmatically "touch" points, so the point would show up as if one touched it. I would like to use a seek bar with the graph. I was trying a motion event to trigger the touch. Would that be the way to go?

Cheers.

Current showing points

Hi,

Is there anyway for us to know how many points are showing on screen and its value ?

Thanks.

How can I change the scale on the X in ColumnChart

Hello, lecho! I really like your library. It is very easy to use. But I have difficulties in its customization. How can I change the values on the x-axis? I want the graph to have names of the months as well as you have in the picture
image
I got to build the library. And the X-axis indicates the number of points:
image

Legend and title - ability to set chart title and legend

I don't know if this already exists, or if this should be part of the charts, but I thought I'd suggest these anyway in case it makes sense:

  • The ability to set a title that appears somewhere in the LineChart area. Something like chart.setTitle
  • The ability to show a legend (eg when using multiple line) indicating what the different line colors mean. I suppose this could be derived from something like Line.setName.

Anyway, thanks for all the work on this chart, it's very nice and easy to use. The structure of the charts has been well thought out.

Documentation

Maybe a wiki with the method you've created and what we can use them for could be a good idea. Like a small wiki ok a pdf file. It could be usefull.

unsorted series value.

I have a need to have the y of the chart as a date, more specifically day of month, which can start on any day of the month, eg 10th, having more than 1 period to compare against.

At the moment, if I load the data starting at the 10th, it will go from 10th to the 9th of next month, but the data becomes sorted so it wont display properly, becoming 1 to 30/31..

I will if time permits try to fix this myself.
good work though, charts look nice and are easy to use.

java.lang.ArithmeticException: divide by zero

Hi i recently get a new exception :

at lecho.lib.hellocharts.renderer.AxesRenderer.prepareAxisHorizontalCustom(AxesRenderer.java:377)
            at lecho.lib.hellocharts.renderer.AxesRenderer.prepareAxis(AxesRenderer.java:334)
            at lecho.lib.hellocharts.renderer.AxesRenderer.drawInBackground(AxesRenderer.java:148)
            at lecho.lib.hellocharts.view.AbstractChartView.onDraw(AbstractChartView.java:87)

Thanks.

Set order in ComboLineColumnCHart

I have a ComboLineColumnChart. The line is filled, which is on top of the columns. Is is possible to control the order and so bring the columns to the front?

Lines getting clipped at boundaries

screenshot

Is there any way I can set margins for line data so lines don't get clipped when they are at edges having max or min values? For example, by setting a %5 margin, graphs highest value becomes %5 higher than the highest value among line data values, and chart lowest becomes %5 less of lowest value in list.

Or if I can disable clipping that would be better.

Thanks.

Method to scroll programmatically

Scroll from code can be achieved using Chart.setCurrentViewport() method but separated method for that functionality could be more convenient.

onNothingTouched not firing

Hi, I have tried on a few different chart types (line, column and comboLineColumn) but the onNothingTouched listener does not appear to be firing.

Cheers

Legend

How can we set Legend in hellocharts for Line and bar combined?

Multiline labels on axis

Is there possibility to create multiline label of axis?
I guess current implementation doesn't allow that because of usage Canvas.drawText() in AxesRenderer which ignore "\n". Do you have any idea how to fix this?

Set AxisYLeft max

Hi, I may be missing a trick but is it possible to set the AxisYLeft max value manually. I am able to set the base value but not the maximum.

Cheers

Out Of Memory Error Since hellocharts used

Hello,

I'm french, so sorry for my bad english...

I'm an Android developer and, in my app, i recently add hellocharts to replace another old chart library.
It's a very beautiful lib, and i congratulate developers :-)

But I've a problem since i imported this solution in my fragments of an activity...

Now i often have Out Of Memory Errors that make my app crash.
When i see the error log I see each time :

" java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
...
at lecho.lib.hellocharts.renderer.LineChartRenderer.initDataMeasuremetns(LineChartRenderer.java:93)"

and i don't know what to do in my onStop() or onDestroy() functions to make it disappear...
I tried to use chart.destroyDrawingCache() function but it seems to be useless....
Could you help me please?

Thank you very much!

Regards.

Show all steps in axis y

I'm trying to show all step in axis Y even if it enver reach them like in the sample, and somewhy it doesn't work. How do I do that?

Axis axisY = Axis.generateAxisFromRange(50,100,5).setAutoGenerated(false).setHasLines(true).setTextColor(Color.WHITE);

View Axis data

thanks for the help. the viewport thing help me to show more of the graph.

But my 1st problem was that i was not able to see the value of the graph

//values of the axeY
List<AxisValue> axisValuesForY = new ArrayList<AxisValue>();

for (int i = 1; i < 100; i +=10){
    axisValuesForX.add(new AxisValue(i));
}

Axis axeX = new Axis(axisValuesForX);
Axis axeY = new Axis(axisValuesForY);

data.setAxisXBottom(axeX);
data.setAxisYLeft(axeY);

i've done this and nothing show's up on the axeY neither for X.
Plus i've put this.

axeX.setName("Days");
axeY.setName("amount");

and only day is displayed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.