redpandatronicsuk / arty-charty

React Native plugin for rendering charts using ART
MIT License
43 stars 7 forks source link

Can't find variable: SVG #7

Closed ameinc closed 7 years ago

ameinc commented 7 years ago

It has an issue about SVG at

makeYaxis(num, minVal, maxVal) { const width = this.props.width || Dimensions.get('window').width let topY = (CHART_HEIGHT+CHART_HEIGHT_OFFSET) - this.maxValue ((CHART_HEIGHT-MARKER_RADIUS)/this.maxValue); let bottomY = CHART_HEIGHT+CHART_HEIGHT/2; let i; let interval = (bottomY - topY) / num; let lineVal = this.maxValue; let lineDecrement = (maxVal - minVal) / num; let lines = []; for (i = 0 ; i <= num; i++) { lines.push(<Path key={i} strokeDash={[0, 0, 4, 6]} stroke="black" strokeWidth={.5} d={`M 0 ${topY + interval i} H ${width}`} />); *lines.push(<SVG.Text key={1000+i} fill="black" stroke="white" strokeWidth={1} x={0} y={(topY + interval i) - 22} font="20px Arial">{lineVal.toFixed(2)}</SVG.Text>);** lineVal -= lineDecrement; } return lines; }

It won't work properly either when charts has a y axis with label.

redpandatronicsuk commented 7 years ago

Thanks for reporting the issue, I think it should be fixed in the latest version.