pChart 2.x forum http://wiki.pchart.net/forum/ |
|
VOID values and BreakVoid parameter http://wiki.pchart.net/forum/viewtopic.php?f=3&t=2126 |
Page 1 of 1 |
Author: | chartbreaker [ Sat Aug 06, 2011 2:33 pm ] |
Post subject: | VOID values and BreakVoid parameter |
Hi JD, you already helped me with my combocharts some days ago. My page imports seriesdata from txt/csv and transfers data-arrays to the included chart-rendering file. Works fine, but I recognized that zero-values bring the spline(s) down on the abscissa (which is covered then). I can do a worse workaround by repeating the drawscale command after drawing the splines, but the result is not the best, because of the double rendering So I got my import function to walk the arrays and replace the zeros with VOID (the function works correctly, tested with other values). I tried different ways like: VOID or 'VOID' and chr(86).chr(79).chr(73).chr(68) but the default VOID-suppression does not interpret these VOIDs. As explained for spline charts I tried to play with breakvoid (true/false) and breakR, breakG, breakB without any effects. What am I doing wrong? Is there a way to force the abscissa shown in the foreground? (like z-index) |
Author: | jean-damien [ Mon Aug 08, 2011 8:17 am ] |
Post subject: | Re: VOID values and BreakVoid parameter |
Hi, If you replace the 0 values by the VOID keyword then the points will not be drawn. ( breakvoid will display a dashed line between the points around the VOID values so it will not help here). VOID is a constant so it can be used this way : Code: if ( $Value == 0 ) { $Value = VOID; } can you post the output of the $MyData->getData(); function called before doing the chart? -I mean when the dataset is ready to be charted (put an exit(); statement just after or you'll get a 500 if rendering to a browser). Kind regards, JD. |
Author: | chartbreaker [ Mon Aug 08, 2011 10:23 am ] |
Post subject: | Re: VOID values and BreakVoid parameter |
Hi JD, thanks for your quick reply.. Is there an option to force the abscissa drawn in the foreground? (like z-index)? it is not a problem with using the VOID-constant in the substitution-function Code: function setVOID(&$zeroitem) { // reference to original value of array-items if ($zeroitem == 0) { $zeroitem = VOID; } } here is the output, the VOIDs are set correctly (please look arround [Data][50]) Code: [Series] => Array ( [Wärme] => Array ( [Description] => Wärme [isDrawable] => 1 [Picture] => [Max] => VOID [Min] => 0.25 [Axis] => 1 [Ticks] => 0 [Weight] => 0 [Shape] => 681011 [Color] => Array ( [R] => 220 [G] => 220 [B] => 220 [Alpha] => 100 ) [Data] => Array ( [0] => 7.50 [1] => 7.50 [2] => 7.75 [3] => 8.00 [4] => 8.00 [5] => 8.00 [6] => 8.25 [7] => 8.50 [8] => 8.75 [9] => 8.75 [10] => 8.75 [11] => 9.00 [12] => 8.75 [13] => 8.75 [14] => 9.00 [15] => 9.00 [16] => 8.75 [17] => 9.00 [18] => 9.25 [19] => 9.25 [20] => 9.25 [21] => 9.25 [22] => 8.75 [23] => 8.75 [24] => 8.50 [25] => 8.25 [26] => 7.75 [27] => 7.50 [28] => 7.50 [29] => 7.50 [30] => 7.75 [31] => 7.25 [32] => 7.50 [33] => 7.50 [34] => 7.50 [35] => 7.75 [36] => 8.00 [37] => 8.00 [38] => 8.00 [39] => 8.00 [40] => 8.00 [41] => 7.50 [42] => 7.25 [43] => 7.50 [44] => 4.75 [45] => 0.25 [46] => VOID [47] => VOID [48] => VOID [49] => VOID [50] => VOID [51] => VOID [52] => VOID [53] => VOID [54] => VOID [55] => VOID [56] => VOID [57] => VOID [58] => VOID [59] => VOID [60] => VOID [61] => 3.75 [62] => 7.00 [63] => 7.25 [64] => 7.50 [65] => 7.50 [66] => 7.25 [67] => 7.50 [68] => 7.50 [69] => 7.50 [70] => 7.50 [71] => 7.50 [72] => 7.75 [73] => 7.75 [74] => 7.50 [75] => 7.75 [76] => 7.75 [77] => 7.75 [78] => 7.50 [79] => 7.75 [80] => 7.50 [81] => 7.75 [82] => 7.50 [83] => 7.75 [84] => 7.50 [85] => 7.75 [86] => 7.75 [87] => 7.75 [88] => 7.50 [89] => 7.75 [90] => 8.00 [91] => 7.75 [92] => 7.50 [93] => 7.75 [94] => 7.50 [95] => 7.75 [96] => 7.75 [97] => 7.75 [98] => 7.75 [99] => 7.75 [100] => 7.75 [101] => 7.75 [102] => 7.75 [103] => 7.75 [104] => 7.75 [105] => 7.75 [106] => 8.00 [107] => 7.50 [108] => 7.75 [109] => 7.75 [110] => 7.75 [111] => 8.00 [112] => 7.50 [113] => 7.75 [114] => 7.75 [115] => 7.75 [116] => 7.75 [117] => 7.75 [118] => 7.75 [119] => 7.75 [120] => 7.75 [121] => 8.00 [122] => 7.75 [123] => 7.75 [124] => 7.75 [125] => 7.75 [126] => 7.75 [127] => 7.50 [128] => 7.50 [129] => 7.50 [130] => 7.75 [131] => 7.50 [132] => 7.50 [133] => 7.50 [134] => 7.25 [135] => 7.50 [136] => 7.50 [137] => 7.50 [138] => 7.50 [139] => 7.75 [140] => 7.50 [141] => 7.75 [142] => 7.75 [143] => 7.50 [144] => 7.25 ) ) [Strom] => Array ( [Description] => Strom [isDrawable] => 1 [Picture] => [Max] => VOID [Min] => 25 [Axis] => 0 [Ticks] => 0 [Weight] => 0 [Shape] => 681011 [Color] => Array ( [R] => 242 [G] => 148 [B] => 0 [Alpha] => 100 ) [Data] => Array ( [0] => 600 [1] => 600 [2] => 600 [3] => 600 [4] => 625 [5] => 625 [6] => 650 [7] => 650 [8] => 675 [9] => 675 [10] => 675 [11] => 675 [12] => 675 [13] => 700 [14] => 700 [15] => 725 [16] => 700 [17] => 725 [18] => 725 [19] => 725 [20] => 725 [21] => 725 [22] => 650 [23] => 675 [24] => 650 [25] => 625 [26] => 575 [27] => 550 [28] => 550 [29] => 550 [30] => 550 [31] => 550 [32] => 550 [33] => 550 [34] => 550 [35] => 575 [36] => 575 [37] => 600 [38] => 600 [39] => 600 [40] => 600 [41] => 575 [42] => 550 [43] => 550 [44] => 250 [45] => VOID [46] => VOID [47] => VOID [48] => VOID [49] => VOID [50] => VOID [51] => VOID [52] => VOID [53] => VOID [54] => VOID [55] => VOID [56] => VOID [57] => VOID [58] => VOID [59] => VOID [60] => VOID [61] => 25 [62] => 575 [63] => 575 [64] => 600 [65] => 600 [66] => 600 [67] => 600 [68] => 600 [69] => 600 [70] => 625 [71] => 600 [72] => 625 [73] => 625 [74] => 625 [75] => 625 [76] => 625 [77] => 625 [78] => 625 [79] => 625 [80] => 625 [81] => 625 [82] => 625 [83] => 625 [84] => 625 [85] => 625 [86] => 650 [87] => 650 [88] => 625 [89] => 650 [90] => 650 [91] => 650 [92] => 625 [93] => 625 [94] => 625 [95] => 625 [96] => 625 [97] => 650 [98] => 625 [99] => 625 [100] => 625 [101] => 625 [102] => 625 [103] => 625 [104] => 625 [105] => 625 [106] => 625 [107] => 625 [108] => 625 [109] => 625 [110] => 625 [111] => 625 [112] => 625 [113] => 625 [114] => 625 [115] => 625 [116] => 625 [117] => 625 [118] => 625 [119] => 600 [120] => 625 [121] => 625 [122] => 625 [123] => 625 [124] => 625 [125] => 600 [126] => 625 [127] => 600 [128] => 600 [129] => 600 [130] => 600 [131] => 600 [132] => 600 [133] => 600 [134] => 600 [135] => 600 [136] => 600 [137] => 600 [138] => 600 [139] => 600 [140] => 575 [141] => 575 [142] => 575 [143] => 575 [144] => 575 ) ) |
Author: | jean-damien [ Mon Aug 08, 2011 10:31 am ] |
Post subject: | Re: VOID values and BreakVoid parameter |
There is no concept of z-index, functions are drawing sequentially on the picture object in the order they are called. It looks that the variable isn't correctly set by your function, the array should not contains the "VOID" keyword but its value (0.123456789). While parsing the data array, the function will translate the string VOID to the 0 value explaining the issue you have. JD. |
Author: | chartbreaker [ Mon Aug 08, 2011 12:20 pm ] |
Post subject: | Re: VOID values and BreakVoid parameter |
got it working now sometimes it is so simple that you don't see it* the pData.class should be included before walking the arrays to substitute zero by VOID so that Code: define("VOID", 0.123456789); annoyingly I did that yesterday before I wrote the posting, but at that time my browser still presented me a cached version* of my page, which I have suppressed meanwhile thanks for your support (and sorry for wasting your time) |
Author: | jean-damien [ Mon Aug 08, 2011 12:24 pm ] |
Post subject: | Re: VOID values and BreakVoid parameter |
;o) You can fake the browser cache by appending a random string to the picture URL, this helps for debugging. JD. |
Author: | chartbreaker [ Mon Aug 08, 2011 8:51 pm ] |
Post subject: | Re: VOID values and BreakVoid parameter |
as followup: I finally managed to get my desired result thereto I defined two different scaleSettings-arrays and ran the drawScale function twice first before drawing the charts: - while font color was set identically equal to background color to hide the text - grid and backgroundCycle defined as needed - arrows, axis, ticks, subTicks, skippedTicks turned off by FALSE or by there alpha=>0 secondly after drawing the charts: - while font color was set as desired - grid and backgroundCycle unset by FALSE (or removed) or by alpha=>0 - arrows, axis, ticks, subTicks, skippedTicks turned on as needed set Antialias = FALSE before each drawScale command and Antialias = TRUE afterwards the VOIDs in the series were finally no good solution in this case pChart rocks! |
Author: | jean-damien [ Tue Aug 09, 2011 6:59 am ] |
Post subject: | Re: VOID values and BreakVoid parameter |
I really like the design you've made, the colors & layout are well choosen. Well done ;o) |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |