我需要绘制矩形渐变以显示网站访问者会话的滚动位置的受欢迎程度。
访客滚动数据为:
{
"visitor_session_key1": {159,160,444,530,531,573,821,848,858,1037,1166,1186,1210,1243,1269,1309,1318,1548,1680,1695,1965,2051,2106,2324,2369,2459,2649,2687,2707,2914,3005,3021,3197,3323,3327,3453,3588,3677,3902,3908,4087,4277,4278,4367,4595},
"visitor_session_key2": {0,1,50,80,133,202,212,245,274,346,423,424,796,1211,1553,2737,4057,4155,4313,4322,4382,4409,4513,4534,4746,4784,4875,4905,4953,5012,5064,5099,5159,5163,5170,5223,5276,5291},
.....
}
其中:159,160,444,530,531,573,821 ...是滚动的Y位置。
在访问者会话数据中,值是浏览器中的滚动位置。如果渐变中的Y = 150位置具有100%用户滚动到的位置,则表示它更受欢迎,并会用红色填充