Comments (6)
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.
I'll let you know.
Thanks
from mpandroidchart.
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.
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.
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.
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)
- Highlight issues after i applied RoundedSlicesPieChartRenderer in piechart
- 可以设置初始化Y轴数据的数量 之后一个一个的动态加载吗?
- Help: Dotted Background
- 使用implementation ("com.github.PhilJay:MPAndroidChart:v3.0.2")报错
- Values above the Horizontal bars Disappears when I zoomed in
- dataSet.gradientColors = gradientColors not working
- Fatal Exception: java.lang.NegativeArraySizeException HOT 4
- LineDataSet: shader with multiple color
- Getting crash while selection camera cropping only in Android 10
- How to rotate the Tooltip arrow Based on the touch points
- Documentation Link Failed! HOT 4
- When drawing Bezier curves vertically in LineChart, the curve flickers.
- Fatal Exception: java.lang.NullPointerException Attempt to read from null array
- Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
- Crash app with large data
- 如何绘制x轴带图片
- com.github.mikephil.charting.utils.Utils drawImage When the width and height are unequal, it may lead to deformation of the drawn icon
- Multi same x data find index by closestToY in getEntryIndex function error
- chart not rendered when line color is transparent but fill color is blue
- Clicked view/coordinate information on pie chart
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpandroidchart.