@webileapps/react-native-charts-wrapper
Advanced tools
Sorry, the diff of this file is not supported yet
@@ -8,2 +8,3 @@ package com.github.wuxudong.rncharts.charts; | ||
| import android.graphics.RectF; | ||
| import android.view.MotionEvent; | ||
@@ -17,2 +18,3 @@ import com.facebook.react.uimanager.ThemedReactContext; | ||
| import com.github.mikephil.charting.interfaces.datasets.ILineScatterCandleRadarDataSet; | ||
| import com.github.mikephil.charting.listener.BarLineChartTouchListener; | ||
| import com.github.mikephil.charting.renderer.LineChartRenderer; | ||
@@ -58,2 +60,14 @@ import com.github.mikephil.charting.renderer.XAxisRenderer; | ||
| this.setOnTouchListener(new BarLineChartTouchListener(this, mViewPortHandler.getMatrixTouch(), 3f){ | ||
| @Override | ||
| protected void performHighlight(Highlight h, MotionEvent e) { | ||
| if (mViewPortHandler.isInBounds(e.getX(), e.getY())) { | ||
| if (!h.equalTo(mLastHighlighted)) { | ||
| super.performHighlight(h, e); | ||
| } | ||
| } | ||
| } | ||
| }); | ||
| this.setXAxisRenderer( new XAxisRenderer(this.mViewPortHandler, this.mXAxis, this.mLeftAxisTransformer) { | ||
@@ -60,0 +74,0 @@ /** |
@@ -118,2 +118,19 @@ // Created by xudong wu on 24/02/2017. | ||
| override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { | ||
| if (viewPortHandler.isInBoundsX(pt.x)) { | ||
| let highlight = super.getHighlightByTouchPoint(pt); | ||
| if (!(highlight?.isEqual(lastHighlighted) ?? true)) { | ||
| return highlight; | ||
| } | ||
| } | ||
| return lastHighlighted; | ||
| } | ||
| override func highlightValue(_ highlight: Highlight?, callDelegate: Bool) { | ||
| if (highlight == nil) { | ||
| return; | ||
| } | ||
| super.highlightValue(highlight, callDelegate: callDelegate); | ||
| } | ||
| internal func drawHightedValueAtTop(context : CGContext) { | ||
@@ -120,0 +137,0 @@ if (!valuesToHighlight()) { |
+1
-1
@@ -7,3 +7,3 @@ { | ||
| }, | ||
| "version": "0.0.10", | ||
| "version": "0.0.11", | ||
| "description": "A highly customized react-native charts support both android and ios. Won't scrol the graph.", | ||
@@ -10,0 +10,0 @@ "author": "wuxudong", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1231593
0.42%251
0.4%3956
0.3%