Coder Social home page Coder Social logo

Comments (5)

lecho avatar lecho commented on July 22, 2024

Hi, thanks for idea, I think it is relatively easy task so I will try to implement it in this week.

from hellocharts-android.

tsengvn avatar tsengvn commented on July 22, 2024

@lecho thanks, I'm looking forward for it

from hellocharts-android.

lecho avatar lecho commented on July 22, 2024

I added three static methods in Axis class for axis generation:

/**
* Generates Axis with values from start to stop inclusive.
*/
public static Axis generateAxisFromRange(float start, float stop, float step);

/**
* Generates Axis with values from given list.
*/
public static Axis generateAxisFromCollection(List<Float> axisValues);

/**
* Generates Axis with values and labels from given lists, both lists must have the same size.
*/
public static Axis generateAxisFromCollection(List<Float> axisValues, List<String> axisValuesLabels);

from hellocharts-android.

tsengvn avatar tsengvn commented on July 22, 2024

Hi, tested, they worked well. Thanks you alot @lecho

from hellocharts-android.

fjpatil avatar fjpatil commented on July 22, 2024

Hi Lecho,

Let me know how to use the above mentioned static methods.

My Requirement: I want show the X axis values dynamically.
For Example: If my Total distance is 50KM, then I need to show 0,10,20,30,40,50 points in x axis.
Let me know how can I achive it.

Example Code for X axis Value Generation:

public class graph1 {

public static void main(String[] args) {
    // TODO Auto-generated method stub


    int slicing=5;
    int toal_distance=50;

    int sliced=toal_distance/5;
    System.out.println("========The Following Points to be displayed===========");
    for(int i=0;i<=5;i++){  
        int total_points=sliced*i;
        System.out.println("Total Points:"+total_points);

    }
}

}

Output:
========The Following Points to be displayed===========
Total Points:0
Total Points:10
Total Points:20
Total Points:30
Total Points:40
Total Points:50

from hellocharts-android.

Related Issues (20)

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.