JSON

highchartsͼ±íʵսƪ£ºÍ¨¹ýAjaxÒì²½ºǫ́»ñÈ¡jsonÊý¾ÝÖаüº¬¶à(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-02-10 17:00 ÎÒÒªÆÀÂÛ( )

×îºó³ÊÉÏ ÍêÕûʵÀý´úÂë £¬Ï£Íû¿ÉÒÔ¸øÄãһЩ½¨Ò飺 var chart = null;//È«¾Ö¶þάÊý×évar TwoArray = new Array();//ΪÁËÄ£ÄâЧ¹ûÎÒÃÇÖ±½ÓÔÚÕâÀï½øÐÐÔìÊý¾ÝTwoArray.push(new Array("A","ÃÀÔª"));TwoArray.push(new A

Êý¾ÝÌáʾ¿ò¹²ÏíºóʵÏÖµÄÍêÃÀЧ¹ûͼչʾ

×îºó³ÊÉÏÍêÕûʵÀý´úÂ룬ϣÍû¿ÉÒÔ¸øÄãһЩ½¨Ò飺


var chart = null; //È«¾Ö¶þάÊý×é var TwoArray = new Array(); //ΪÁËÄ£ÄâЧ¹ûÎÒÃÇÖ±½ÓÔÚÕâÀï½øÐÐÔìÊý¾Ý TwoArray.push(new Array("A","ÃÀÔª")); TwoArray.push(new Array("B","ǧ¿Ë")); TwoArray.push(new Array("C","½ï")); $(function () { chart = new Highcharts.Chart({ chart:{ renderTo:"container", type:"line" }, title:{ text:"¶¯Ì¬ÉèÖõ¥Î»ÊµÀý³ÊÏÖ" }, subtitle:{ text:"from:" }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, tooltip: { shared:true,//¹²ÏíÊý¾ÝÌáʾ¿ò formatter:function(){ var curPointList = this.points; var tooltipStr = ""; //Öð¸ö·µ»Øµ¥Î»½øÐÐÊý¾ÝÆ´½ÓÈ»ºó·µ»ØÌáʾÐÅÏ¢ for(var i = 0;i<curPointList.length;i++) { //ÔÚtoolTipµÄ¸ñʽ»¯·½·¨ÄÚ»ñÈ¡¶ÔÓ¦µ¥Î» var unit = GetCurSeriesUnit(curPointList[i]); var IntooltipStr = ""; IntooltipStr = "<b>"+curPointList[i].series.name+"</b><br/>"; IntooltipStr += curPointList[i].x+"£º"+curPointList[i].y+"("+unit+")"; tooltipStr += IntooltipStr; tooltipStr += "<br/>"; } return tooltipStr; } }, credits:{ text:"www.stepday.com", href:"http://www.stepday.com", style:{ color:"red" } }, series: [{ name:"A", data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }, { name:"B", data: [9.9, 1.5, 6.4, 9.2, 4.0, 6.0, 5.6, 8.5, 6.4, 4.1, 5.6, 4.4] }, { name:"C", data: [2.9, 7.5, 1.4, 29.2, 44.0, 76.0, 35.6, 48.5, 16.4, 14.1, 9.6, 5.4] }] }); }); ///¸ù¾ÝÊý¾Ýµã¶ÔÏó»ñÈ¡µ±Ç°Êý¾ÝµãËùÔÚÐòÁÐÔÚ¶þάÊý×éÄÚËùÆ¥Åäµ½µÄµ¥Î»Ãû³Æ function GetCurSeriesUnit(pointObj) { var unitName = ""; var curSeriesName = pointObj.series.name; //ÔÚ¶þάÊý×éÄÚ½øÐÐÆ¥Åä for(var i = 0;i<TwoArray.length;i++) { if(curSeriesName == TwoArray[i][0]) { unitName = TwoArray[i][1]; break; } } return unitName; }


Áí¸½Ð§¹ûչʾ²é¿´µØÖ·£º


¶à·ÖÏí£¬¶à½ø²½£»¶àл֧³Ö£¬ÓÐÎÊÌâÇ×ËæʱÁôÑÔÌÖÂÛ£¡

highcharts£¬Í¼±í£¬ÊµÕ½£¬Ajax£¬¶¯Ì¬£¬series£¬Òì²½£¬tooltip£¬µ¥Î»£¬¶ÔÓ¦    ±¾ÎÄΪԭ´´ÐÍÎÄÕÂתÔØÇë×ðÖØËûÈËÀͶ¯³É¹û²¢×¢Ã÷³ö´¦£º?753  ¿ÉÒÔɨÃè±¾Õ¾¸Ã²©¿ÍÎÄÕµÄQR¶þάÂë½øÐзÃÎÊ  

±¾Õ¾¸Ã²©¿ÍÎÄÕµÄQR¶þάÂë

ÉÏһƪ£ºhighchartsͼ±íʵսƪ£ºÈçºÎ¶¯Ì¬Ìí¼Óͼ±í×ø±êÖá(xAxis/yAxis)ºÍseriesÐòÁÐÊý¾Ý

ÏÂһƪ£ºhighchartsͼ±íʵսƪ£ºÈçºÎͨ¹ý¼àÌýÖù×ÓµÄMouseOverºÍMouseOutʼþʵÏÖPlotLine(»®·ÖÏß)µÄÌí¼ÓÓëɾ³ý

¼Ó¾« 17 ²È±â 0

 ²é¿´ÆÀÂÛ

ÑÌ»¨Ò×Àä

ÑÌ»¨Ò×Àä  2015-2-10 11:35:33  1Â¥   

°ÑÈ¡Êý¾ÝµÄ²½ÖèҲд³öÀ´°É ´Óºǫ́»ñÈ¡json´®

 ¹ØÁªÔĶÁ

01 EChartsͼ±í³õ¼¶ÈëÃŽ̳ÌÖ®xAxis-axisLabel:ÈçºÎÉèÖÃXÖá×ø±ê¿Ì¶ÈµÄÑùʽ

02 highchartsͼ±íÖм¶ÈëÃÅÖ®xAxis label£ºX(ºá)×ø±ê¿Ì¶ÈÖµ¹ý³¤½Ø¶Ï¶àÐÐ(»»ÐÐ)ÏÔʾÎÊÌâ˵Ã÷

03 highchartsͼ±íÈëÃÅÖ®stackLabels£º¶Ñµþͼ(stacking)ÖÐÈçºÎÏÔʾÿһ×éÊý¾ÝµÄ×ÜÊýÓÚÖù×ÓÖ®ÉÏ

04 EChartsͼ±íÖм¶ÈëÃÅÖ®itemStyle£ºÈçºÎÈÃÊý¾ÝµãµÄÊý¾ÝÖµ·Ç³£Ö±¹ÛµØÏÔʾÒÔ¼°Î»ÖÿØÖÆ

05 highchartsͼ±íÖм¶ÈëÃÅÖ®dirlldown£ºÈçºÎʵÏÖpie(±ý״ͼ)µÄÏÂ×êͼ

06 ¹ØÓÚÒ³Ã涯̬´´½¨¶à¸öhighchartsͼ±íËù²úÉúµÄÎÊÌâ»ã×ÜÒÔ¼°·ÖÎö

07 EChartsͼ±í×é¼þÈëÃŽ̳̣ºÈçºÎ¶¯Ì¬¶ÁÈ¡Êý×éÄÚµÄÊý¾ÝÖÁechartsͼ±íÇÒ¶¯Ì¬¸üÐÂͼ±íYÖá¿Ì¶Èµ¥Î»

08 highchartsͼ±íÖ®bubble£ºÆøÅÝͼµÄÆøÅÝ´óС¿ØÖÆÒÔ¼°Ó°ÏìÒòËØÆÊÎö

09 highchartsÈëÃÅÖ®tooltip£ºÈçºÎÉèÖÃÊý¾Ýµã²»ÏÔʾÊý¾ÝÌáʾ¿òÇÒÏÔʾʮ×ÖË¿crosshairs

10 highchartsͼ±í¸ß¼¶ÈëÃÅÖ®polar£º¼«µØͼµÄ»ù±¾ÅäÖÃÒÔ¼°Ò»Ð©¹Ø¼üÅäÖÃ˵Ã÷

11 asp.net+AjaxÈçºÎʵÏÖHighchartsͼ±í×é¼þÖ§³Ö´óÊý¾Ý£¨ÉÏÍò¸öÊý¾Ýµã)

12 EChartsͼ±íÈëÃųõ¼¶Æª£ºÈçºÎÉèÖûæͼÇøÓò(grid)ºÍÈÝÆ÷´óСһÑù

13 EChartsͼ±í³õ¼¶ÈëÃÅƪ£ºÈçºÎÅäÖÃEChartsͼ±íÏà¹ØÎļþÒÔ¼°»ù±¾ÅäÖóÊÏÖ×î»ù±¾ÏßÐÔͼ±í

14 EChartsͼ±í×é¼þÖм¶ÈëÃÅ£¨Axis-axisLabel£©£ºÍ¼±í×ø±ê¿Ì¶È¹ý¶àÈçºÎÉèÖÿ̶ȼä¸ô£¨interval£©ÒÔ¼°ÅäÖÃ˵Ã÷

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
ÍøÓѵãÆÀ
°