Git Product home page Git Product logo

Comments (12)

fabiancrx avatar fabiancrx commented on July 16, 2024 1

This issue persists in v3 of the library.

from williamchart.

diogobernardino avatar diogobernardino commented on July 16, 2024

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.

alisherafat01 avatar alisherafat01 commented on July 16, 2024

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.

diogobernardino avatar diogobernardino commented on July 16, 2024

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.

alisherafat01 avatar alisherafat01 commented on July 16, 2024

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.

diogobernardino avatar diogobernardino commented on July 16, 2024

I looked into the problem but unfortunately I still cannot understand why is it happening.
What I could observe so far is that theonDrawmethod 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.

lukcz avatar lukcz commented on July 16, 2024

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.

diogobernardino avatar diogobernardino commented on July 16, 2024

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.

diogobernardino avatar diogobernardino commented on July 16, 2024

It didn't do the trick. :/

from williamchart.

charlag avatar charlag commented on July 16, 2024

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.

diogobernardino avatar diogobernardino commented on July 16, 2024

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.

charlag avatar charlag commented on July 16, 2024

@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)

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.