2013년 6월 11일 화요일

Android Chart Library - Essence Chart SDK - Getting Started



Android Essence Chart Library support various Chart Types. Anyone can easily create 2D/3D chart by using Essence Chart Library.

  • Essence Chart Library support various Chart Types. You can find chart types in Supporting Various Chart Types Article.
  • Essence Chart Library is very tiny.
    Android Essence Library is only 3MB.
  • Essence Chart Library support Multi-platform.
    Currently support Android and Windows. iOS will be supported ASAP.
  • Essence Chart Library is Free
    Essence Chart Library follow MIT License(some exception is). Please refer Android Essence Chart License.





Install Essence Chart SDK
First of all, Essence Chart SDK must be installed. You can download install file in  Android Essence Chart SDK Download Article.

image




Getting Started - Step 1(Chart Creation)

Android Essence Chart Library provide JAR(Java Archive) can be used in Android system.

Support follwing
  • SDK Install Application
  • Android JAR
  • Support Device : armebai-v7 (armebai is not support)
  • SDK Sample(Demo) APP
  • Minimum SDK Version : Android 2.3.3(API 10)
  • Tested Device
    • Samsung Galaxy S2(Android 4.1.2, Jellybean and above)
    • Samsung Galaxy S3(Android 4.1.2, Jellybean and above)
    • Samsung Galaxy  Note 10.1(Android 4.1.2, Jellybean and above)
    • LG Optimus G Pro(Android 4.1.2, Jellybean and above)
    • Google Nexus7(Android 4.2.2, Jellybean and above)
    • Google Nexus10(Android 4.2.2, Jellybean and above)
  • Some Device will not work correctly
    • Support armebai-v7
    • Do not support all Android OS version



Pre-requisite





Create Android App


Run eclipse.
image




Select File –> New –> Other in Eclipse.

image




Select Android –> Android Application Project and Select “Next” button.

image



Input and Select to controls like following (refer to following picture):
Application Name: Chart
Project Name: Chart
Package Name: com.essence.chart
Minimum Required SDK: API 9: Android 2.3(Gingerbread)

Select “Next” Button.

image





Check Create custom launcher icon, Create activity, Create Project in Workspace.

Select ”Next” Button.

image




Use default value.

Select ”Next” Button.


image



Check 'Create Active' and Select 'BlankActivity'.

Select ”Next” Button.

image

Input value like following: (Use default value)
Activity Name: MainActivity
Layout Name: activity_main

Select 'Finish' Button.

image






Copy Essence Chart Library files to current project

Copy JAR file and library directory to current project.

Run Explorer and move to installed Essence Chart SDK directory.

Default Install path is:
  • Window 32bit : C:\Program Files\Essence Chart SDK\sdk\android
  • Window 64bit : C:\Program Files (x86)\Essence Chart SDK\sdk\android
image


Copy 'armebai-v7a' Directory and 'essence.chart.0.7.6.jar' file.

 image



Paste copied file to libs folder of Chart Project in Eclipse.


image


When copying finished, verify copied 'armebai-v7a' directory and  'essence.chart.0.7.6.jar' file in libs directory.

 image



Adding Chart to Layout

Select res/layout/activity_main.xml file in Eclipse.
(activity_main.xml is specified file when create this project)

image



Select 'activity_main.xml' tab.

image


Modify xml in TextView element.

Before

After
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/hello_world" />
</RelativeLayout>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    <com.essence.chart.Chart
        android:id="@+id/chart01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</RelativeLayout>



image

image


Save and Select 'Project->Clean' and Select 'Clear all Projects' in Clean dialog.

Select 'OK'.

image

Run Chart App


Select Run button in Eclipse toolbar.

In Run As Dialog, Select 'Android Application' and Select 'OK'.

image


If the project was build successfully, 'Android Device Chooser' Dialog will be opened.

In Android Device Chooser Dialog, Select device which connected and Select 'OK'.


image


Following pictures show Chart App is running.
  • Samsung Galaxy S2
image

  • Samsung Galaxy Note 10.1
image

  • Google Nexus7
image

댓글 2개:

  1. Hi, I'm an Android developer from Spain and I've found the library you've developed. You've done a great job!! It's the most complete and powerful graphic library I've found.
    I'm learning to use your library with your example, but I've found an issue that it's not in your example. Is there any way to show in the Pie graphic type a label on each slice showing the percentage of the slice or the text shown in the leyend?
    Thanks in advance for your answer.

    답글삭제
  2. Im Petry

    view image

    http://www.uppic.org/image-7B5B_5298134C.jpg

    답글삭제