5000
5320
5400
5100
4950
4850
我需要将它们拟合到折线点,最大值应为120,最小值为0。
如何做到这一点,我想到了以下几种不同的方法:
$total = "The Total Value Of All Datasets"
$row['value'] = "The Value Of The Current Dataset";
$point = ceil (($row['value'] / $total) * 1200);
上面的例子将呈现非常接近的数字,这是不理想的,因为我需要最大的代表120和最低的0和其他之间的数字。
SVG和多段线的静态示例
<svg viewBox="0 0 500 100" class="mktcap_spark">
<polyline
fill="none"
stroke="#e9be3d"
stroke-width="8"
points="
00,120
20,60
40,120
60,10
80,80
100,80
120,60
140,100
160,90
180,80
200, 110
220, 10
240, 70
260, 100
280, 100
300, 40
320, 0
340, 100
360, 100
380, 120
400, 60
420, 70
440, 80
460, 20
480, 50
500, 30
"
/>
</svg>