Changeset 7655 for trunk/workflow/inc/phplot/phplot.php
- Timestamp:
- 12/14/12 14:30:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/phplot/phplot.php
r6057 r7655 549 549 $this->ndx_data_colors[$i] = $this->SetIndexColor($col); 550 550 $this->ndx_data_dark_colors[$i] = $this->SetIndexDarkColor($col); 551 $i++;551 ++$i; 552 552 } 553 553 … … 574 574 foreach($this->data_border_colors as $col) { 575 575 $this->ndx_data_border_colors[$i] = $this->SetIndexColor($col); 576 $i++;576 ++$i; 577 577 } 578 578 } // function SetDataBorderColors() … … 595 595 foreach($this->error_bar_colors as $col) { 596 596 $this->ndx_error_bar_colors[$i] = $this->SetIndexColor($col); 597 $i++;597 ++$i; 598 598 } 599 599 return TRUE; … … 628 628 $this->default_dashed_style .= str_repeat('IMG_COLOR_TRANSPARENT,', $s); 629 629 } 630 $t++;630 ++$t; 631 631 } 632 632 // Remove trailing comma and add closing parenthesis … … 959 959 960 960 $ypos = $which_ypos; 961 for($i = 0; $i < $nlines; $i++) {961 for($i = 0; $i < $nlines; ++$i) { 962 962 // Center the text vertically around $which_ypos (each line) 963 963 if ($which_valign == 'center') … … 983 983 984 984 $xpos = $which_xpos; 985 for($i = 0; $i < $nlines; $i++) {985 for($i = 0; $i < $nlines; ++$i) { 986 986 // center the text around $which_xpos 987 987 if ($which_halign == 'center') … … 1710 1710 1711 1711 // Fix odd point sizes for point shapes which need it 1712 for ($i = 0; $i < $pt; $i++) {1712 for ($i = 0; $i < $pt; ++$i) { 1713 1713 if ($this->point_shapes[$i] == 'diamond' or $this->point_shapes[$i] == 'triangle') { 1714 1714 if ($this->point_sizes[$i] % 2 != 0) { … … 1762 1762 $this->total_records = 0; // Perform some useful calculations. 1763 1763 $this->records_per_group = 1; 1764 for ($i = 0, $recs = 0; $i < $this->num_data_rows; $i++) {1764 for ($i = 0, $recs = 0; $i < $this->num_data_rows; ++$i) { 1765 1765 // Copy 1766 1766 $this->data[$i] = array_values($which_dv[$i]); // convert to numerical indices. … … 1842 1842 1843 1843 // Process each row of data 1844 for ($i=0; $i < $this->num_data_rows; $i++) {1844 for ($i=0; $i < $this->num_data_rows; ++$i) { 1845 1845 $j=0; 1846 1846 // Extract maximum text label length … … 1858 1858 $miny = $maxy; 1859 1859 } 1860 for (; $j < $this->num_recs[$i]; $j++) {1860 for (; $j < $this->num_recs[$i]; ++$j) { 1861 1861 $val = (double)$this->data[$i][$j]; 1862 1862 if ($this->plot_type == 'stackedbars') { … … 1876 1876 $miny = $maxy = (double)$this->data[$i][$j++]; 1877 1877 // $numrecs = @ count($this->data[$i]); 1878 for (; $j < $this->num_recs[$i]; $j++) {1878 for (; $j < $this->num_recs[$i]; ++$j) { 1879 1879 $val = (double)$this->data[$i][$j]; 1880 1880 $maxy = ($val > $maxy) ? $val : $maxy; … … 3180 3180 $y_pos += $char_h + $this->line_spacing; 3181 3181 3182 $color_index++;3182 ++$color_index; 3183 3183 if ($color_index > $max_color_index) 3184 3184 $color_index = 0; … … 3222 3222 // Get sum of each column? One pie slice per column 3223 3223 if ($this->data_type === 'text-data') { 3224 for ($i = 0; $i < $this->num_data_rows; $i++) {3225 for ($j = 1; $j < $this->num_recs[$i]; $j++) { // Label ($row[0]) unused in these pie charts3224 for ($i = 0; $i < $this->num_data_rows; ++$i) { 3225 for ($j = 1; $j < $this->num_recs[$i]; ++$j) { // Label ($row[0]) unused in these pie charts 3226 3226 @ $sumarr[$j] += abs($this->data[$i][$j]); // NOTE! sum > 0 to make pie charts 3227 3227 } … … 3230 3230 // Or only one column per row, one pie slice per row? 3231 3231 else if ($this->data_type == 'text-data-single') { 3232 for ($i = 0; $i < $this->num_data_rows; $i++) {3232 for ($i = 0; $i < $this->num_data_rows; ++$i) { 3233 3233 $legend[$i] = $this->data[$i][0]; // Set the legend to column labels 3234 3234 $sumarr[$i] = $this->data[$i][1]; … … 3236 3236 } 3237 3237 else if ($this->data_type == 'data-data') { 3238 for ($i = 0; $i < $this->num_data_rows; $i++) {3239 for ($j = 2; $j < $this->num_recs[$i]; $j++) {3238 for ($i = 0; $i < $this->num_data_rows; ++$i) { 3239 for ($j = 2; $j < $this->num_recs[$i]; ++$j) { 3240 3240 @ $sumarr[$j] += abs($this->data[$i][$j]); 3241 3241 } … … 3304 3304 $label_txt, 'center', 'center'); 3305 3305 } 3306 $color_index++;3306 ++$color_index; 3307 3307 $color_index = $color_index % $max_data_colors; 3308 3308 } // end for … … 3325 3325 $do_labels = ($this->plot_type != 'linepoints'); 3326 3326 3327 for($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3327 for($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3328 3328 $record = 1; // Skip record #0 (title) 3329 3329 … … 3337 3337 3338 3338 // Now go for Y, E+, E- 3339 for ($idx = 0; $record < $this->num_recs[$row]; $idx++) {3339 for ($idx = 0; $record < $this->num_recs[$row]; ++$idx) { 3340 3340 // Y: 3341 3341 $y_now = $this->data[$row][$record++]; … … 3367 3367 $do_labels = ($this->plot_type != 'linepoints'); 3368 3368 3369 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3369 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3370 3370 $rec = 1; // Skip record #0 (data label) 3371 3371 … … 3383 3383 3384 3384 // Proceed with Y values 3385 for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) {3385 for($idx = 0;$rec < $this->num_recs[$row]; ++$rec, ++$idx) { 3386 3386 if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data 3387 3387 $this->DrawDot($x_now, $this->data[$row][$rec], … … 3400 3400 $this->CheckOption($this->data_type, 'text-data, data-data', __FUNCTION__); 3401 3401 3402 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3402 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3403 3403 $rec = 1; // Skip record #0 (data label) 3404 3404 … … 3416 3416 3417 3417 // Proceed with Y values 3418 for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) {3418 for($idx = 0;$rec < $this->num_recs[$row]; ++$rec, ++$idx) { 3419 3419 if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data 3420 3420 ImageSetThickness($this->img, $this->line_widths[$idx]); … … 3545 3545 $incomplete_data_defaults_to_x_axis = FALSE; // TODO: make this configurable 3546 3546 3547 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3547 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3548 3548 $rec = 1; // Skip record #0 (data label) 3549 3549 … … 3561 3561 // Proceed with Y values 3562 3562 // Create array of points for imagefilledpolygon() 3563 for($idx = 0; $rec < $this->num_recs[$row]; $rec++, $idx++) {3563 for($idx = 0; $rec < $this->num_recs[$row]; ++$rec, ++$idx) { 3564 3564 if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data 3565 3565 $y_now_pixels = $this->ytr($this->data[$row][$rec]); … … 3582 3582 3583 3583 $end = count($posarr); 3584 for ($i = 0; $i < $end; $i++) {3584 for ($i = 0; $i < $end; ++$i) { 3585 3585 // Prepend initial points. X = first point's X, Y = x_axis_y_pixels 3586 3586 $x = $posarr[$i][0]; … … 3618 3618 } 3619 3619 3620 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3620 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3621 3621 $record = 1; // Skip record #0 (data label) 3622 3622 … … 3631 3631 $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); 3632 3632 3633 for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) {3633 for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 3634 3634 if (($line_style = $this->line_styles[$idx]) == 'none') 3635 3635 continue; //Allow suppressing entire line, useful with linepoints … … 3679 3679 $start_lines = array_fill(0, $this->records_per_group, FALSE); 3680 3680 3681 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3681 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3682 3682 $record = 1; // Skip record #0 (data label) 3683 3683 … … 3691 3691 3692 3692 // Now go for Y, E+, E- 3693 for ($idx = 0; $record < $this->num_recs[$row]; $idx++) {3693 for ($idx = 0; $record < $this->num_recs[$row]; ++$idx) { 3694 3694 if (($line_style = $this->line_styles[$idx]) == 'none') 3695 3695 continue; //Allow suppressing entire line, useful with linepoints … … 3749 3749 } 3750 3750 3751 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) {3751 for ($row = 0, $cnt = 0; $row < $this->num_data_rows; ++$row) { 3752 3752 $record = 1; // Skip record #0 (data label) 3753 3753 … … 3763 3763 3764 3764 // Draw Lines 3765 for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) {3765 for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 3766 3766 if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data 3767 3767 $y_now_pixels = $this->ytr($this->data[$row][$record]); … … 3813 3813 $x_first_bar = (($this->records_per_group - 1) * $this->record_bar_width) / 2 - $this->bar_adjust_gap; 3814 3814 3815 for ($row = 0; $row < $this->num_data_rows; $row++) {3815 for ($row = 0; $row < $this->num_data_rows; ++$row) { 3816 3816 $record = 1; // Skip record #0 (data label) 3817 3817 … … 3825 3825 3826 3826 // Draw the bars in the group: 3827 for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) {3827 for ($idx = 0; $record < $this->num_recs[$row]; ++$record, ++$idx) { 3828 3828 if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data 3829 3829 $x2 = $x1 + $this->actual_bar_width; … … 3892 3892 $x_first_bar = $this->record_bar_width / 2 - $this->bar_adjust_gap; 3893 3893 3894 for ($row = 0; $row < $this->num_data_rows; $row++) {3894 for ($row = 0; $row < $this->num_data_rows; ++$row) { 3895 3895 $record = 1; // Skip record #0 (data label) 3896 3896 … … 3906 3906 // Draw the bars 3907 3907 $oldv = 0; 3908 for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) {3908 for ($idx = 0; $record < $this->num_recs[$row]; $record++, ++$idx) { 3909 3909 if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data 3910 3910
Note: See TracChangeset
for help on using the changeset viewer.