Comments (12)
This issue persists in v3 of the library.
from williamchart.
If you want to make LineChartView
bigger in the sample application you better increase the weight of LineChartView
. Otherwise to use dp I would recommend you to define your own layout. I can assure you that it works.
from williamchart.
Same issue here... what do you mean by define your own layout if you want to use dp?
this is my layout file:
`
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<com.db.chart.view.LineChartView
android:id="@+id/chart1"
android:layout_width="1000dp"
android:layout_height="300dp"
android:layout_marginBottom="15dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"/>
</LinearLayout>
</HorizontalScrollView>`
from williamchart.
By defining his own layout I simply meant not copy pasting the sample application and expect it to work as he wanted, without understanding the layout itself.
Can you edit your message, I think something went wrong when you posted the code of or layout?
from williamchart.
i don't know why the editor can not format my code snippet.... that is just a HorizontalScrollView
actually layout height for chart view does not work with all values .
chart disappears when i set layout_height="300dp" but works when i use 200dp!
from williamchart.
I looked into the problem but unfortunately I still cannot understand why is it happening.
What I could observe so far is that theonDraw
method doesn't get called if values too big are defined for height or width. Checking the size of the view in onMeasure
everything seems nominal. Also onPreDrawListener
gets called and with a proper view size.
For instance, in my tests, defining the values width="996dp"
and height="171dp"
the chart is displayed without problems, increasing the width in 1dp (997dp) it's not anymore displayed.
A few more bits of information can be found in #152 . All in all, for the time being I still can't point out the root cause.
from williamchart.
Does it occur when chart lies inside ScrollView?
How about
http://stackoverflow.com/questions/34374363/behavior-of-setwillnotdrawfalse ??
Maybe that's the root cause?
from williamchart.
Don't think so, I have it under onAttachedToWindow
. But anyway, I can give it a try moving it into the constructor, not sure it will make any difference.
from williamchart.
It didn't do the trick. :/
from williamchart.
I've found the problem
"BarChartView not displayed because it is too large to fit into a software layer (or drawing cache), needs 15913800 bytes, only 8294400 available"
Not sure how to solve it. Looks like scrolling should be baked into the chart itself.
from williamchart.
Thanks for sharing. I also think this should be the case, but I haven't had the time to look into it. Maybe someone from the thread can contribute.
from williamchart.
@diogobernardino I temporarily solved this by setting android:layerType="software"
on the ScrollView. Animations may be not as smooth, tho, so it's only a workaround
from williamchart.
Related Issues (20)
- Set chart_smoothLine to true leads chart to draw weird negative hooks
- Set decimals of Y-Axis values HOT 1
- Setting custom point drawable only for specific points HOT 2
- Provide a way to let tooltips draw values HOT 1
- Stack bar charts HOT 1
- It is posible to add a stroke with a specific color on touch/click event? HOT 1
- Animation not working using proGuard HOT 1
- Move repository Jcenter to mavenCentral() HOT 2
- Crashlytics Error: BarChartView.kt line 78 com.db.williamchart.view.BarChartView.drawBars
- How to set up Y axis right? HOT 1
- Grid not fitting the points (squeezed)
- Is it possible to add a small button to show value on line touched?
- crash on tooltip onDataPointTouch HOT 1
- BarChart crashing when changing data on runtime HOT 1
- Function to clear the chart
- No documentation found!!! HOT 2
- Don't have Zoom in feature
- Failed to resolve: williamchart:williamchart:unspecified HOT 3
- Colors provided do not match the number of datapoints HOT 1
- Center Aligned Graph Draw
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 williamchart.