yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 3 Q&A, Help & Troubleshooting] dimzin:
Hey Daniel, Thanks for the info.

I found Odin was pretty easy to flash with.

I've tried 4 different FW images for the GT3-7 and taken the unit (almost) completely apart w/the exception of removing the actual digitizer and the lcd.

Same results after each install though.

Even went so far as to try Kies to do the last one.

It boots, plays the boot sound, but no display.

I guess next step is removing the screen.. After that I don't know what to do except possibly getting myself a lcd replacement..

Just might drop it off to one of the local shops and get them to do it that way I won't wind up paying for something and f'ing it up.

No joy w/my sgt3..:(
[IDEs, Libraries, & Programming Tools] lech0:
Hi Xda, I've been working on this library for past few months. At last I managed to finish most of functionality and I would like to share it with you. I would like to see what you think about it and I hope someone will will find it useful.

Library is based on InteractiveChartView sample available on Google Developers page: http://developer.android.com/training/gestures/scale.html

Github project page: http://github.com/lecho/hellocharts-android

Apache License 2.0.

Features:

- Line chart

- Column chart

- Pie chart

- Bubble chart

- Combo chart

- Preview charts(for column chart and line chart)

- Zoom(pinch to zoom, double tap zoom), scroll and fling

- Custom and auto-generated axes

- Animations

Few screens from demo application:

[IMG="Temp/Height chart example"]https://github.com/lecho/hellocharts-android/raw/master/screens/scr-tempo.png[/IMG]

[IMG="Line/Column chart dependecy"]https://github.com/lecho/hellocharts-android/raw/master/screens/scr-dependency.png[/IMG]

[IMG="Preview column chart"]https://github.com/lecho/hellocharts-android/raw/master/screens/scr-preview-column.png[/IMG]

[IMG="Pie chart"]https://github.com/lecho/hellocharts-android/raw/master/screens/scr-pie1.png[/IMG]

Basic 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);

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>(numValues);
values.add(new PointValue(0, 2));
values.add(new PointValue(1, 4));
values.add(new PointValue(2, 3));
values.add(new PointValue(3, 4));

Line line = new Line(values).setColor(Color.Blue).setCubic(true);
List<Line> lines = new ArrayList<Line>(1);
lines.add(line);

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

LineChartView chart = new LineChartView(context);
chart.setLineChartData(data);
[IDEs, Libraries, & Programming Tools] sylsau:
Hello,

Your work seems great !

I will try your library when I will need charts in my next applications and I will make you a feedback :).

Sylvain
[IDEs, Libraries, & Programming Tools] SaschaHa:
This charts look awesome! Maybe I try to use it in my math app anytime :)
[IDEs, Libraries, & Programming Tools] daksh143:
Congratulations..!

You are on portal now...

Congratulations.!

By the way nice Work...Thanks for sharing.:good:

Keep coming like this.. :)
[IDEs, Libraries, & Programming Tools] Vingadero:
So beautiful!

Thx
[IDEs, Libraries, & Programming Tools] lech0:
Wow, thanks, really nice to see that you like it:)
[IDEs, Libraries, & Programming Tools] LtP410:
Hi,

After doing some research about charting lib on the internet, I decide to use your lib on my project. Thank you for your work.

On my project, I want to implement time series on X axis. And the gap between time nodes may be different.

Here's a sample:

flickr.com/photos/81585182@N07/15540381266/in/photostream/lightbox
[IDEs, Libraries, & Programming Tools] lech0:
Hi,

I'm glad you noticed this library. .

That should be possible to do with HelloCharts. Auto-generated axis tries to keep gaps between axis values equal so for this problem custom axis will be needed. You can pass to custom axis list of AxisValues with values that represents some date or time(for example each AxisValue could hold day number). To define axis labels use AxisValue.setLabel() or AxisValue.setFormatter() methods.

You may need to use method Axis.setMaxLabelChars() to define how much space should be taken by single label. Unfortunately if label is longer than maxLabelCharts it will not be truncated.

Sample code:

List<AxisValue> axisValues = new ArrayList<AxisValues>();
//fill list with your custom values

//Create new Axis with your custom values
Axis axis = new Axis(values);

//optionaly set max characters for axis labels
axis.setMaxLabelChars(4);

//set axis as bottom horizontal axis
chartData.setAxisXBottom(axis);
[IDEs, Libraries, & Programming Tools] LtP410:
That's great to hear it. Okay I'll try to do it as u said.

Thanks for your help.
[IDEs, Libraries, & Programming Tools] LtP410:
Can I ask u sth?

1. Is it able to swipe the chart to right/left if the X axis is too long ?

2. Is it able to break line in X axis value? (Ex: 15:00\n12.Oct) ?

3. How to use value formatter?

Thanks in advance.
[IDEs, Libraries, & Programming Tools] lech0:
Yes, for example if you have chart with X values from 0 to 100 you can configure viewport to show values only from 0 to 50, and user will have to scroll/fling to see rest of that chart.

//create chart view and set chart data
//now configure viewport
Viewport v = new Viewport(chart.getMaximumViewport());
v.left = 0;
v.right = 50;
//chart.setMaximumViewport(v); //Sorry!, that was mistake, you don't have to change maximum viewport in this case.
chart.setCurrentViewport(v, false);

Unfortunately for now not, text measurement and wrapping is slow and problematic so I decided to not do that.

If you need your own formatter(you have some logic that decides what label should be displayed) , create class that implements ValueFormatter interface or extends SimpleValueFormatter, for example look at HeightValueFormater class in SpeedChartActivity.java file in samples project(available on github).

If you need to display some numbers with text SimpleValueFormatter should be enough:

//Example of SimpleValueFormatter usage that displays Foo<some_number>Bar on X axis
//first parameter means how many digits after comma should be visible
ValueFormatter formatter = new SimpleValueFormatter(1, false, "Foo".toCharArray(), "Bar".toCharArray());
Axis xAxis = new Axis(someValues);
xAxis.setFormatter(formatter )
[IDEs, Libraries, & Programming Tools] LtP410:
#1: I could fling to see the rest of the chart but it isn't smooth and also very slow. Is that normal ?

#2: I implement this line chart in a ViewPager. When I fling in the chart, it move to the next screen instead of showing the rest of the chart. How can I fix it?
[IDEs, Libraries, & Programming Tools] lech0:
#1. I've tested LineChart with 500 points and viewport set to (0, 50), it works ok, and fling is smooth. Tested on Samsung Galaxy SII(Android 4.1) and Nexus 7/2013(Android 4.4).

How many points do you have on your chart and how many are visible without scrolling?

What device/android version do you use for testing?

Some additional explanation

LineChart is slower than other charts because it uses hardware acceleration only to draw axes, lines unfortunately are drawn on not accelerated bitmap because I experienced glitches when I was drawing lines with hardware acceleration on some devices and some canvas methods don't work with HW.

Other things that can slow down chart:

- every chart will be rendered a little slower on bigger screens and resolutions, depends on device CPU/GPU

- drawing value labels is relatively slow so for big charts it is good idea to not enable it

- drawing labels for axes is a little faster then drawing value labels

- if you use custom ValueFormatter try to make it as fast ass possible, use constants values and char arrays when you can

- cubic lines are a little slower than normal lines

- filled chart(filled area below lines) is very slow, don't use it if you need to display a lot of points on chart(I would say about 25 values is safe for filled area).

- every chart will be rendered much slower on devices with android older than honeycomb(3.0) because there is no hardware accelerations on pre-3.0 android.

#2: Try to use Chart.setContainerScrollEnabled() method, for example:

//Optionally set horizontal-only zoom type
columnChartView.setZoomType(ZoomType.HORIZONTAL);

//Chart is within ViewPager so enable container scroll mode., horizontal because ViewPager swipes horizontally.
chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);

Ps. I committed small change on github, now max zoom is 20 instead of 14 so you will be able to set smaller current viewport.

Ps2. Sorry for late reply, I have busy week.
[IDEs, Libraries, & Programming Tools] LtP410:
362

#1: Solved. I used the old jar (hellocharts-library-1.0.jar). I have changed to the newest version on github. Everything is perfect now.

#2: I did it.

Thank you very much.
[IDEs, Libraries, & Programming Tools] LtP410:
Hi,

#1: I'm working on pie chart. Am I able to set String labels on it?

#2: As you can see from the screen shot photo. The space in the top and bottom is missing. How can I fix it?

https://www.flickr.com/photos/81585182@N07/15653865581

Here's my code:

<RelativeLayout
android:id="@+id/linear_layout_pie_container"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_200" >

<lecho.lib.hellocharts.view.PieChartView
android:id="@+id/pie_chart"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</lecho.lib.hellocharts.view.PieChartView>
</RelativeLayout>

Thank you.
[IDEs, Libraries, & Programming Tools] lech0:
Hi,

#1: Yes, you can set String labels for values, for example

arcValue.setLabel("label".toCharArray());

#2: To leave more space outside of circle for labels change circle fill ratio:

pieChart.setCircleFillRatio(0.7f); //use values from 0.0f to 1.0f

I know it would be better if PieChart will do this automatically but all staff related to text measuring/drawing on android is a little complicated.
[IDEs, Libraries, & Programming Tools] LtP410:
Can I set label both inside and outside the pie chart ?
[IDEs, Libraries, & Programming Tools] lech0:
No, PieChart supports only one label type at the time, inside or outside.

Displaying labels inside and outside at the same time seems to be nice idea, I can't promise but maybe I will add that option.
[IDEs, Libraries, & Programming Tools] LtP410:
Well, I implement pie chart in ViewPager again, like I did with the line chart above.

Although I try to use this method but I still can swipe in the pie chart at the same time I rotate the chart. Is there any way to solve this problem?

chart.setContainerScrollEnabled(true, ContainerScrollType.VERTICAL);
chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
[IDEs, Libraries, & Programming Tools] lech0:
There is problem with PieChart because I have no way to determine when user wants to rotate chart and when he wants to change ViewPager page. When PieChart is within ViewPager it should rotate with "more-vertical" gesture and allow user to change page with "move-horizontal" gesture. That worked quite OK on my devices but if there is still a problem you can disable PieChart rotation:

pieChart.setChartRotationEnabled(false);

Btw. on some devices there is a problem with touch interceptions within support library ViewPager and DrawerLayout so just in case you may use HackyViewPager from lecho.lib.hellocharts.view.hack package. More info: https://github.com/lecho/hellocharts-android/issues/5
[IDEs, Libraries, & Programming Tools] LtP410:
Hi,

In line chart, I want all value labels are displayed on screen without touching on each label. Can I achieve this?
[IDEs, Libraries, & Programming Tools] lech0:
Hi,

yes, if I understand correctly, you can use method

line.setHasLabels(true)

to enable and display labels for all points on this line.
[IDEs, Libraries, & Programming Tools] 4ndro1developer:
Hi,

in line chart I would like to show a line and hide the other and vice versa, how could I do?
[IDEs, Libraries, & Programming Tools] LtP410:
Actually I meant:

chart.setValueSelectionEnabled(true);

Btw, as you can see, my line chart is way too dense. How to make it sparser?

I tried this code but it doesn't work. (I set v.right =3; but it still exceed 12.0)

final Viewport v = new Viewport(chart.getMaximumViewport());
v.bottom = lowestGlucose ;
v.top = highestGlucose + 2f;
v.left = 0;
v.right =3;
chart.setCurrentViewport(v, false);

https://www.flickr.com/photos/81585182@N07/15738747507/
[IDEs, Libraries, & Programming Tools] lech0:
Hi 4ndro1developer, there is no method for hiding/showing lines, you have to modify data and remove or add line to hide/show it. To make this you can create copy of last chart data, remove lines you want to hide and add lines you want to show(example below). You can also keep few copies of data with different lines and pass them to chart.setLineChartData(), each time different, according to which line you want to show/hide.

//deep copy of last chart data using copy constructor
LineChartData tempData = new LineChartData(chart.getLineChartData());
//clear lines
tempData.getLines().clear();
//add new line
tempData.getLines().add(someNewLine);
//switch chart data to show new line
chart.setLineChartData(tempData);
[IDEs, Libraries, & Programming Tools] lech0:
LtP410, check if you call chart.setCurrentViewport() method after chart.setLineChartData() method and not other way around. To be sure that viewport will not be modified by some chart methods you may use following method:

chart.setViewportCalculationEnabled(false);
[IDEs, Libraries, & Programming Tools] hazim93:
LineChart is cut off

Hi, the LineChart clips off some parts of the line and the label on the most right gets clipped off too. Is there anyway to fix this?
[IDEs, Libraries, & Programming Tools] LtP410:
final Viewport v = new Viewport(chart.getMaximumViewport());
v.bottom = yourMinValue;
v.top = yourMaxValue+ someValue;
chart.setCurrentViewport(v, false);

Hi lech0. It doesn't work. Here's my code. Could you give it a look?

private void generateData(String selectedDay, String selectedCategory) {
List<Statistic> listStatistics = (new DiabetesServiceImpl()).getStatisticByDayCategory(selectedDay, selectedCategory);
Collections.reverse(listStatistics);
float initX = 0f;
List<PointValue> values = new ArrayList<PointValue>();
List<AxisValue> axisValues = new ArrayList<>();
float lowestGlucose = 0f;
float highestGlucose = 0f;
if(!listStatistics.isEmpty()){
lowestGlucose = listStatistics.get(0).getGlucose();
highestGlucose = listStatistics.get(0).getGlucose();
}
for (Statistic s : listStatistics) {
float g = s.getGlucose();
if(g != 0){
if(g < lowestGlucose){
lowestGlucose = g;
}
if(g > highestGlucose){
highestGlucose = g;
}
}
values.add(new PointValue(initX, s.getGlucose()));
//	axisValues.add(new AxisValue(initX, String.valueOf(initX).toCharArray()));
axisValues.add(new AxisValue(initX, ((new SimpleDateFormat(Constants.DATE_TIME_CHART)).format(s.getRecordTime())).toCharArray()));
initX += 1f;
//((new SimpleDateFormat(Constants.DATE_TIME_CHART)).format(s.getRecordTime())).toCharArray())
}
//Time
Axis axisX = new Axis(axisValues).setHasLines(true);
axisX.setMaxLabelChars(12);
axisX.setTypeface(AsapFont.BOLD.getTypeFace());
axisX.setLineColor(getResources().getColor(R.color.gray));
axisX.setTextColor(getResources().getColor(R.color.light_dark_blue));

//Glucose
Axis axisY = new Axis().setHasLines(true);
axisY.setName(AppController.getContext().getResources()
.getString(R.string.text_glucose)+" ("+ prefs.getGlucoseUnit()+ ")");
axisY.setLineColor(getResources().getColor(R.color.hight_dark_blue));
axisY.setTypeface(AsapFont.BOLD.getTypeFace());
axisY.setTextColor(getResources().getColor(R.color.light_dark_blue));

List<Line> lines = new ArrayList<Line>();
Line line = new Line(values);
line.setColor(getResources().getColor(R.color.blue));
line.setShape(ValueShape.CIRCLE);
line.setCubic(true);
line.setFilled(true);
line.setHasLabels(true);
line.setHasLabelsOnlyForSelected(true);
line.setHasLines(true);
line.setHasPoints(true);
line.setAreaTransparency(3);
lines.add(line);

data = new LineChartData();
data.setLines(lines);
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);

chart.setZoomEnabled(false);
chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
chart.setZoomEnabled(true);
chart.setViewportCalculationEnabled(true);
chart.setValueSelectionEnabled(true);
chart.setLineChartData(data);

final Viewport v = new Viewport(chart.getMaximumViewport());
v.bottom = lowestGlucose ;
v.top = highestGlucose + 2f;
v.left = 0;
v.right =3;
chart.setCurrentViewport(v, false);
chart.setViewportCalculationEnabled(false);
}
[IDEs, Libraries, & Programming Tools] lech0:
Hi, I really couldn't find any bug in here, I've copied part of your chart configuration to my simple project and it seems to work ok(within and outside ViewPager) and it also looks like you are able to change viewport top and bottom values and only left/right values are problematic.

Could you check, just for tests if following code will works for you?

final Viewport v = new Viewport(lineChartView.getMaximumViewport());
float dx = v.width() * 0.2f;
v.inset(dx, 0);
lineChartView.setCurrentViewport(v, false);
[IDEs, Libraries, & Programming Tools] 4ndro1developer:
Hi lecho, I solved this by creating method

private void hideLineToData(int position) {
// deep copy of last chart data using copy constructor
LineChartData tempData = new LineChartData(chart.getLineChartData());
// hide or show line
if (tempData.getLines().get(position).hasLines() && tempData.getLines().get(position).hasPoints()) {
tempData.getLines().get(position).setHasLines(false);
tempData.getLines().get(position).setHasPoints(false);
} else {
tempData.getLines().get(position).setHasLines(true);
tempData.getLines().get(position).setHasPoints(true);
}
// switch chart data to show line
chart.setLineChartData(tempData);
}
[IDEs, Libraries, & Programming Tools] LtP410:
Yep, only left/right values are problematic. And your code doesn't work.

I find out that the problem occurs when I have more than about 80 value point. Any idea? :D
[IDEs, Libraries, & Programming Tools] lech0:
Oh, I think I have an idea what's wrong. By default I use max zoom level equal 20 so current viewport can have minimum width equal to maxViewport.width/20. I recently pushed a fix that make it possible to set that value(even bigger than 20) using method chart.setMaxZoom(float maxZoom). If you have up to date library code try to use that method and set max zoom to let's say 30.
[IDEs, Libraries, & Programming Tools] 4ndro1developer:
Line Chart Step

Hi lech0, If I wanted to implement this type of chart, how should I do?
[IDEs, Libraries, & Programming Tools] lech0:
I'm afraid you can't do that with hellocharts without modifying source code. What makes is difficult is that only every second point is visible. I think you could do that by modifying LineChartRenderer class to not draw some points and also disable touch event for those points. Maybe modifications of only two methods will be enough but I'm not sure at the moment.

lineChartRenderer.drawPoints()//don't draw points on even positions
lineChartRenderer.checkTouch()//don't handle touch for points on even positions

Each of these methods is based on for-each-loop, maybe try to modify those loops to skip some points.
[IDEs, Libraries, & Programming Tools] SaschaHa:
Just made a simple app with your library :)
[IDEs, Libraries, & Programming Tools] lech0:
Great:) Nice to see hellocharts in use, thanks.
[IDEs, Libraries, & Programming Tools] SaschaHa:
I've to thank you for this amazing library! :) It's very useful and the best looking graph library I've seen. Maybe I will use it in one of my other apps too for usage statistics ;)
[IDEs, Libraries, & Programming Tools] luisvitela:
Thanks for sharing your amazing work, I'm testing several libs but this one seems to do what i need.

I'm using the PieChart and have only one question. I have 2 values and I wanted to animate the PieChart. For instance, draw the first value then the second, like the effect of filling. Do you think it's possible to do that? On your example I've tried to use prepareDataAnimation(). It seems the right way to do but I can't achieve the fill effect
[IDEs, Libraries, & Programming Tools] lech0:
Hi, unfortunately this library doesn't support that kind of animation, there are some problems when you start PieChert animation from 0 values. I will try to change that but it will have to wait until next week.
[IDEs, Libraries, & Programming Tools] poelman00:
Change start axis of line

Hey,

first of all thankyou for your perfect library!

But I'm having a difficulty here, I've added another Axis, but how do you let the line start at this axis?

I want to display 2 different lines but 1 line starting at the left of the bottom axis, and the other one at the right.

Keep up the good work!

Thanks in advance!

Poelman00
[IDEs, Libraries, & Programming Tools] Goyvale:
Disable/hide white borders between slices on PieChart

Hi

First of all, thanks for the library!

I was wondering if it's possible to disable or hide the white borders between slices (the axes I think) on the PieChart?

Thanks,

Goyvale
[IDEs, Libraries, & Programming Tools] lech0:
Hi, you can set slices spacing to 0dp but in version 1.5.4 you will still see 1px borders, I've just pushed fix for that so in the next version the following method will remove slices spacing :

pieChartData.setSlicesSpacing(0);
[IDEs, Libraries, & Programming Tools] AlexanderColt:
Charting library

You can also check for koolchart charting library. Its really awesome charting library, supports number of functions,charts,graphs, etc. There are number of charting libraries available in market like Google free chart, Highchart, etc for creation of charts.

Thanks
[IDEs, Libraries, & Programming Tools] Fizpok:
Need help with hellochart's axes labels

Hi,

Please help: I have large numbers, like 100,000 as axes labels, and they do not fit. Like 0, 20,000... is ok, and instead of 100,000 I see 00000 (the "1" is off the view port.

How can I fix it?

Thanks.
[IDEs, Libraries, & Programming Tools] Fizpok:
How to auto format dates?

Is there any example of formating dates (for X axe)? What is the IN format? Any suggestions?
[IDEs, Libraries, & Programming Tools] lech0:
Hi, there is no dedicated method to format dates. You can pass formatted date as String, for example:

//For axis value
AxisValue axisValue = new AxisValue(timestamp).setLabel(formattedDateAsString);

//For point value where Y value is timestamp
PointValue pointValue = new PointValue(xValue, timestamp).setLabel(formattedDateAsString);

You can also look at Issue 135
[IDEs, Libraries, & Programming Tools] lech0:
It may be tricky to fit so long labels on screen, maybe you could use labels like 100k, 20k, 10k etc. If you need long labels try to set maximum number of chars for label and add some padding to chart view.

//set max num of chars for labels
axis.setMaxLabelChars(6);

//set custom axis label
axisValue.setLabel("100k");