简体   繁体   English

HighCharts:在 Android 上绘制心电图方格纸

[英]HighCharts: drawing graph paper for ECG on Android

in my Android app I found the need to draw, in a part of my activity, the result of an ECG bluetooth device acquisition;在我的 Android 应用程序中,我发现需要在我的一部分活动中绘制 ECG 蓝牙设备采集的结果; in other activity i can draw graph to visualize other vital parameters using HighCharts without problems, but for ECG a lot of challanges spawned!在其他活动中,我可以毫无问题地使用 HighCharts 绘制图表来可视化其他重要参数,但对于 ECG,产生了很多挑战!

The first, and most difficult at the time, is to draw the graph paper where the ECG lies;首先,也是当时最困难的,是在心电图所在的方格纸上画出; for those who doesn't know, it's a special grid composed by squares (ticks), major ones composed by 5 minor ones, representing time on X axis (0.2s major tick, 0.04s minor ticks) and voltage on Y axis (0.5mV major ticks, 0.1mV minor ticks).对于那些不知道的人,这是一个由正方形(刻度)组成的特殊网格,主要的由5个次要的组成,代表X轴上的时间(0.2s主要刻度,0.04s次要刻度)和Y轴上的电压(0.5 mV 主要刻度,0.1mV 次要刻度)。

My goal is to draw this graph paper keeping the size of these squares fixed, for example, 25dp for the major ticks (thus 5d for the minor ticks),both on vertical and horizontal.我的目标是绘制这张方格纸,保持这些方块的大小固定,例如,主要刻度为 25dp(因此次要刻度为 5d),垂直和水平。

Using various HighCharts properties, as使用各种 HighCharts 属性,如

  • setTickPixelInterval设置TickPixelInterval
  • setTickInterval设置TickInterval
  • setMinotTickInterval设置MinotTickInterval

and more, when the duration of the acquisition changes, the graph stretches to reduce the graph length (also using the scrollableArea) modifying the desidered tick dimension.更重要的是,当采集的持续时间发生变化时,图形会拉伸以减少图形长度(也使用 scrollableArea)修改所需的刻度尺寸。

There's a way to fix the tick dimension in a way that HighChart won't ever modify it?有一种方法可以以 HighChart 永远不会修改它的方式修复刻度尺寸吗?

Thanks in advance!提前致谢!

The height and width of the HIChart object are in pixels and what you got from your container is probably the value in dp. HIChart object 的高度和宽度以像素为单位,您从容器中获得的可能是 dp 中的值。 You need to convert these values to pixels and use that value for the height/width of the chart.您需要将这些值转换为像素并将该值用于图表的高度/宽度。

This will really only change the size of the chart that is in the container, ie in our HIChartView .这实际上只会改变容器中图表的大小,即在我们的HIChartView中。 I would rather not move the height/width values of the chart but operate directly on the HIChartView .我宁愿不移动图表的高度/宽度值,而是直接在HIChartView上操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM