GithubHelp home page GithubHelp logo

ultramega / android-radar-chart Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 183 KB

Android library providing a View that renders a radar chart and a widget for editing the values in the chart

License: MIT License

Java 100.00%
android-library radar-chart radarview widget

android-radar-chart's Introduction

Android Radar Chart

This library provides a View that renders a radar chart and a widget for editing the values in the chart.

Installation

Add the dependency to your module's build.gradle file:

dependencies {
    compile 'com.ultramegasoft.radarchart:radar-chart:0.1.5'
}

Usage

For a full example, see the example application in the testapp module. Below is a quick setup guide.

RadarView

  1. Add the View to the layout:
<com.ultramegasoft.radarchart.RadarView
    android:id="@+id/radar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true" />
  1. Load the View from the layout:
mRadarView = (RadarView)findViewById(R.id.radar);
  1. Set the data for the RadarView to display as an ArrayList of RadarHolder objects:
mRadarView.setData(mData);
  1. Enable or disable interactive mode:
mRadarView.setInteractive(true);
mRadarView.setInteractive(false);

RadarEditWidget

  1. Add the app namespace to the root element of your layout if it is not already added:
xmlns:app="http://schemas.android.com/apk/res-auto"
  1. Add the View to the layout:
<com.ultramegasoft.radarchart.RadarEditWidget
    android:id="@+id/edit_widget"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    app:showButtonBar="true" />
  1. Load the View from the layout:
mEditWidget = (RadarEditWidget)findViewById(R.id.edit_widget);
  1. Set the target RadarView for the RadarEditWidget to control:
mEditWidget.setTarget(mRadarView);
  1. If you enabled the button bar, set the callbacks for the buttons:
mEditWidget.setOnButtonClickListener(new RadarEditWidget.OnButtonClickListener() {
    @Override
    public void onSave() {
        // Save button clicked
    }
    
    @Override
    public void onCancel() {
        // Cancel button clicked
    }
});

Documentation

Full Java reference is available at https://ultramega.github.io/android-radar-chart/.

XML Attributes

RadarView

Name Type Default Description
circleColor Color #FFCCCCCC The color for the circles
gravity Gravity center_horizontal|top The alignment of the View within its container
labelColor Color #FFFFFFFF The color for the label text
polygonColor Color #DD0066FF The color for the polygon representing the data in the chart
polygonColorInteractive Color #DDFF66FF The color for the polygon when the chart is in interactive mode
selectedColor Color #FFEFAC1D The color for the selected item when the chart is in interactive mode
Gravity Options

Options available for the gravity XML attribute. Multiple options can be combined by separating them with the | character.

Constant Description
top Push object to the top of its container
bottom Push object to the bottom of its container
left Push object to the left of its container
right Push object to the right of its container
center_vertical Place object in the vertical center of its container
center_horizontal Place object in the horizontal center of its container
center Place the object in the center of its container in both the vertical and horizontal axis
start Push object to the beginning of its container
end Push object to the end of its container

RadarEditWidget

Name Type Default Description
showButtonBar Boolean FALSE Whether to display the Save and Cancel buttons
textColor Color #FFFFFFFF The color for the text
textSize Dimension 32sp The size of the text

License

The source code for Android Radar Chart is released under the terms of the MIT License.

android-radar-chart's People

Contributors

stevotvr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

minhnhut0602

android-radar-chart's Issues

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.