Changeset 352791
- Timestamp:
- 02/28/2011 12:45:29 AM (15 years ago)
- Location:
- easy-chart-builder/trunk
- Files:
-
- 3 edited
-
easy-chart-builder.php (modified) (1 diff)
-
js/easy-chart-builder.js (modified) (15 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-chart-builder/trunk/easy-chart-builder.php
r352484 r352791 2 2 /* 3 3 Plugin Name: Easy Chart Builder 4 Version: 0.9. 64 Version: 0.9.7 5 5 Plugin URI: http://www.dyerware.com/main/easy-chart-builder 6 6 Description: Creates a chart directly in your post or page via shortcut. Manages sizing of chart to support wptouch and other mobile themes. -
easy-chart-builder/trunk/js/easy-chart-builder.js
r210780 r352791 1 1 /** 2 2 * Handle: easyChartBuilder 3 * Version: 0.1 0.23 * Version: 0.11.0 4 4 * Enqueue: true 5 5 * … … 11 11 12 12 13 13 14 String.prototype.trim = function () 14 15 { … … 28 29 e.style.display = 'block'; 29 30 } 30 31 32 31 33 easyChartBuilder.prototype.pieChart = function(chartId, chartImg, chartWidth, chartHeight, chartHandle) 32 34 { … … 141 143 else {minAxis = "0";} 142 144 } 145 143 146 144 147 tempString = chartHandle["watermark"]; … … 152 155 var chartMarkers = this.buildMarkers(chartHandle, tempGroupNames.length); 153 156 154 var url_src = null; 157 var url_src = null; 155 158 var common_parts = "chs=" + chartWidth + "x" + chartHeight + 156 159 "&chma=10,10,10,40" + … … 161 164 chartMarkers; 162 165 166 var gridOut = chartHandle["grid"]; 167 var gridGroups = 100.0 / chartGroups; 168 var gridValues = 100.0 / 10.0; 169 163 170 if (chartType == "vertbar") 164 171 { 165 172 url_src ="http://chart.apis.google.com/chart?cht=bvg&chbh=r,0.2,1.0&" + common_parts + 166 173 "&chxt=y,x&chxr=0," + minAxis + "," + maxMin[0]; 174 175 if (gridOut == true) 176 {url_src += "&chg=" + 0 + "," + gridValues + ",1,5";} 167 177 } 168 178 else if (chartType == "horizbar") … … 170 180 url_src ="http://chart.apis.google.com/chart?cht=bhg&chbh=r,0.2,1.0&" + common_parts + 171 181 "&chxt=x,y&chxr=0," + minAxis + "," + maxMin[0]; 182 if (gridOut == true) 183 {url_src += "&chg=" + gridValues + "," + 0 + ",1,5";} 172 184 } 173 185 else if (chartType == "vertbarstack") … … 175 187 url_src ="http://chart.apis.google.com/chart?cht=bvs&chbh=r,0.2,1.0&" + common_parts + 176 188 "&chxt=y,x&chxr=0," + minAxis + "," + maxMin[0]; 189 if (gridOut == true) 190 {url_src += "&chg=" + 0 + "," + gridValues + ",1,5";} 177 191 } 178 192 else if (chartType == "horizbarstack") … … 180 194 url_src ="http://chart.apis.google.com/chart?cht=bhs&chbh=r,0.2,1.0&" + common_parts + 181 195 "&chxt=x,y&chxr=0," + minAxis + "," + maxMin[0]; 196 if (gridOut == true) 197 {url_src += "&chg=" + gridValues + "," + 0 + ",1,5";} 182 198 } 183 199 else if (chartType == "line") … … 185 201 url_src ="http://chart.apis.google.com/chart?cht=lc&" + common_parts + 186 202 "&chxt=y,x&chxr=0," + minAxis + "," + maxMin[0]; 203 if (gridOut == true) 204 {url_src += "&chg=" + gridGroups + "," + gridValues + ",1,5";} 187 205 } 188 206 else … … 285 303 } 286 304 305 easyChartBuilder.prototype.commaFormat = function(inNum) 306 { 307 var num = Math.floor(inNum); 308 num = num.toString(); 309 for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) 310 num = num.substring(0,num.length-(4*i+3))+','+ 311 num.substring(num.length-(4*i+3)); 312 313 return num; 314 } 287 315 288 316 easyChartBuilder.prototype.buildChartData = function(handle, headers, valueGrid) … … 301 329 { 302 330 precisionVal = parseInt(precision); 331 } 332 333 var commatize = false; 334 if (currency != "") 335 { 336 commatize = true; 303 337 } 304 338 … … 316 350 { 317 351 var tval = 0.0; 352 var tString; 318 353 319 354 output = output + "<tr><th align='right'>" + valueTitles[t].trim() + "</th>"; … … 324 359 else 325 360 {tval = valueGrid[v][t].toFixed(precisionVal);} 326 output = output + "<td>" + currency + tval + "</td>"; 361 362 363 if (commatize) 364 {tString = this.commaFormat(tval);} 365 else 366 {tString = tval;} 367 368 output = output + "<td>" + currency + tString + "</td>"; 327 369 } 328 370 output = output + "</tr>"; … … 567 609 this.groupChart(chartType, chartId, imgId, new_width, new_height, chartHandle); 568 610 } 569 570 /* 571 else if (chartType == "vertbar") 572 { 573 this.vertBarChart(chartId, imgId, new_width, new_height, chartHandle); 574 } 575 else if (chartType == "horizbar") 576 { 577 this.horizBarChart(chartId, imgId, new_width, new_height, chartHandle); 578 } 579 else if (chartType == "line") 580 { 581 this.lineChart(chartId, imgId, new_width, new_height, chartHandle); 582 } 583 else 584 { 585 alert("Unknown chart type: " + chartType); 586 imgId.src = "NO_VALID_CHART_TYPE"; 587 } 588 */ 611 589 612 }; 590 613 -
easy-chart-builder/trunk/readme.txt
r352484 r352791 6 6 Requires at least: 2.8 7 7 Tested up to: 3.1 8 Stable tag: 0.9. 68 Stable tag: 0.9.7 9 9 10 10 This plugin allows you to easily create charts within your blog by use of shortcodes. … … 71 71 == Upgrade Notice == 72 72 73 = 0.9. 6=73 = 0.9.7 = 74 74 Added grid background option (use argument 'grid' with true or false). 75 75 Currency now results in comma separated values in table data. … … 113 113 114 114 == Changelog == 115 116 = 0.9.7 = 117 * Fixed commas. 115 118 116 119 = 0.9.6 =
Note: See TracChangeset
for help on using the changeset viewer.