Changeset 113
- Timestamp:
- 02/05/09 12:03:32 (16 months ago)
- Location:
- trunk/rapidandroid/org.rapidandroid
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/rapidandroid/org.rapidandroid/assets/flot/html/basechart.html
r102 r113 10 10 11 11 <script id="source" language="javascript" type="text/javascript"> 12 13 function showTooltip(x, y, contents) { 14 $('<div id="tooltip">' + contents + '</div>').css( { 15 position: 'absolute', 16 display: 'none', 17 top: y + 5, 18 left: x + 5, 19 border: '1px solid #fdd', 20 padding: '2px', 21 'background-color': '#fee', 22 opacity: 0.80 23 }).appendTo("body").fadeIn(200); 24 } 25 26 12 27 function load(){ 13 28 //document.getElementById('graphtitle').innerHTML = window.graphdata.getGraphTitle("wassup", 5); … … 22 37 } 23 38 function GotGraph(gData, gOptions) { 39 $("#tooltip").remove(); 40 24 41 $.plot($("#placeholder"), gData, gOptions); 42 $("#placeholder").bind("plotclick", function (event, pos, item) { 43 if (item) { 44 $("#tooltip").remove(); 45 var y = item.datapoint[1].toFixed(0); 46 showTooltip(item.pageX, item.pageY, 47 item.series.label + " = " + y); 48 } 49 }); 50 25 51 window.graphdata.finishGraph(); 26 52 } -
trunk/rapidandroid/org.rapidandroid/src/org/rapidandroid/activity/chart/form/FormDataBroker.java
r112 r113 394 394 toReturn.put("legend", getShowTrue()); 395 395 } 396 toReturn.put("grid", getJSONObject("clickable", false)); 396 397 return toReturn; 397 398 } … … 408 409 JSONObject toReturn = new JSONObject(); 409 410 toReturn.put("xaxis", this.getXaxisOptions(labels)); 411 toReturn.put("grid", getJSONObject("clickable", true)); 412 return toReturn; 413 } 414 415 private JSONObject getJSONObject(String string, Object o) { 416 JSONObject toReturn = new JSONObject(); 417 try { 418 toReturn.put(string, o); 419 } catch (Exception ex) { 420 } 410 421 return toReturn; 411 422 } … … 440 451 441 452 try { 453 rootxaxis.put("min", 0); 454 rootxaxis.put("max", tickvalues.length + tickvalues.length / 5 + 1); 442 455 rootxaxis.put("ticks", arr); 443 456 rootxaxis.put("tickFormatter", "string");