...
|
...
|
@@ -45,13 +45,19 @@ export default class ChartView extends Component { |
|
|
scalesPageToFit={true}
|
|
|
startInLoadingState={false}
|
|
|
javaScriptEnabled={true}
|
|
|
scrollEnabled={false}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const chartHeight = (Platform.OS === 'android') ? 250 : 250;
|
|
|
const fontSize = (Platform.OS === 'android') ? 14 : 14;
|
|
|
const width = Dimensions.get('window').width;
|
|
|
const initRatio = 465 / 250;
|
|
|
const height = width / initRatio;
|
|
|
|
|
|
const chartHeight = height + 75;
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
container: {
|
...
|
...
|
@@ -65,25 +71,24 @@ const styles = StyleSheet.create({ |
|
|
},
|
|
|
chartStyle: {
|
|
|
height: chartHeight,
|
|
|
marginLeft: -45,
|
|
|
marginRight: -45,
|
|
|
// marginLeft: -45,
|
|
|
// marginRight: -45,
|
|
|
marginBottom: 15,
|
|
|
},
|
|
|
});
|
|
|
|
|
|
const fontSize = (Platform.OS === 'android') ? 14 : 14;
|
|
|
const width = Dimensions.get('window').width;
|
|
|
|
|
|
|
|
|
function getHTMLString(xData, yData, jsPath) {
|
|
|
const HTML = `
|
|
|
<!DOCTYPE html>
|
|
|
<html style="width: ` + width + `; height: 100%; margin: 0px;">
|
|
|
<html style="width: ` + width + `; height: ` + height + `; margin: 0px;">
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
|
|
|
<meta name="viewport" content="width=` + width + `,initial-scale=1.0,user-scalable=no"/>
|
|
|
</head>
|
|
|
<body style="width: ` + width + `; height: 100%; margin: 0px;">
|
|
|
<div id="container" style="width: ` + width + `; height: 100%; margin: 0px; min-height: 250px;"></div>
|
|
|
<body style="width: ` + width + `; height: ` + height + `; margin: 0px;">
|
|
|
<div id="container" style="width: ` + width + `; height: ` + height + `; margin: 0px; min-height: 250px;"></div>
|
|
|
<script type="text/javascript" src="`+ jsPath +`"></script>
|
|
|
<script type="text/javascript">
|
|
|
var dom = document.getElementById("container");
|
...
|
...
|
@@ -95,10 +100,10 @@ function getHTMLString(xData, yData, jsPath) { |
|
|
show: false,
|
|
|
},
|
|
|
grid: {
|
|
|
left: '5%',
|
|
|
left: 0,
|
|
|
top: 60,
|
|
|
right: '8%',
|
|
|
width: '90%',
|
|
|
right: 0,
|
|
|
width: ` + width + `,
|
|
|
height: '65%',
|
|
|
},
|
|
|
xAxis: {
|
...
|
...
|
@@ -107,10 +112,6 @@ function getHTMLString(xData, yData, jsPath) { |
|
|
axisLine: {
|
|
|
show: true,
|
|
|
onZero: false,
|
|
|
lineStyle: {
|
|
|
width: 1,
|
|
|
color: 'gray',
|
|
|
},
|
|
|
},
|
|
|
axisTick: {
|
|
|
show:false,
|
...
|
...
|
@@ -138,6 +139,9 @@ function getHTMLString(xData, yData, jsPath) { |
|
|
axisLabel: {
|
|
|
show: false,
|
|
|
},
|
|
|
splitLine: {
|
|
|
show: true,
|
|
|
},
|
|
|
},
|
|
|
tooltip: {
|
|
|
show: true,
|
...
|
...
|
|