Search code examples
androidgraphhorizontalscrollview

Scroll Graph Horizontally in Custom View


I have made a graph by extending View and made graph dynamically what i want is to scroll that graph because my mobile screen is smallit takes all xaxis values so i want it to scroll horizontall

What i have done is

        HorizontalScrollView hsv=new HorizontalScrollView(this);
            ll=new LinearLayout(this); //taking Linear Layout
            ll.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT,1.0f));
            ll.setOrientation(android.widget.LinearLayout.VERTICAL);
            ll.addView(graphView);//My Graph 
            hsv.addView(ll);
            setContentView(hsv);

I want to this Dynamically because my entire code is dynamic So i need help , it is not showing the graph when i implement this


Solution

  • Hi you can do one thing, instead of trying scroll graph

    Horizontally try to swipe drawing lines and points ,its easy

    all we have to swipe canvas view