-2

graph should have pinch to zoom functionality which should change graph from Month to Week and then on further zooming to days. below image shows the highest level of zoom i.e in hours so essentially zooming out using pinch should change the scale to days, further zoom out leads to weeks, and finally to Month...

Is this possible without any external libraries in native android (java). Need Help and fast!!!

Image:

https://i.stack.imgur.com/vbMsl.png

jigar1859
  • 1
  • 2
  • 1
    you can use achartengine it supports different charts like bar chart, pie chart, scattered chart and it also supports zooming and scaling. – Maulik.J Dec 31 '13 at 11:11
  • The answer is... YES, IT IS POSSIBLE. BUT IT'S NOT RECOMMENDED to that work without the help of an external ready-made library (possibly open source so you can also modify it, if needed). Check Shiva's answer- I personally use aChartEngine, as Maulik suggests. – Phantômaxx Dec 31 '13 at 11:14
  • @Tobor does aChartEngine support pinch zoom? i.e does pinching in and out automatically change the scale of the graph? if not could you suggest some thing that does? – jigar1859 Dec 31 '13 at 11:25
  • As far as I know there is ZOOM in/out (I removed it in my own implementation, to be lighter). I don't know if pinchable. Then there is PAN, a VERY WIDE RANGE of charts, not only linear. Multiple charts can be shown at once, even different kinds... It's worth a try. It's FREE and OPEN SOURCE. There's an exhaustive DEMO to show you all the features. Please, see this [video](http://www.youtube.com/watch?v=s8cpqFrbnk8&hd=1). I must ask Dan (the author) for a salary increase ;) – Phantômaxx Dec 31 '13 at 11:34

1 Answers1

1

There are a bunch of graph plotting libraries have a look.

Android plot

Achart Engine

Afree Chart

ShinobiCharts

Shiva
  • 6,677
  • 4
  • 36
  • 61
  • @Tobor: the other easy trick I can imagine of is creating a canvas inside a web view and plot the graph on it using libraries like jQPlot or even by javascript(if you find it easy) ,but then again this might be an overkill, so I would still recommend using these libraries until you have a very strong reason for avoiding them. – Shiva Dec 31 '13 at 11:20
  • 1
    I agree completely. He wants to draw the plot himself without the use of libraries, but I DISCOURAGE him to do so. There are so many GREAT libraries to easen our work... – Phantômaxx Dec 31 '13 at 11:21
  • @Tobor does aChartEngine support pinch zoom? i.e does pinching in and out automatically change the scale of the graph? if not could you suggest some thing that does with some sample code i could learn from? – jigar1859 Dec 31 '13 at 11:31