Jawbone/JBChartView — pull request #84 by nopshusang (2014-08-08 01:45:54+00:00)
Title: Multitouch support

![chart](https://cloud.githubusercontent.com/assets/1551175/3851753/0b8f615a-1e9b-11e4-8e84-8433ab6c3703.png)

This feature enables JBChartView to support **multitouch**.
That is the two finger **range selection** on the chart as seen on Apple's stock app.
This feature should only be an incremental change to the original library. If it is disabled, the library should be running the original code for single finger selection as I did not make any change to that part of the code.

For the users to enable this feature, all they need to do is call
```objective-c
self.lineChartView.multipleTouchEnabled = YES;
self.barChartView.multipleTouchEnabled = YES;
```

Most of this feature are implemented in these two functions
```objective-c
- (void)touchesBeganOrMovedWithTouches:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEndedOrCancelledWithTouches:(NSSet *)touches withEvent:(UIEvent *)event;
```

All of my code are in its own if-condition that detect a two fingers touch and release. They will never be run unless multipleTouchEnabled is set to YES. This way the additional code would not break the original code. For example, the logic for the line chart range selection is only in
```objective-c
if ([[event allTouches]count] > 1 && self.multipleTouchEnabled){
...
}
```

I have also added four delegate functions
```objective-c
- (void)lineChartView:(JBLineChartView *)lineChartView didSelectRangeAtIndex:(NSUInteger)lineIndex leftHorizontalIndex:(NSUInteger)leftHorizontalIndex rightHorizontalIndex:(NSUInteger)rightHorizontalIndex;

- (void)lineChartView:(JBLineChartView *)lineChartView didSelectRangeAtIndex:(NSUInteger)lineIndex
leftHorizontalIndex:(NSUInteger)leftHorizontalIndex rightHorizontalIndex:(NSUInteger)rightHorizontalIndex
leftTouchPoint:(CGPoint)leftTouchPoint rightTouchPoint:(CGPoint)rightTouchPoint;

- (void)barChartView:(JBBarChartView *)barChartView didSelectRangeAtLeftIndex:(NSUInteger)leftIndex rightIndex:(NSUInteger)rightIndex LeftTouchPoint:(CGPoint)leftTouchPoint RightTouchPoint:(CGPoint)rightTouchPoint;

- (void)barChartView:(JBBarChartView *)barChartView didSelectRangeAtLeftIndex:(NSUInteger)leftIndex rightIndex:(NSUInteger)rightIndex;
```

These functions will get called once the user select a range on the chart. I have also implemented these functions in the demo code to adjust the information view and the tool tip view accordingly.

I have done a lot of manual testing for this code and I believe it is working quite perfectly. With that said, please further test it and let me know if anything else should be added to the branch.

Thank you,
Nop