Line chart of HelloCharts open source chart Library (1), hellocharts Open Source

Source: Internet
Author: User

Line chart of HelloCharts open source chart Library (1), hellocharts Open Source

We have introduced the open-source chart library MPAndroidChart. For details, refer:

Http://blog.csdn.net/shineflowers/article/details/44704723

We will introduce a better chart library today, which provides better performance, better functions, more beautiful UI style, and more precise coordinate axes than MPAndroidChart.

  • Supports scaling, sliding, and translation. Zoom (pinch to zoom, double tap zoom), scroll and fling

  • Supports custom coordinate axes (for example, the coordinate axes are located in the upper, lower, and left sides) and Automatic Generation of coordinate axes. Custom and auto-generated axes (top, bottom, left, right, inside)

  • Animation (Animations)

  • Preview is supported, that is, there is a sub-chart with finer coordinate density under the chart, and a region of the sub-chart is selected. The chart above the sub-chart will show more details of the selected area.

  • GitHub address:

  • Https://github.com/lecho/hellocharts-android

  • The line chart is as follows:

  • 1. download the latest hellocharts-library-1.5.3.jar package from the address above and copy it to the libs of the project

    2. Define an xml file


  • 3. Some logics for displaying a line chart are as follows:

    For (int I = 0; I <10; I ++) {mPointValues. add (new PointValue (I, new Random (). nextInt (10); mAxisValues. add (new AxisValue (I ). setLabel (I); // set the corresponding label for each corresponding I (displayed on the X axis)} Line line = new Line (mPointValues ). setColor (BLUE ). setCubic (false); List <Line> lines = new ArrayList <Line> (); lines. add (line); LineChartData data = new LineChartData (); data. setLines (lines); // Axis axisX = new Axis (); // the X Axis axisX. setHasTiltedLabels (true); axisX. setTextColor (BLUE); axisX. setName ("collection time"); axisX. setMaxLabelChars (10); axisX. setValues (mAxisValues); data. setAxisXBottom (axisX); Axis axisY = new Axis (); // y Axis axisY. setMaxLabelChars (7); // The default value is 3. You can only view data of the last three digits. setAxisYLeft (axisY); // sets the behavior attribute. It supports scaling, sliding, and translating mLineChartView. setInteractive (true); mLineChartView. setZoomType (ZoomType. HORIZONTAL); mLineChartView. setContainerScrollEnabled (true, ContainerScrollType. HORIZONTAL); mLineChartView. setLineChartData (data); mLineChartView. setVisibility (View. VISIBLE );


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.