Giter Site home page Giter Site logo

Comments (6)

PhilJay avatar PhilJay commented on May 5, 2024

Well, there is no such method like Chart.addDataSet(...) yet. But I will work on that.

In the meantime, you could do a workaround like this:

public void handleNewData(DataSet newData) {

    ChartData cd = mChart.getDataOriginal();
    ArrayList<DataSet> sets = cd.getDataSets();

    // add the new dataset
    sets.add(newData);

    ChartData newCd = new ChartData(sets, cd.getXVals());
    mChart.setData(newCd);
}

I know it's quite ugly, but it should be only a temporary solution. Please let me know if this worked for you.

Regards,
Phil

from mpandroidchart.

Mrkhagol avatar Mrkhagol commented on May 5, 2024

I'll let you know.
Thanks

from mpandroidchart.

Mrkhagol avatar Mrkhagol commented on May 5, 2024

It seems like this technique may end up working after all but what I am doing is bit complicated on my end so it may take awhile. But I also noticed that there might be issue with applying colors. Unless the user decides to apply same array of colors again and again, this would be issue if different color sets are needed.
So keep that in mind to as you develop technique for adding more datasets.

Thanks again for your help. :)

from mpandroidchart.

PhilJay avatar PhilJay commented on May 5, 2024

Thank you for your feedback.

I just released the new data model a few hours ago. Colors can now be set directly for each DataSet. The example project already makes use of the new model.

Regards,
Phil

from mpandroidchart.

Mrkhagol avatar Mrkhagol commented on May 5, 2024

sorry to bother you again..but is there a divider type style for multiple datasets in bar chart? Like a line or space..
Also which specific example are you referring to that implements new data model?

thanx

from mpandroidchart.

jiahush avatar jiahush commented on May 5, 2024

how to Dynamically load more data to current dataset when user drag line to the end ,just like Stock k line graph.

from mpandroidchart.

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.