Giter VIP home page Giter VIP logo

timepercentchart's Introduction

TimePercentChart

API

Android Library that shows simple percent chart and time chart.

How to import

Add it in your root build.gradle at the end of repositories:

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

Add the dependency

dependencies {
	compile 'com.github.EunsilJo:TimePercentChart:1.0'
}

How to use

PercentChartView

percentChart.setDrawValueColor(R.color.white);

You can change the text color of chart value. (default black)

percentChart.setUnit(PercentChartView.TIME_UNIT);

You can change the unit of chart value.

percentChart.setDrawValue(PercentChartView.DrawValue.PERCENT);

You can change the text of chart value. (default NONE)

percentChart.setPercentChart(mSamples);
  • ArrayList percents : items of percent chart

++

public void setLabelCount(int count)

You can change the count of X label. (default 5)

public void showX(boolean show)
public void showLegend(boolean show)
public void showPercentUnit(boolean show)

You can show/hidden X, legend and percent unit.

PercentChartData

new PercentChartData(R.color.color_chart_1, new LegendData("Korean"), 28800000)
  • @ColorRes int colorRes : the background color of item
  • LegendData legend : the legend of item
  • float value : the value of item

LegendData

public class LegendData {
    private String legend;
    private String value;
    private String subValue;
    private boolean showValue = true;
    private boolean showSubValue = true;
    ... 
}
  • String legend : the title of legend
  • String value : the value of legend
  • String subValue : the subValue of legend

TimeChartView

timeChart.setStartHour(6);

You can change start time. (default 0)

timeChart.setTimeChart(getMillis("2017-11-10 00:00:00"), mSamples);
  • long date : the reference date
  • ArrayList charts : items of time chart

++

public void setLabelCount(int count)

You can change the count of X label. (default 5)

public void showLegend(boolean show)

You can show/hidden legend.

TimeData

new TimeData(getMillis("2017-11-10 06:00:00"), getMillis("2017-11-10 06:00:22"))
  • long startMills : the start time of item
  • long stopMills : the end time of item

TimeChartData

new TimeChartData(R.color.color_chart_1, new LegendData("Plan"), values)
  • @ColorRes int colorRes : the background color of item
  • LegendData legend : the legend of item
  • ArrayList values : items of time

+

Please check the demo app to see examples.

timepercentchart's People

Stargazers

GilSang Jo avatar Yang dong seok avatar

Watchers

EunsilJo avatar James Cloos avatar

Forkers

dmlfsong

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.