Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
rAmChart和naiver图之间的严重差异_R_Amcharts - Fatal编程技术网

rAmChart和naiver图之间的严重差异

rAmChart和naiver图之间的严重差异,r,amcharts,R,Amcharts,我观察到rAmChartsplot和普通R图之间存在非常严重的差异,如下所示: 我的数据 dat = structure(list(x = c(-100, -99.61, -99.22, -98.83, -98.43, -98.04, -97.65, -97.26, -96.87, -96.48, -96.09, -95.69, -95.3, -94.91, -94.52, -94.13, -93.74, -93.35, -92.95, -92.56, -92.17, -91.78, -9

我观察到
rAmCharts
plot和普通R图之间存在非常严重的差异,如下所示:

我的数据

dat = structure(list(x = c(-100, -99.61, -99.22, -98.83, -98.43, -98.04, 
-97.65, -97.26, -96.87, -96.48, -96.09, -95.69, -95.3, -94.91, 
-94.52, -94.13, -93.74, -93.35, -92.95, -92.56, -92.17, -91.78, 
-91.39, -90, -90.61, -90.22, -89.82, -89.43, -89.04, -88.65, 
-88.26, -87.87, -87.48, -87.08, -86.69, -86.3, -85.91, -85.52, 
-85.13, -84.74, -84.34, -83.95, -83.56, -83.17, -82.78, -82.39, 
-81, -81.6, -81.21, -80.82, -80.43, -80.04, -79.65, -79.26, -78.86, 
-78.47, -78.08, -77.69, -77.3, -76.91, -76.52, -76.13, -75.73, 
-75.34, -74.95, -74.56, -74.17, -73.78, -73.39, -72.99, -72.6, 
-72.21, -71.82, -71.43, -71.04, -70.65, -70.25, -69.86, -69.47, 
-69.08, -68.69, -68.3, -67.91, -67.51, -67.12, -66.73, -66.34, 
-65.95, -65.56, -65.17, -64.77, -64.38, -63.99, -63.6, -63.21, 
-62.82, -62.43, -62.04, -61.64, -61.25, -60.86, -60.47, -60.08, 
-59.69, -59.3, -58.9, -58.51, -58.12, -57.73, -57.34, -56.95, 
-56.56, -56.16, -55.77, -55.38, -54.99, -54.6, -54.21, -53.82, 
-53.42, -53.03, -52.64, -52.25, -51.86, -51.47, -51.08, -50.68, 
-50.29, -49.9, -49.51, -49.12, -48.73, -48.34, -47.95, -47.55, 
-47.16, -46.77, -46.38, -45.99, -45.6, -45.21, -44.81, -44.42, 
-44.03, -43.64, -43.25, -42.86, -42.47, -42.07, -41.68, -41.29, 
-40.9, -40.51, -40.12, -39.73, -39.33, -38.94, -38.55, -38.16, 
-37.77, -37.38, -36.99, -36.59, -36.2, -35.81, -35.42, -35.03, 
-34.64, -34.25, -33.86, -33.46, -33.07, -32.68, -32.29, -31.9, 
-31.51, -31.12, -30.72, -30.33, -29.94, -29.55, -29.16, -28.77, 
-28.38, -27.98, -27.59, -27.2, -26.81, -26.42, -26.03, -25.64, 
-25.24, -24.85, -24.46, -24.07, -23.68, -23.29, -22.9, -22.5, 
-22.3, -22.11, -21.72, -21.33, -20.94, -20.8, -20.55, -20.16, 
-19.77, -19.37, -18.98, -18.59, -18.36, -18.2, -18.2, -17.94, 
-17.81, -17.5, -17.42, -17.03, -16.63, -16.48, -16.24, -15.99, 
-15.85, -15.67, -15.46, -15.07, -14.68, -14.29, -13.89, -13.5, 
-13.11, -12.78, -12.72, -12.7, -12.33, -11.94, -11.75, -11.55, 
-11.29, -11.25, -11.21, -11.15, -10.96, -10.95, -10.76, -10.37, 
-10.35, -10.26, -10.06, -9.98, -9.82, -9.79, -9.64, -9.59, -9.55, 
-9.48, -9.35, -9.2, -8.93, -8.93, -8.89, -8.86, -8.81, -8.81, 
-8.78, -8.68, -8.61, -8.59, -8.5, -8.5, -8.48, -8.46, -8.44, 
-8.41, -8.41, -8.35, -8.24, -8.21, -8.02, -8.01, -8, -7.82, -7.78, 
-7.7, -7.63, -7.61, -7.55, -7.49, -7.45, -7.44, -7.43, -7.39, 
-7.25, -7.24, -7.23, -7.22, -7.08, -7.06, -7, -6.98, -6.97, -6.95, 
-6.93, -6.85, -6.82, -6.82, -6.8, -6.77, -6.74, -6.69, -6.69, 
-6.68, -6.64, -6.62, -6.61, -6.55, -6.51, -6.46, -6.45, -6.43, 
-6.39, -6.2, -6.17, -6.14, -6.13, -6.13, -6.09, -6.07, -6.06, 
-6.04, -5.91, -5.84, -5.82, -5.81, -5.81, -5.79, -5.76, -5.73, 
-5.73, -5.73, -5.69, -5.68, -5.66, -5.61, -5.59, -5.56, -5.56, 
-5.54, -5.49, -5.48, -5.44, -5.39, -5.37, -5.35, -5.32, -5.28, 
-5.25, -5.22, -5.18, -5.15, -5.14, -5.08, -4.98, -4.97, -4.94, 
-4.89, -4.89, -4.88, -4.83, -4.82, -4.8, -4.79, -4.78, -4.78, 
-4.76, -4.76, -4.75, -4.72, -4.7, -4.65, -4.65, -4.63, -4.63, 
-4.6, -4.58, -4.56, -4.52, -4.5, -4.5, -4.48, -4.39, -4.38, -4.36, 
-4.35, -4.35, -4.29, -4.27, -4.24, -4.24, -4.22, -4.11, -4.09, 
-4.08, -4.07, -4.06, -4.01, -4, -3.97, -3.97, -3.96, -3.94, -3.92, 
-3.92, -3.89, -3.87, -3.78, -3.76, -3.74, -3.72, -3.72, -3.66, 
-3.63, -3.61, -3.58, -3.55, -3.54, -3.53, -3.51, -3.48, -3.45, 
-3.45, -3.42, -3.39, -3.35, -3.33, -3.32, -3.32, -3.32, -3.31, 
-3.29, -3.26, -3.25, -3.24, -3.24, -3.18, -3.17, -3.15, -3.13, 
-3.12, -3.12, -3.1, -3.08, -3.07, -3.05, -3.04, -3.02, -3.02, 
-2, -2.99, -2.99, -2.94, -2.94, -2.93, -2.91, -2.89, -2.87, -2.87, 
-2.85, -2.78, -2.78, -2.77, -2.77, -2.72, -2.72, -2.69, -2.66, 
-2.65, -2.64, -2.62, -2.59, -2.59, -2.56, -2.54, -2.52, -2.5, 
-2.49, -2.48, -2.48, -2.47, -2.44, -2.43, -2.43, -2.4, -2.39, 
-2.38, -2.37, -2.33, -2.31, -2.29, -2.25, -2.24, -2.24, -2.24, 
-2.18, -2.15, -2.13, -2.13, -2.13, -2.12, -2.11, -2.11, -2.11, 
-2.1, -2.08, -2.06, -2.05, -2.04, -2.03, -2.02, -2.01, -1, -1, 
-1, -1.96, -1.96, -1.96, -1.92, -1.9, -1.89, -1.89, -1.87, -1.85, 
-1.85, -1.84, -1.8, -1.77, -1.77, -1.77, -1.76, -1.75, -1.71, 
-1.71, -1.69, -1.67, -1.67, -1.64, -1.64, -1.62, -1.61, -1.61, 
-1.6, -1.6, -1.6, -1.6, -1.58, -1.53, -1.52, -1.52, -1.51, -1.51, 
-1.5, -1.5, -1.49, -1.46, -1.45, -1.45, -1.42, -1.41, -1.39, 
-1.38, -1.37, -1.37, -1.35, -1.35, -1.34, -1.34, -1.32, -1.26, 
-1.26, -1.25, -1.24, -1.23, -1.21, -1.2, -1.19, -1.19, -1.18, 
-1.18, -1.12, -1.11, -1.08, -1.06, -1.05, -1.03, -1.02, -1.01, 
-1.01, 0.99, 0.98), y = c(1.7597036882208e-16, 3.74523809420545e-16, 
6.79924138728896e-16, 5.49147548890779e-16, 2.8444302872708e-16, 
2.01730936037434e-16, 4.72623693209037e-16, 5.25606872427607e-16, 
5.75755789341732e-19, 2.74318552000638e-17, 7.41872388571549e-17, 
1.16379243552747e-16, 1.30330176931005e-17, 1.44493324181405e-16, 
1.48200512266161e-16, 2.12152823477696e-16, 1.23512766683157e-16, 
1.32574841143743e-16, 4.4989064700399e-17, 1.34533164086192e-16, 
1.9006081627268e-16, 2.39080196757097e-16, 1.19793582322272e-16, 
9.50635502478515e-17, 8.85078754774532e-17, 4.07507372548731e-17, 
4.87962996842999e-17, 0, 0, 0, 2.02892803804376e-17, 4.77664676933343e-17, 
0, 1.31499591351899e-17, 7.60486578480149e-17, 1.34732404205651e-16, 
9.84383117921681e-17, 2.24652146268012e-18, 3.31437566467248e-17, 
1.36540032813809e-16, 2.25953576019843e-18, 0, 0, 4.92104796977405e-17, 
8.099623943331e-18, 0, 0, 1.68058680233949e-16, 6.11817343303322e-17, 
0, 7.32356256580957e-17, 1.11022302462516e-16, 4.49824864436716e-17, 
0, 2.35376025518364e-16, 2.36916329000193e-16, 1.56876067466473e-16, 
2.76152717298367e-16, 1.79699773609809e-16, 7.12971788226661e-17, 
5.55999796122692e-17, 1.17156003547801e-16, 1.21796814022842e-16, 
6.93708098703207e-17, 2.83704104610286e-16, 3.17428461074929e-16, 
1.82186510295273e-16, 1.82565027831131e-17, 1.70358298315398e-16, 
2.00925226771026e-16, 2.18926513598978e-16, 2.50480721582232e-17, 
6.59248227028292e-17, 1.96892892698323e-16, 2.46794494653556e-17, 
0, 0, 0, 2.397323191816e-17, 8.92821565470295e-18, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 2.88455838264677e-17, 7.0903834176121e-17, 
1.5914161580599e-18, 5.43777976183126e-18, 0, 0, 0, 8.01793020909566e-18, 
1.2291364865812e-16, 3.91534557759051e-16, 3.3339281324276e-17, 
2.6920670063884e-16, 5.12703847636537e-16, 4.10252736291125e-16, 
1.67335218413958e-16, 2.36208053218858e-17, 5.19139551821771e-17, 
1.6990665717063e-16, 1.05671649235152e-16, 7.87822176087936e-17, 
1.31251504649561e-16, 1.12727132108941e-16, 3.55500613269496e-17, 
0, 2.94711841144511e-16, 4.71230498411639e-16, 2.86538537127018e-16, 
1.77054704896858e-16, 3.17917488682109e-16, 7.43912492234354e-16, 
9.85299115340156e-16, 7.51672782664393e-16, 5.9132409817199e-16, 
3.98097952968957e-16, 6.5578603393698e-16, 5.97145485901949e-16, 
1.60433998243202e-16, 4.25811910271435e-16, 4.7870409012117e-16, 
4.25996607810613e-16, 2.05598457899487e-19, 8.78373073137105e-17, 
2.38668937977388e-16, 2.27739609138721e-16, 2.87264175662675e-17, 
2.71265894601827e-16, 2.55298436762032e-16, 1.92315140433518e-16, 
4.59305282512086e-17, 0, 0, 0, 0, 1.25447724280112e-17, 9.74746480755506e-18, 
0, 0, 1.61193874244055e-16, 2.07516793040518e-16, 0, 1.04932676825905e-17, 
4.29781195771582e-17, 5.05418409161244e-17, 3.37097279421464e-18, 
1.01755688786198e-17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.39585185015462e-15, 1.00307844757947e-13, 
2.78448660159713e-12, 6.05733870945561e-11, 1.04637782728879e-09, 
1.44073701738736e-08, 1.58850745566864e-07, 1.41127816790393e-06, 
1.01818929340863e-05, 6.01696909626074e-05, 0.000293593157911075, 
0.00118947246272509, 0.0040083082842067, 0.0112687308437839, 
0.0262927189912457, 0.0498053871221169, 0.0777181016466707, 0.102442967983551, 
0.114986839963252, 0.118580121597716, 0.126177132309074, 0.127188782805811, 
0.121271820956834, 0.117465483484553, 0.108780200046537, 0.0976939209894227, 
0.104149523914498, 0.142645607882759, 0.212686252049453, 0.293612480605814, 
0.342210910701918, 0.355155413224826, 0.365154855448977, 0.384819051158378, 
0.378154517274975, 0.376509064918937, 0.367722515593318, 0.345362658913025, 
0.327076034070167, 0.321727820129925, 0.309516245037894, 0.294803947891027, 
0.277545792264962, 0.257889549151338, 0.223616507372753, 0.158476326312876, 
0.104669098520124, 0.0824283288525812, 0.100684513213946, 0.155971603197872, 
0.236698861779982, 0.311407776596513, 0.332086110342108, 0.333113928406455, 
0.440655671266963, 0.567336730000337, 0.63637445909586, 0.7102703824769, 
0.809920607861078, 0.825849445050381, 0.842550078559163, 0.861152674706014, 
0.938370078905393, 0.941108110137537, 1.02472066702563, 1.22677194585943, 
1.22373255169458, 1.27786285801321, 1.42010690766794, 1.49834300218549, 
1.61414740995607, 1.64462278104917, 1.78936230867798, 1.84945210274464, 
1.87411466011563, 1.9463825982544, 2.08613976834005, 2.2553419669841, 
2.54631534493486, 2.5524480071148, 2.59394035381691, 2.62554425369102, 
2.68014249846383, 2.67141240872526, 2.70757149824811, 2.81603238909785, 
2.8839899688641, 2.90184882278971, 2.9951287820443, 2.99652139700154, 
3.01724028758715, 3.03534730166617, 3.0556897358388, 3.07108480003771, 
3.08740871482752, 3.1453151227964, 3.25227249128586, 3.27621420636615, 
3.46929997872363, 3.47318869267193, 3.48126797055692, 3.67730633718784, 
3.7197125935055, 3.80027475958662, 3.90071388567187, 3.90745839492175, 
3.97765265132038, 4.04662603771724, 4.10150453224692, 4.10840939509678, 
4.11848162897357, 4.17427230709211, 4.35616347869055, 4.3773911786099, 
4.37333127319114, 4.39074795131003, 4.57413296670597, 4.5991835145369, 
4.67173403660532, 4.70771012631921, 4.71833532297898, 4.73859091510558, 
4.7609988834314, 4.87851897030545, 4.90688099592749, 4.90708495949766, 
4.94269681072076, 4.97724651284863, 5.01861247231422, 5.0816122115511, 
5.08288122580106, 5.09645478789259, 5.14849989788669, 5.1765014973309, 
5.18806946280539, 5.26102008301815, 5.31513220867376, 5.37901322965186, 
5.39050904937277, 5.41467432648789, 5.46862958191719, 5.70402838742514, 
5.74068017503184, 5.7869355981015, 5.79292592322843, 5.79809906089682, 
5.84679504928192, 5.87405075516485, 5.88105929301511, 5.9112534644012, 
6.08119015734939, 6.16315973447742, 6.18547228033177, 6.2029788813203, 
6.20626915953848, 6.23218318922145, 6.26960642805249, 6.30081251375971, 
6.30334175165671, 6.30598836813381, 6.35550115668848, 6.37217878250992, 
6.39762760751607, 6.46630424712907, 6.48266081704103, 6.5201176295341, 
6.53056617507125, 6.54589874311096, 6.61653276370493, 6.62593263262898, 
6.67546833550753, 6.73985555239059, 6.77221124359663, 6.79980517064019, 
6.83918921144544, 6.87713048798536, 6.92763866766738, 6.95977301066436, 
7.01353711451419, 7.06028221091086, 7.0717115945324, 7.14185635363182, 
7.2730318576457, 7.28607564938541, 7.32289581246292, 7.38965010818126, 
7.39577517563281, 7.40450978843896, 7.4719981715159, 7.48680307301975, 
7.51262664110236, 7.52712480348432, 7.5382560820532, 7.53847644359348, 
7.56221663623504, 7.56265518809399, 7.57565032702851, 7.60668165263275, 
7.63800529332195, 7.70056516841558, 7.70263063282773, 7.73450954917983, 
7.73901295061052, 7.77224569243977, 7.80244794623114, 7.8230242472877, 
7.88990576584967, 7.92912616458532, 7.91899477452608, 7.93783697777415, 
8.07079188787864, 8.08607402868743, 8.11257695782476, 8.12803240275844, 
8.13286606685409, 8.21642150157843, 8.24515663469641, 8.30159239085307, 
8.3026739892953, 8.32564628010195, 8.5441825420166, 8.53731995330964, 
8.5636118706574, 8.57954219394595, 8.60000261083962, 8.69281856402821, 
8.69891636496432, 8.74866752381885, 8.75832423422554, 8.78209552768877, 
8.8157292790575, 8.84245063132663, 8.85227119925912, 8.90615780503739, 
8.93733128458003, 9.12822776206417, 9.16137350978205, 9.19533828269928, 
9.24802535874669, 9.2879130233507, 9.37411616202131, 9.44877014946975, 
9.47970402875784, 9.5558881475768, 9.61468401105343, 9.63581709000357, 
9.67457783743398, 9.70838906470135, 9.77942073015735, 9.85344799782491, 
9.85935139960286, 9.92615568316011, 9.99104533257134, 10.0998615305448, 
10.173098354516, 10.167178735392, 10.1683760801022, 10.1728419753319, 
10.1897428750678, 10.2330374342752, 10.3055994416899, 10.3481776368482, 
10.35565504472, 10.3629965495382, 10.5251166230264, 10.5522124316336, 
10.5830584906381, 10.6356336313048, 10.6588922173047, 10.6809595148848, 
10.7220655484965, 10.7776583022015, 10.7992452102138, 10.8630540268205, 
10.8844617554606, 10.9244759193515, 10.9249087038458, 10.9883268932042, 
11.0097089543663, 11.0097346241578, 11.1252492688711, 11.1465363027297, 
11.1501437235196, 11.2073828938633, 11.2627254111225, 11.3244002008142, 
11.3285281334781, 11.3607433381032, 11.5448215655493, 11.5492154944198, 
11.5638760696493, 11.5754499839043, 11.6957329062312, 11.7132466623605, 
11.7698381257655, 11.8545623483949, 11.8806317388234, 11.8890981384401, 
11.9570028739073, 12.0237221695926, 12.0333114872137, 12.1014250352705, 
12.0930640441288, 12.1978327722867, 12.2265251283613, 12.2531231238963, 
12.2769904479287, 12.2906523656393, 12.2991257148763, 12.3699676292038, 
12.3816847947217, 12.3966833191452, 12.4639664222951, 12.4884815352879, 
12.4968395998859, 12.5138537174711, 12.5952885497219, 12.6430034996264, 
12.6765777170897, 12.7622590902194, 12.7687076739649, 12.7727993658869, 
12.7837206146135, 12.8754885410316, 12.8469996815148, 12.9560088492823, 
12.9566436411234, 12.9624377506546, 12.9766670002181, 12.9850505491804, 
12.9855574265221, 12.9890340483016, 13.0107968127549, 13.0411747523884, 
13.0670015731243, 13.0738265725302, 13.0905943751396, 13.1035864740683, 
13.1184469209409, 13.1241124605893, 13.1384855640382, 13.140800787323, 
13.1408559371454, 13.1753353582809, 13.1800666445606, 13.1838356640309, 
13.2159448058419, 13.2337595744097, 13.2444669737106, 13.2453554169858, 
13.255254612637, 13.2723568098737, 13.2735311191899, 13.2805103886435, 
13.2962997928538, 13.3101767801431, 13.310438133793, 13.3108118677924, 
13.2132771863309, 13.3152011787449, 13.3231568502587, 13.3234714687251, 
13.324276432583, 13.3239574342302, 13.3238821702482, 13.3203816703585, 
13.319685478936, 13.3167971140072, 13.3139101061223, 13.3129451756278, 
13.3107139382814, 13.3088823484563, 13.3087236774467, 13.3077988854603, 
13.3032458439853, 13.2744479528264, 13.268477049554, 13.2672314189783, 
13.2627288615878, 13.2615675531721, 13.2529572332396, 13.2518182569097, 
13.2457204237367, 13.217819620186, 13.2121808418273, 13.2071194043963, 
13.1747472790749, 13.1722840548772, 13.1452116491842, 13.134543705708, 
13.0310721277639, 13.117305936063, 13.0905392509933, 13.0880701934228, 
13.0830568146902, 13.0730030443181, 13.0557358249779, 12.9598269042632, 
12.9591078315098, 12.9418487176909, 12.9120563995794, 12.8911691983967, 
12.8683905110946, 12.8504880667736, 12.8225964838503, 12.8199268803159, 
12.8051415856952, 12.8013879059933, 12.6645568170687, 12.6601553773751, 
12.5762338009767, 12.5342515954331, 12.5050088385454, 12.4630698111222, 
12.4205255859797, 12.4069677138716, 12.3975537517596, 12.3531930414859, 
12.3321844078684), z = structure(c(1L, 1L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, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L), .Label = "Balloon", class = "factor")), .Names = c("x", 
"y", "z"), row.names = c(NA, 600L), class = "data.frame")
rAmCharts绘图

    library(rAmCharts)
     balloonFunction <- htmlwidgets::JS(
        'function(item) {',
        'if (item.dataContext[\'x\']!=0) { return \'X: \' + item.dataContext[\'x\'] + 
                                   \'<br>Y: \' + item.dataContext[\'y\'] +
                                   \'<br>Z: \' + item.dataContext[\'z\'];}',
        '}')

    p <- amSerialChart(categoryField = "x", precision = 2) %>%
      setDataProvider(dataProvider = dat, keepNA = TRUE) %>%
      addGraph(valueField = "y", lineColor = "gray", fillAlphas=0.5,
               bullet="round", lineThickness=4) %>%
      setChartCursor() %>%
      setBalloon(cornerRadius=10, color="white",textAlign="left", maxWidth = 1300) 

    p@graphs[[1]]$balloonFunction <- balloonFunction
    p
plot(x = dat$x, y = dat$y, type = 'l')
如您所见,这两种不同的打印系统的视图存在严重差异

你知道如何使
rAmCharts
接近
普通R图吗

提前谢谢

附言:我感谢马可·桑德里以上述方式帮助设计气球,这是我故事情节中不可或缺的一部分

根据Marco的建议,下面是我的闪亮应用程序,用于为AMSharts实现用户定义的高度

ui.R

library(rAmCharts)
library(highcharter)
library(purrr)


 fluidPage(
    tagList(tags$head(includeCSS("CSS.css"))),
  selectInput("Dummy", "Some Dummy number:",c(1,2,3)),

  div(amChartsOutput("Plot", height = "1400px"))
)
server <- function(input, output) {
  set.seed(1)

    balloonFunction <- htmlwidgets::JS(
          'function(item) {',
          'if (item.dataContext[\'x\']!=0) { 
               return \'X: \' + item.dataContext.x + 
                  \'<br>Y: \' + item.dataContext.y +  
                  \'<br>Z: \' + item.dataContext.z;}',
           '}')

    labFunx <- htmlwidgets::JS(
          'function(value) {',
          'return value+\'%\';',    
          '}')

    dat = structure(list(x = c(-100, -99.61, -99.22, -98.83, -98.43, -98.04, 
        -97.65, -97.26, -96.87, -96.48, -96.09, -95.69, -95.3, -94.91, 
        -94.52, -94.13, -93.74, -93.35, -92.95, -92.56, -92.17, -91.78, 
        -91.39, -90, -90.61, -90.22, -89.82, -89.43, -89.04, -88.65), 
            y = c(1.7597036882208e-16, 3.74523809420545e-16, 6.79924138728896e-16, 
            5.49147548890779e-16, 2.8444302872708e-16, 2.01730936037434e-16, 
            4.72623693209037e-16, 5.25606872427607e-16, 5.75755789341732e-19, 
            2.74318552000638e-17, 7.41872388571549e-17, 1.16379243552747e-16, 
            1.30330176931005e-17, 1.44493324181405e-16, 1.48200512266161e-16, 
            2.12152823477696e-16, 1.23512766683157e-16, 1.32574841143743e-16, 
            4.4989064700399e-17, 1.34533164086192e-16, 1.9006081627268e-16, 
            2.39080196757097e-16, 1.19793582322272e-16, 9.50635502478515e-17, 
            8.85078754774532e-17, 4.07507372548731e-17, 4.87962996842999e-17, 
            0, 0, 0), z = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
            1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
            1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Balloon", class = "factor")), .Names = c("x", 
        "y", "z"), row.names = c(NA, 30L), class = "data.frame")




    dat <- dat[order(dat$x),]
    nr <- nrow(dat)
    last.row <- dat[nr,]
    last.row$y <- 0
    dat <- rbind(dat, last.row)
    p <- amXYChart(x=dat$x, y=dat$y) %>%
          setDataProvider(dataProvider = dat, keepNA = TRUE) %>%
          addGraph(xField = "x", yField = "y", lineColor = "gray", fillAlphas=0.5,
                   bullet="round", lineThickness=2, bulletColor="transparent") %>%
          setChartCursor() %>%
          setBalloon(cornerRadius=10, color="black", textAlign="left", maxWidth = 1300) 
    p@graphs[[1]]$balloonFunction <- balloonFunction
    p@valueAxes <- list(list(title='x-axis name', position='bottom',axisAlpha=0.5,
                             labelFunction=labFunx),
                        list(title='y-axis name', position='left',axisAlpha=0.5))
    output$Plot = renderAmCharts(p)

}
server.R

library(rAmCharts)
library(highcharter)
library(purrr)


 fluidPage(
    tagList(tags$head(includeCSS("CSS.css"))),
  selectInput("Dummy", "Some Dummy number:",c(1,2,3)),

  div(amChartsOutput("Plot", height = "1400px"))
)
server <- function(input, output) {
  set.seed(1)

    balloonFunction <- htmlwidgets::JS(
          'function(item) {',
          'if (item.dataContext[\'x\']!=0) { 
               return \'X: \' + item.dataContext.x + 
                  \'<br>Y: \' + item.dataContext.y +  
                  \'<br>Z: \' + item.dataContext.z;}',
           '}')

    labFunx <- htmlwidgets::JS(
          'function(value) {',
          'return value+\'%\';',    
          '}')

    dat = structure(list(x = c(-100, -99.61, -99.22, -98.83, -98.43, -98.04, 
        -97.65, -97.26, -96.87, -96.48, -96.09, -95.69, -95.3, -94.91, 
        -94.52, -94.13, -93.74, -93.35, -92.95, -92.56, -92.17, -91.78, 
        -91.39, -90, -90.61, -90.22, -89.82, -89.43, -89.04, -88.65), 
            y = c(1.7597036882208e-16, 3.74523809420545e-16, 6.79924138728896e-16, 
            5.49147548890779e-16, 2.8444302872708e-16, 2.01730936037434e-16, 
            4.72623693209037e-16, 5.25606872427607e-16, 5.75755789341732e-19, 
            2.74318552000638e-17, 7.41872388571549e-17, 1.16379243552747e-16, 
            1.30330176931005e-17, 1.44493324181405e-16, 1.48200512266161e-16, 
            2.12152823477696e-16, 1.23512766683157e-16, 1.32574841143743e-16, 
            4.4989064700399e-17, 1.34533164086192e-16, 1.9006081627268e-16, 
            2.39080196757097e-16, 1.19793582322272e-16, 9.50635502478515e-17, 
            8.85078754774532e-17, 4.07507372548731e-17, 4.87962996842999e-17, 
            0, 0, 0), z = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
            1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
            1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Balloon", class = "factor")), .Names = c("x", 
        "y", "z"), row.names = c(NA, 30L), class = "data.frame")




    dat <- dat[order(dat$x),]
    nr <- nrow(dat)
    last.row <- dat[nr,]
    last.row$y <- 0
    dat <- rbind(dat, last.row)
    p <- amXYChart(x=dat$x, y=dat$y) %>%
          setDataProvider(dataProvider = dat, keepNA = TRUE) %>%
          addGraph(xField = "x", yField = "y", lineColor = "gray", fillAlphas=0.5,
                   bullet="round", lineThickness=2, bulletColor="transparent") %>%
          setChartCursor() %>%
          setBalloon(cornerRadius=10, color="black", textAlign="left", maxWidth = 1300) 
    p@graphs[[1]]$balloonFunction <- balloonFunction
    p@valueAxes <- list(list(title='x-axis name', position='bottom',axisAlpha=0.5,
                             labelFunction=labFunx),
                        list(title='y-axis name', position='left',axisAlpha=0.5))
    output$Plot = renderAmCharts(p)

}
您可以尝试以下方法:

library(rAmCharts)
library(purrr)
balloonFunction <- htmlwidgets::JS(
      'function(item) {',
      'if (item.dataContext[\'x\']!=0) { 
           return \'X: \' + item.dataContext.x + 
              \'<br>Y: \' + item.dataContext.y +  
              \'<br>Z: \' + item.dataContext.z;}',
       '}')

labFunx <- htmlwidgets::JS(
      'function(value) {',
      'return value+\'%\';',    
      '}')

dat <- dat[order(dat$x),]
nr <- nrow(dat)
last.row <- dat[nr,]
last.row$y <- 0
dat <- rbind(dat, last.row)
p <- amXYChart(x=dat$x, y=dat$y) %>%
      setDataProvider(dataProvider = dat, keepNA = TRUE) %>%
      addGraph(xField = "x", yField = "y", lineColor = "gray", fillAlphas=0.5,
               bullet="round", lineThickness=2, bulletColor="transparent") %>%
      setChartCursor() %>%
      setBalloon(cornerRadius=10, color="black", textAlign="left", maxWidth = 1300) 
p@graphs[[1]]$balloonFunction <- balloonFunction
p@valueAxes <- list(list(title='x-axis name', position='bottom',axisAlpha=0.5,
                         labelFunction=labFunx),
                    list(title='y-axis name', position='left',axisAlpha=0.5))
p
库(rAmCharts)
图书馆(purrr)

谢谢你,马可。但我观察到,当我试图取出子弹时,并没有气球出现。e、 g使用addGraph(xField=“x”、yField=“y”、lineColor=“gray”、fillAlphas=0.5、lineThickness=1)时,不会出现引出序号。有什么原因吗?这太完美了。有一个必然的问题。如何将“%”符号添加到x轴记号号旁边?也就是说,我不想报告-100,-80,-60等,我想显示-100%,-80%等。汉克斯·马尔科,你能帮我调整图表区域的大小吗?当我尝试使用amXYChart(x=dat$x,y=dat$y,height=400)时,我的图表并没有显示得更大,而是被裁剪了。嗨,马可,我在谷歌上搜索了一下就看到了。但是,如果您需要将此绘图与Shining一起使用,则无法在ramCharts(即R实现)的上下文中应用此绘图,请参见
?amChartsOutput