gpt4 book ai didi

android - 如何放大 Highcharts Android

转载 作者:行者123 更新时间:2023-11-29 18:05:14 24 4
gpt4 key购买 nike

我正在为 HTC desire S 开发一个 android 应用程序。我正在使用 highcharts 绘制图表。虽然我无法缩放曲线。我使用了 zoomType : 'x',但它不起作用。谁能告诉我可能是什么问题。另外,如果有其他缩放方式。下面是我的代码:

 $(function callJS() {  

var carter = dataLoader.getfhr();
var myArray = carter.split(" ");
for(var i=0; i<myArray.length; i++)

{ myArray[i] = parseFloat(myArray[i]); }

var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'spline',
zoomType: 'x',
spacingRight: 20,
backgroundColor : '#E8E8E8'
},
title: {
text: 'Fetal Heart Rate'
},
subtitle: {
// text: 'October 6th and 7th 2009 at two locations in Vik i Sogn, Norway'
},
xAxis: {
gridLineWidth: 1,
lineColor: '#CC3333',
tickColor: '#CC3333',
//minorTickInterval: 1,
// minorTickLength: 0
},
yAxis: {
title: {
text: 'FHR values'
},
min: 1500,
max: 3500,
minorTickInterval: 10,
lineColor: '#CC3333',
lineWidth: 1,
//tickWidth: 1,
tickColor: '#CC3333',
//minorGridLineWidth: 'auto',
//gridLineColor : '#CC3333',
//minorTickInterval: 10,
//minorTickLength : 'auto',
// gridLineWidth: 2,
alternateGridColor: null,
plotBands: [{ // mark the weekend
color: 'pink',
//from: 120,
// to:160
}]
},
tooltip: {
formatter: function() {
return '<b>' + this.series.name + '</b><br/>' + this.x + ': ' + this.y;
}
},
plotOptions: {
spline: {
lineWidth: 4,
states: {
hover: {
lineWidth: 5
}
},
marker: {
enabled: false,
states: {
hover: {
enabled: true,
symbol: 'circle',
radius: 5,
lineWidth: 1
}
}
},

}
},
series: [{
name: 'FHR value',
data: myArray,
color: '#383838',
//dataLabels: {
// align: 'left',
// enabled: true
// }
}]

});
});

});

谢谢。

最佳答案

我可以确认缩放功能在 Android 4.2.1 上工作得很好,Android 2.x 不支持 HighCharts 提供的很多功能,因为它使用不同的渲染器,因为 Android 2.x 不支持SVG 的。

Android 2.x

Android 2.x doesn't have SVG support built in, so we have created a separate renderer based on the canvg library for this system. This solution has some limitations:

  1. Using Highstock on Android 2.x is not recommended as it relies heavily on zooming and mouse interaction
  2. Shared tooltip is always enabled.
  3. During first render, the canvg renderer + rgbcolor.js + canvg.js (concatenated to one file) will be downloaded from code.highcharts.com This is configurable with the global.canvasToolsURL option.
  4. Chart and series animation is turned off.
  5. Show/hide series from the legend is not enabled. Series and point touch events are not enabled.
  6. Zooming is not enabled.
  7. Using the Renderer API directly to add shapes to the charts is not supported.

关于android - 如何放大 Highcharts Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13717374/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com