anychart ajax,AnyChart Android Charts

Installation

Leiningen

Add this to the project.clj file, at the end of repositories:

:repositories [["jitpack" "https://jitpack.io"]]

Add the dependency:

:dependencies [[com.github.AnyChart/AnyChart-Android "0.0.3"]]

SBT

Add this to the build.sbt, at the end of resolvers:

resolvers += "jitpack" at "https://jitpack.io"

Add the dependency:

libraryDependencies += "com.github.AnyChart" % "AnyChart-Android" % "0.0.3"

Maven

Add the JitPack repository to the build file:

jitpack.io

https://jitpack.io

Add the dependency:

com.github.AnyChart

AnyChart-Android

0.0.3

Gradle

Add this to the root build.gradle at the end of repositories (

WARNING: Make sure you add this under

all projects not under build script):

allprojects {

repositories {

...

maven { url 'https://jitpack.io' }

}

}

Add the dependency to the project build.gradle:

dependencies {

compile 'com.github.AnyChart:AnyChart-Android:0.0.3'

}

JAR/AAR File

Download the

latest AAR. Copy AAR file into the libs folder of the application project.

If you are using Android Studio:

Right click on a project and choose "Open Module Settings".

Click the plus button in the top left to add a new module.

Choose "Import .JAR or .AAR Package".

Find the AAR file.

In the app's module click on the dependencies tab and add the new module as a dependency.

Getting Stated using Gradle

You should have already set up the latest

Android Studio.

Create a new project and select appropriate API level (AnyChart library for Android compatible with API

15+).

Create new project

1c5c2d0e2298b4e662630b3ec5ee503a.png

Select API level

fcb0ebc446e13c7822bbade7d2dea765.png

Add an empty Activity and put in layout and Activity name.

Add Activity

957ca7b863e5342191904229d07a3bc4.png

Customize Activity

7f4a38b8ad3fc7ee6110ceb78347b8c1.png

Add the repository to the

project build.gradle at the end of repositories (

WARNING: Make sure you add it under allprojects, not under the buildscript).

allprojects {

repositories {

...

maven { url 'https://jitpack.io' }

}

}

Then add the dependency to the module build.gradle and synchronize project with Gradle.

dependencies {

compile 'com.github.AnyChart:AnyChart-Android:0.0.3'

}

Add the repository

87391582d5c28acefc53d8106cc1710f.png

Add the dependency and sync the project

25492cb38fec53fd80bf113e83883f07.png

Add AnyChart view to the Activity layout.

android:id="@+id/any_chart_view"

android:layout_width="match_parent"

android:layout_height="match_parent"

/>

Add a view to a layout

43402ce9a7627da5ae05be6e8167bd96.png

Add Java code to the Activity. For example, if you want to create pie chart:

Pie pie = AnyChart.pie();

List data = new ArrayList<>();

data.add(new ValueDataEntry("John", 10000));

data.add(new ValueDataEntry("Jake", 12000));

data.add(new ValueDataEntry("Peter", 18000));

AnyChartView anyChartView = (AnyChartView) findViewById(R.id.any_chart_view);

anyChartView.setChart(pie);

Add Java code

3e11ca01835cf31cf6f38a517cb61b16.png

Make sure you have these package imports at the top of your Activity file.

import com.anychart.anychart.AnyChart;

import com.anychart.anychart.AnyChartView;

import com.anychart.anychart.DataEntry;

import com.anychart.anychart.Pie;

import com.anychart.anychart.ValueDataEntry;

import java.util.ArrayList;

import java.util.List;

Build and run your app.

Build and run

7d43a617ca824d71bdcdb7cc74d9f7cd.png

Running App

36e65fce27bbd34650296f83c41a35e9.png

Running Demos

Clone or download the

project.

Open Android Studio and import the project.

Import Project

1199221c3fdd0e1bf3a8453f28a9408a.png

Run the project.

Run Project

fc59a26e90c8413c3c881b8dbd6d88dd.png

Select Chart

379e83f1560bc53f32dc2dcfb224be76.png

Running App

f9877aa1a45b968e2b940f1b9b7bf36e.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值