├── MtGoxClient.php ├── README.md ├── chart.php ├── chart_sample.png ├── configs.php ├── console.png ├── data ├── data.csv ├── fake_index.txt ├── fakegox.txt ├── fakegox_tickers(24.12-26.12).txt ├── fakegox_tickers(25.12).txt ├── fakegox_tickers(25.12-27.12).txt ├── fakegox_tickers(27.12).txt ├── last.txt ├── log.txt ├── log_clean.txt ├── next_mov.csv └── settings.ini ├── functions.php ├── hal.png ├── hal_twitter.png ├── index.php ├── makesudden.php ├── pChart ├── GPLv3.txt ├── cache │ ├── cache.db │ └── index.db ├── class │ ├── pBarcode128.class.php │ ├── pBarcode39.class.php │ ├── pBubble.class.php │ ├── pCache.class.php │ ├── pData.class.php │ ├── pDraw.class.php │ ├── pImage.class.php │ ├── pIndicator.class.php │ ├── pPie.class.php │ ├── pRadar.class.php │ ├── pScatter.class.php │ ├── pSplit.class.php │ ├── pSpring.class.php │ ├── pStock.class.php │ └── pSurface.class.php ├── data │ ├── 128B.db │ └── 39.db ├── examples │ ├── buildAll.cmd │ ├── delayedLoader │ │ ├── delayedLoading.js │ │ ├── draw.php │ │ ├── index.php │ │ └── wait.gif │ ├── example.Combo.area.lines.php │ ├── example.Combo.php │ ├── example.Mixed.classes.php │ ├── example.addRandomValues.php │ ├── example.barcode.php │ ├── example.barcode128.php │ ├── example.barcode39.php │ ├── example.basic.php │ ├── example.cache.php │ ├── example.createFunctionSerie.php │ ├── example.createFunctionSerie.scatter.php │ ├── example.draw2DPie.labels.php │ ├── example.draw2DPie.php │ ├── example.draw2DRing.php │ ├── example.draw2DRingValues.php │ ├── example.draw3DPie.labels.php │ ├── example.draw3DPie.php │ ├── example.draw3DPie.transparent.php │ ├── example.draw3DRing.php │ ├── example.draw3DRingValues.php │ ├── example.drawAnscombeQuartet.php │ ├── example.drawAntialiasPixel.php │ ├── example.drawAreaChart.enhanced.php │ ├── example.drawAreaChart.php │ ├── example.drawAreaChart.simple.php │ ├── example.drawAreaChart.threshold.php │ ├── example.drawAreaMirror.php │ ├── example.drawArrow.php │ ├── example.drawArrowLabel.php │ ├── example.drawBarChart.borders.php │ ├── example.drawBarChart.can.php │ ├── example.drawBarChart.floating.php │ ├── example.drawBarChart.palette.php │ ├── example.drawBarChart.php │ ├── example.drawBarChart.poll.php │ ├── example.drawBarChart.shaded.php │ ├── example.drawBarChart.simple.php │ ├── example.drawBarChart.spacing.php │ ├── example.drawBarChart.span.php │ ├── example.drawBarChart.vertical.php │ ├── example.drawBestfit.php │ ├── example.drawBezier.php │ ├── example.drawBubbleChart.php │ ├── example.drawBubbleChart.simple.php │ ├── example.drawBubbleChart.square.php │ ├── example.drawCircle.php │ ├── example.drawContour.php │ ├── example.drawDerivative.php │ ├── example.drawDerivative.simple.php │ ├── example.drawFilledCircle.php │ ├── example.drawFilledRectangle.php │ ├── example.drawFilledSplineChart.php │ ├── example.drawFilledSplineChart.threshold.php │ ├── example.drawFilledStepChart.php │ ├── example.drawFromGIF.php │ ├── example.drawFromJPG.php │ ├── example.drawFromPNG.php │ ├── example.drawGeometricMean.php │ ├── example.drawGradientArea.php │ ├── example.drawHarmonicMean.php │ ├── example.drawIndicator.php │ ├── example.drawLabel.barchart.php │ ├── example.drawLabel.bubble.php │ ├── example.drawLabel.caption.php │ ├── example.drawLabel.php │ ├── example.drawLabel.scatter.php │ ├── example.drawLabel.stacked.php │ ├── example.drawLabel.vertical.php │ ├── example.drawLegend.php │ ├── example.drawLine.php │ ├── example.drawLineChart.php │ ├── example.drawLineChart.plots.php │ ├── example.drawLineChart.reversed.php │ ├── example.drawLineChart.simple.php │ ├── example.drawMedian.php │ ├── example.drawPieLegend.php │ ├── example.drawPlotChart.icon.php │ ├── example.drawPlotChart.php │ ├── example.drawPlotChart.simple.php │ ├── example.drawPolygon.php │ ├── example.drawProgress.php │ ├── example.drawRectangle.php │ ├── example.drawRoundedFilledRectangle.php │ ├── example.drawRoundedRectangle.php │ ├── example.drawScale.color.php │ ├── example.drawScale.custom.php │ ├── example.drawScale.dates.php │ ├── example.drawScale.floating.php │ ├── example.drawScale.labels.php │ ├── example.drawScale.manual.php │ ├── example.drawScale.multiple.php │ ├── example.drawScale.php │ ├── example.drawScale.reverse.php │ ├── example.drawScatter.shape.php │ ├── example.drawScatter.simple.php │ ├── example.drawScatterBestFit.php │ ├── example.drawScatterLineChart.php │ ├── example.drawScatterLineChart.trigo.php │ ├── example.drawScatterPlotChart.php │ ├── example.drawScatterScale.manual.php │ ├── example.drawScatterScale.php │ ├── example.drawScatterSplineChart.php │ ├── example.drawSimple.php │ ├── example.drawSpline.php │ ├── example.drawSplineChart.php │ ├── example.drawSplineChart.reversed.php │ ├── example.drawSplineChart.simple.php │ ├── example.drawStackedAreaChart.normalized.php │ ├── example.drawStackedAreaChart.php │ ├── example.drawStackedAreaChart.simple.php │ ├── example.drawStackedBarChart.border.php │ ├── example.drawStackedBarChart.can.php │ ├── example.drawStackedBarChart.php │ ├── example.drawStackedBarChart.pyramid.php │ ├── example.drawStackedBarChart.rounded.php │ ├── example.drawStackedBarChart.shaded.php │ ├── example.drawStandardDeviation.php │ ├── example.drawStepChart.php │ ├── example.drawStepChart.simple.php │ ├── example.drawStockChart.median.php │ ├── example.drawStockChart.php │ ├── example.drawStockChart.simple.php │ ├── example.drawSurface.palette.php │ ├── example.drawSurface.php │ ├── example.drawSurface.simple.php │ ├── example.drawText.php │ ├── example.drawThreshold.labels.php │ ├── example.drawThreshold.php │ ├── example.drawThresholdArea.php │ ├── example.drawXThreshold.php │ ├── example.drawXThresholdArea.php │ ├── example.drawZoneChart.php │ ├── example.drawingObjects.php │ ├── example.normalize.php │ ├── example.polar.php │ ├── example.polar.values.php │ ├── example.radar.fixedmax.php │ ├── example.radar.labels.php │ ├── example.radar.php │ ├── example.radar.values.php │ ├── example.setFontProperties.php │ ├── example.setShadow.php │ ├── example.singlebarcode128.php │ ├── example.singlebarcode39.php │ ├── example.split.php │ ├── example.spring.complex.php │ ├── example.spring.labels.php │ ├── example.spring.php │ ├── example.spring.relations.php │ ├── example.text.alignment.php │ ├── example.transparent.background.php │ ├── example.writeBounds.php │ ├── imageMap │ │ ├── imagemap.js │ │ ├── index.php │ │ └── scripts │ │ │ ├── 2DPie.php │ │ │ ├── 2DRing.php │ │ │ ├── 3DPie.php │ │ │ ├── 3DRing.php │ │ │ ├── AreaChart.php │ │ │ ├── BarChart.labels.php │ │ │ ├── BarChart.php │ │ │ ├── BubbleChart.php │ │ │ ├── LineChart.php │ │ │ ├── PlotChart.php │ │ │ ├── PolarChart.php │ │ │ ├── RadarChart.php │ │ │ ├── ScatterLineChart.php │ │ │ ├── ScatterPlotChart.php │ │ │ ├── ScatterSplineChart.php │ │ │ ├── Shapes.php │ │ │ ├── SplineChart.php │ │ │ ├── StackedBarChart.php │ │ │ ├── StepChart.php │ │ │ └── StockChart.php │ ├── index.php │ ├── resources │ │ ├── accept.png │ │ ├── application_view_list.png │ │ ├── application_view_tile.png │ │ ├── blocnote.png │ │ ├── chart_bar.png │ │ ├── chart_line.png │ │ ├── computer.gif │ │ ├── dash-explorer-blank.png │ │ ├── dash-explorer-last.png │ │ ├── dash-explorer-noleaf.png │ │ ├── dash-explorer.png │ │ ├── dash.png │ │ ├── dataset.txt │ │ ├── folder.png │ │ ├── hologram.png │ │ ├── landscape1.jpg │ │ ├── landscape2.jpg │ │ ├── palette.txt │ │ ├── serie1.png │ │ ├── serie2.png │ │ └── wait.gif │ └── sandbox │ │ ├── graphix │ │ ├── accept.png │ │ ├── application_form.png │ │ ├── background.console.png │ │ ├── chart_bar.png │ │ ├── chart_bar_edit.png │ │ ├── chart_curve.png │ │ ├── chart_line.png │ │ ├── cog.png │ │ ├── color_swatch.png │ │ ├── comment.png │ │ ├── database_table.png │ │ ├── layout_edit.png │ │ ├── page_edit.png │ │ ├── paintcan.png │ │ ├── shape_flip_vertical.png │ │ ├── tab.png │ │ ├── vector.png │ │ ├── wait.gif │ │ ├── wand.png │ │ └── wrench.png │ │ ├── includes │ │ ├── arrow.gif │ │ ├── constants.txt │ │ ├── cross.gif │ │ ├── functions.js │ │ ├── hs.png │ │ ├── hv.png │ │ ├── jscolor.js │ │ └── rounded_corners_lite.inc.js │ │ ├── index.php │ │ ├── script │ │ ├── render.php │ │ └── session.php │ │ └── style.css ├── fonts │ ├── Bedizen.ttf │ ├── Forgotte.ttf │ ├── GeosansLight.ttf │ ├── MankSans.ttf │ ├── Silkscreen.ttf │ ├── advent_light.ttf │ ├── calibri.ttf │ ├── pf_arma_five.ttf │ └── verdana.ttf ├── index.php ├── palettes │ ├── autumn.color │ ├── blind.color │ ├── evening.color │ ├── kitchen.color │ ├── light.color │ ├── navy.color │ ├── shade.color │ ├── spring.color │ └── summer.color └── readme.txt ├── start.php ├── start_hal10k.bat ├── twitter_api ├── LICENSE ├── README.md ├── cacert.pem ├── composer.json ├── tmhOAuth.php ├── tmhOAuthExample.php └── tmhOAuthExamples-master │ ├── README.md │ ├── cli │ ├── follow.php │ ├── followings.php │ ├── multi_tokens.php │ ├── obtain_bearer.php │ ├── oob.php │ ├── photo_tweet.php │ ├── search.php │ ├── streaming_api.php │ ├── tweet.php │ ├── user_lookup.php │ ├── verify_credentials.php │ └── xauth.php │ ├── composer.json │ ├── index.php │ ├── tmhOAuthExample.php │ └── web │ ├── oauth_authorize_flow.php │ ├── photo_tweet.php │ ├── search_tweets.php │ └── verify_credentials.php └── web.png /chart_sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/chart_sample.png -------------------------------------------------------------------------------- /console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/console.png -------------------------------------------------------------------------------- /data/data.csv: -------------------------------------------------------------------------------- 1 | 2014-01-01 00:00:00,,707.00000,ask,loss,7.71,,, 2 | 2014-01-01 00:00:00,,707.00000,bid,loss,7.71,,, 3 | -------------------------------------------------------------------------------- /data/fake_index.txt: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /data/fakegox.txt: -------------------------------------------------------------------------------- 1 | {"data":{"Login":"intrd","Trade_Fee":0.45,"Wallets":{"BTC":{"Balance":{"value":0.04161308}},"USD":{"Balance":{"value":0}}}},"trade_mode":"bid","balancing":0} -------------------------------------------------------------------------------- /data/last.txt: -------------------------------------------------------------------------------- 1 | bid,[btc0.04161308/usd:0],707.00000,2014-01-01 00:00:00,loss,#suddenmode, 2 | -------------------------------------------------------------------------------- /data/log.txt: -------------------------------------------------------------------------------- 1 | ! 2 | -------------------------------------------------------------------------------- /data/log_clean.txt: -------------------------------------------------------------------------------- 1 | Starting HAL10K with 0.04161308 BTC buyd @ 707.00000 2 | -------------------------------------------------------------------------------- /data/next_mov.csv: -------------------------------------------------------------------------------- 1 | 2 | $ 680.005 bid @ 666 stoploss: 687 (last: ask @ 679 [loss]) -------------------------------------------------------------------------------- /data/settings.ini: -------------------------------------------------------------------------------- 1 | {"sudden":"0","meuovo":"0","tweeted":"830.00000","kill":"0"} -------------------------------------------------------------------------------- /hal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/hal.png -------------------------------------------------------------------------------- /hal_twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/hal_twitter.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 |

HAL 10K

"; 20 | $time=date("Y-m-d H:i:s"); 21 | echo "

Time: $time

"; 22 | echo ""; 23 | echo "
"; 24 | echo "Sudden MODE? (ATTENTION! OK?)"; 25 | echo ' Password:
'; 26 | echo ' Death mode:
'; 27 | echo "
"; 28 | echo "
HAL10K - Bitcoin trading bot
"; 29 | echo "
Copyright (C) http://dann.com.br - @intrd (Danilo Salles)
"; 30 | ?> 31 | -------------------------------------------------------------------------------- /makesudden.php: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /pChart/cache/cache.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/cache/cache.db -------------------------------------------------------------------------------- /pChart/cache/index.db: -------------------------------------------------------------------------------- 1 | 1e576aa3e1636c9e3107bad9522cdd1f,0,7301,1387286795,2 2 | -------------------------------------------------------------------------------- /pChart/class/pRadar.class.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/class/pRadar.class.php -------------------------------------------------------------------------------- /pChart/data/128B.db: -------------------------------------------------------------------------------- 1 | 0;32;11011001100 2 | 1;33;11001101100 3 | 2;34;11001100110 4 | 3;35;10010011000 5 | 4;36;10010001100 6 | 5;37;10001001100 7 | 6;38;10011001000 8 | 7;39;10011000100 9 | 8;40;10001100100 10 | 9;41;11001001000 11 | 10;42;11001000100 12 | 11;43;11000100100 13 | 12;44;10110011100 14 | 13;45;10011011100 15 | 14;46;10011001110 16 | 15;47;10111001100 17 | 16;48;10011101100 18 | 17;49;10011100110 19 | 18;50;11001110010 20 | 19;51;11001011100 21 | 20;52;11001001110 22 | 21;53;11011100100 23 | 22;54;11001110100 24 | 23;55;11101101110 25 | 24;56;11101001100 26 | 25;57;11100101100 27 | 26;58;11100100110 28 | 27;59;11101100100 29 | 28;60;11100110100 30 | 29;61;11100110010 31 | 30;62;11011011000 32 | 31;63;11011000110 33 | 32;64;11000110110 34 | 33;65;10100011000 35 | 34;66;10001011000 36 | 35;67;10001000110 37 | 36;68;10110001000 38 | 37;69;10001101000 39 | 38;70;10001100010 40 | 39;71;11010001000 41 | 40;72;11000101000 42 | 41;73;11000100010 43 | 42;74;10110111000 44 | 43;75;10110001110 45 | 44;76;10001101110 46 | 45;77;10111011000 47 | 46;78;10111000110 48 | 47;79;10001110110 49 | 48;80;11101110110 50 | 49;81;11010001110 51 | 50;82;11000101110 52 | 51;83;11011101000 53 | 52;84;11011100010 54 | 53;85;11011101110 55 | 54;86;11101011000 56 | 55;87;11101000110 57 | 56;88;11100010110 58 | 57;89;11101101000 59 | 58;90;11101100010 60 | 59;91;11100011010 61 | 60;92;11101111010 62 | 61;93;11001000010 63 | 62;94;11110001010 64 | 63;95;10100110000 65 | 64;96;10100001100 66 | 65;97;10010110000 67 | 66;98;10010000110 68 | 67;99;10000101100 69 | 68;100;10000100110 70 | 69;101;10110010000 71 | 70;102;10110000100 72 | 71;103;10011010000 73 | 72;104;10011000010 74 | 73;105;10000110100 75 | 74;106;10000110010 76 | 75;107;11000010010 77 | 76;108;11001010000 78 | 77;109;11110111010 79 | 78;110;11000010100 80 | 79;111;10001111010 81 | 80;112;10100111100 82 | 81;113;10010111100 83 | 82;114;10010011110 84 | 83;115;10111100100 85 | 84;116;10011110100 86 | 85;117;10011110010 87 | 86;118;11110100100 88 | 87;119;11110010100 89 | 88;120;11110010010 90 | 89;121;11011011110 91 | 90;122;11011110110 92 | 91;123;11110110110 93 | 92;124;10101111000 94 | 93;125;10100011110 95 | 94;126;10001011110 96 | 95;200;10111101000 97 | 96;201;10111100010 98 | 97;202;11110101000 99 | 98;203;11110100010 100 | 99;204;10111011110 101 | 100;205;10111101110 102 | 101;206;11101011110 103 | 102;207;11110101110 104 | 103;208;11010000100 105 | 104;209;11010010000 106 | 105;210;11010011100 107 | 106;211;1100011101011 -------------------------------------------------------------------------------- /pChart/data/39.db: -------------------------------------------------------------------------------- 1 | 0;101001101101 2 | 1;110100101011 3 | 2;101100101011 4 | 3;110110010101 5 | 4;101001101011 6 | 5;110100110101 7 | 6;101100110101 8 | 7;101001011011 9 | 8;110100101101 10 | 9;101100101101 11 | A;110101001011 12 | B;101101001011 13 | C;110110100101 14 | D;101011001011 15 | E;110101100101 16 | F;101101100101 17 | G;101010011011 18 | H;110101001101 19 | I;101101001101 20 | J;101011001101 21 | K;110101010011 22 | L;101101010011 23 | M;110110101001 24 | N;101011010011 25 | O;110101101001 26 | P;101101101001 27 | Q;101010110011 28 | R;110101011001 29 | S;101101011001 30 | T;101011011001 31 | U;110010101011 32 | V;100110101011 33 | W;110011010101 34 | X;100101101011 35 | Y;110010110101 36 | Z;100110110101 37 | -;100101011011 38 | .;110010101101 39 | ;100110101101 40 | $;100100100101 41 | /;100100101001 42 | +;100101001001 43 | %;101001001001 44 | *;100101101101 -------------------------------------------------------------------------------- /pChart/examples/buildAll.cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/buildAll.cmd -------------------------------------------------------------------------------- /pChart/examples/delayedLoader/draw.php: -------------------------------------------------------------------------------- 1 | drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>220,"StartG"=>220,"StartB"=>220,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 14 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>220,"StartG"=>220,"StartB"=>220,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>50)); 15 | $RectangleSettings = array("R"=>180,"G"=>180,"B"=>180,"Alpha"=>100); 16 | 17 | /* Add a border to the picture */ 18 | $myPicture->drawRectangle(0,0,699,229,array("R"=>150,"G"=>150,"B"=>150)); 19 | 20 | /* Write the title */ 21 | $myPicture->setFontProperties(array("FontName"=>"../../fonts/advent_light.ttf","FontSize"=>40)); 22 | $myPicture->drawText(130,130,"Delayed loading script",array("R"=>255,"G"=>255,"B"=>255)); 23 | 24 | /* Write the seed # */ 25 | $myPicture->setFontProperties(array("FontName"=>"../../fonts/advent_light.ttf","FontSize"=>10)); 26 | $myPicture->drawText(130,140,"Seed # : ".$Seed,array("R"=>255,"G"=>255,"B"=>255)); 27 | 28 | /* Draw a bezier curve */ 29 | $BezierSettings = array("R"=>255,"G"=>255,"B"=>255,"Ticks"=>4,"DrawArrow"=>TRUE,"ArrowTwoHeads"=>TRUE); 30 | $myPicture->drawBezier(360,170,670,120,430,100,560,190,$BezierSettings); 31 | 32 | /* Render the picture (choose the best way) */ 33 | $myPicture->autoOutput("draw.png"); 34 | ?> -------------------------------------------------------------------------------- /pChart/examples/delayedLoader/wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/delayedLoader/wait.gif -------------------------------------------------------------------------------- /pChart/examples/example.barcode128.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 14 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 15 | 16 | /* Overlay with a gradient */ 17 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 18 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 19 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 20 | 21 | /* Draw the border */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 26 | $myPicture->drawText(10,13,"Barcode 128 - Add barcode to your pictures",array("R"=>255,"G"=>255,"B"=>255)); 27 | 28 | /* Create the barcode 128 object */ 29 | $Barcode = new pBarcode128("../"); 30 | 31 | /* Draw a simple barcode */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | $Settings = array("ShowLegend"=>TRUE,"DrawArea"=>TRUE); 34 | $Barcode->draw($myPicture,"pChart Rocks!",50,50,$Settings); 35 | 36 | /* Draw a rotated barcode */ 37 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>12)); 38 | $Settings = array("ShowLegend"=>TRUE,"DrawArea"=>TRUE,"Angle"=>90); 39 | $Barcode->draw($myPicture,"Turn me on",650,50,$Settings); 40 | 41 | /* Draw a rotated barcode */ 42 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>12)); 43 | $Settings = array("R"=>255,"G"=>255,"B"=>255,"AreaR"=>150,"AreaG"=>30,"AreaB"=>27,"ShowLegend"=>TRUE,"DrawArea"=>TRUE,"Angle"=>350,"AreaBorderR"=>70,"AreaBorderG"=>20,"AreaBorderB"=>20); 44 | $Barcode->draw($myPicture,"Do what you want !",290,140,$Settings); 45 | 46 | /* Render the picture (choose the best way) */ 47 | $myPicture->autoOutput("pictures/example.drawbarcode128.png"); 48 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.barcode39.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 14 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 15 | 16 | /* Overlay with a gradient */ 17 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 18 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 19 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 20 | 21 | /* Draw the picture border */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 26 | $myPicture->drawText(10,13,"Barcode 39 - Add barcode to your pictures",array("R"=>255,"G"=>255,"B"=>255)); 27 | 28 | /* Create the barcode 39 object */ 29 | $Barcode = new pBarcode39("../"); 30 | 31 | /* Draw a simple barcode */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | $Settings = array("ShowLegend"=>TRUE,"DrawArea"=>TRUE); 34 | $Barcode->draw($myPicture,"pChart Rocks!",50,50,$Settings); 35 | 36 | /* Draw a rotated barcode */ 37 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>12)); 38 | $Settings = array("ShowLegend"=>TRUE,"DrawArea"=>TRUE,"Angle"=>90); 39 | $Barcode->draw($myPicture,"Turn me on",650,50,$Settings); 40 | 41 | /* Draw a rotated barcode */ 42 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>12)); 43 | $Settings = array("R"=>255,"G"=>255,"B"=>255,"AreaR"=>150,"AreaG"=>30,"AreaB"=>27,"ShowLegend"=>TRUE,"DrawArea"=>TRUE,"Angle"=>350,"AreaBorderR"=>70,"AreaBorderG"=>20,"AreaBorderB"=>20); 44 | $Barcode->draw($myPicture,"Do what you want !",290,140,$Settings); 45 | 46 | /* Render the picture (choose the best way) */ 47 | $myPicture->autoOutput("pictures/example.barcode39.png"); 48 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.basic.php: -------------------------------------------------------------------------------- 1 | addPoints(array(1,3,4,3,5)); 14 | 15 | /* Create a pChart object and associate your dataset */ 16 | $myPicture = new pImage(700,230,$myData); 17 | 18 | /* Choose a nice font */ 19 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 20 | 21 | /* Define the boundaries of the graph area */ 22 | $myPicture->setGraphArea(60,40,670,190); 23 | 24 | /* Draw the scale, keep everything automatic */ 25 | $myPicture->drawScale(); 26 | 27 | /* Draw the scale, keep everything automatic */ 28 | $myPicture->drawSplineChart(); 29 | 30 | /* Render the picture (choose the best way) */ 31 | $myPicture->autoOutput("pictures/example.basic.png"); 32 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.cache.php: -------------------------------------------------------------------------------- 1 | addPoints(array(1,3,4,3,5)); 15 | 16 | /* Create the cache object */ 17 | $myCache = new pCache(array("CacheFolder"=>"../cache")); 18 | 19 | /* Compute the hash linked to the chart data */ 20 | $ChartHash = $myCache->getHash($myData); 21 | 22 | /* Test if we got this hash in our cache already */ 23 | if ( $myCache->isInCache($ChartHash)) 24 | { 25 | /* If we have it, get the picture from the cache! */ 26 | $myCache->autoOutput($ChartHash,"pictures/example.cache.png"); 27 | } 28 | else 29 | { 30 | /* Create a pChart object and associate your dataset */ 31 | $myPicture = new pImage(700,230,$myData); 32 | 33 | /* Choose a nice font */ 34 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 35 | 36 | /* Define the boundaries of the graph area */ 37 | $myPicture->setGraphArea(60,40,670,190); 38 | 39 | /* Draw the scale, keep everything automatic */ 40 | $myPicture->drawScale(); 41 | 42 | /* Draw the scale, keep everything automatic */ 43 | $myPicture->drawSplineChart(); 44 | 45 | /* Do some cosmetics */ 46 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 47 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 48 | $myPicture->drawText(10,13,"Test of the pCache class",array("R"=>255,"G"=>255,"B"=>255)); 49 | 50 | /* Push the rendered picture to the cache */ 51 | $myCache->writeToCache($ChartHash,$myPicture); 52 | 53 | /* Render the picture */ 54 | $myPicture->autoOutput("pictures/example.cache.png"); 55 | } 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw2DPie.labels.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(300,260,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 2D pie charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Enable shadow computing */ 42 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 43 | 44 | /* Create the pPie object */ 45 | $PieChart = new pPie($myPicture,$MyData); 46 | 47 | /* Draw an AA pie chart */ 48 | $PieChart->draw2DPie(160,140,array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE)); 49 | 50 | /* Write the legend box */ 51 | $myPicture->setShadow(FALSE); 52 | $PieChart->drawPieLegend(15,40,array("Alpha"=>20)); 53 | 54 | /* Render the picture (choose the best way) */ 55 | $myPicture->autoOutput("pictures/example.draw2DPie.labels.png"); 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw2DRing.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(300,260,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 2D ring charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Enable shadow computing */ 42 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 43 | 44 | /* Create the pPie object */ 45 | $PieChart = new pPie($myPicture,$MyData); 46 | 47 | /* Draw an AA pie chart */ 48 | $PieChart->draw2DRing(160,140,array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE)); 49 | 50 | /* Write the legend box */ 51 | $myPicture->setShadow(FALSE); 52 | $PieChart->drawPieLegend(15,40,array("Alpha"=>20)); 53 | 54 | /* Render the picture (choose the best way) */ 55 | $myPicture->autoOutput("pictures/example.draw2DRing.png"); 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw2DRingValues.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(300,260,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 2D ring charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Enable shadow computing */ 42 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 43 | 44 | /* Create the pPie object */ 45 | $PieChart = new pPie($myPicture,$MyData); 46 | 47 | /* Draw an AA pie chart */ 48 | $PieChart->draw2DRing(160,140,array("WriteValues"=>TRUE,"ValueR"=>255,"ValueG"=>255,"ValueB"=>255,"Border"=>TRUE)); 49 | 50 | /* Write the legend box */ 51 | $myPicture->setShadow(FALSE); 52 | $PieChart->drawPieLegend(15,40,array("Alpha"=>20)); 53 | 54 | /* Render the picture (choose the best way) */ 55 | $myPicture->autoOutput("pictures/example.draw2DRingValue.png"); 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw3DPie.labels.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(300,260,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 2D pie charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Create the pPie object */ 42 | $PieChart = new pPie($myPicture,$MyData); 43 | 44 | /* Draw an AA pie chart */ 45 | $PieChart->draw3DPie(160,140,array("Radius"=>70,"DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE)); 46 | 47 | /* Write the legend box */ 48 | $myPicture->setShadow(FALSE); 49 | $PieChart->drawPieLegend(15,40,array("Alpha"=>20)); 50 | 51 | /* Render the picture (choose the best way) */ 52 | $myPicture->autoOutput("pictures/example.draw3DPie.labels.png"); 53 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw3DPie.transparent.php: -------------------------------------------------------------------------------- 1 | addPoints(array(40,30,20),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A","B","C"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(240,180,$MyData,TRUE); 21 | 22 | /* Set the default font properties */ 23 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 24 | 25 | /* Create the pPie object */ 26 | $PieChart = new pPie($myPicture,$MyData); 27 | 28 | /* Enable shadow computing */ 29 | $myPicture->setShadow(TRUE,array("X"=>3,"Y"=>3,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 30 | 31 | /* Draw a splitted pie chart */ 32 | $PieChart->draw3DPie(120,90,array("Radius"=>100,"DataGapAngle"=>12,"DataGapRadius"=>10,"Border"=>TRUE)); 33 | 34 | /* Write the legend box */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6,"R"=>0,"G"=>0,"B"=>0)); 36 | $PieChart->drawPieLegend(140,160,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.draw3DPie.transparent.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw3DRing.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(400,400,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,400,400,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,400,400,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,400,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,399,399,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 3D ring charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Enable shadow computing */ 42 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 43 | 44 | /* Create the pPie object */ 45 | $PieChart = new pPie($myPicture,$MyData); 46 | 47 | /* Draw an AA pie chart */ 48 | $PieChart->draw3DRing(200,200,array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE)); 49 | 50 | /* Write the legend box */ 51 | $PieChart->drawPieLegend(80,360,array("Mode"=>LEGEND_HORIZONTAL,"Style"=>LEGEND_NOBORDER,"Alpha"=>20)); 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("pictures/example.draw3DRing.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.draw3DRingValues.php: -------------------------------------------------------------------------------- 1 | addPoints(array(50,2,3,4,7,10,25,48,41,10),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | 15 | /* Define the absissa serie */ 16 | $MyData->addPoints(array("A0","B1","C2","D3","E4","F5","G6","H7","I8","J9"),"Labels"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(400,400,$MyData); 21 | 22 | /* Draw a solid background */ 23 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 24 | $myPicture->drawFilledRectangle(0,0,400,400,$Settings); 25 | 26 | /* Overlay with a gradient */ 27 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 28 | $myPicture->drawGradientArea(0,0,400,400,DIRECTION_VERTICAL,$Settings); 29 | $myPicture->drawGradientArea(0,0,400,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 30 | 31 | /* Add a border to the picture */ 32 | $myPicture->drawRectangle(0,0,399,399,array("R"=>0,"G"=>0,"B"=>0)); 33 | 34 | /* Write the picture title */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 36 | $myPicture->drawText(10,13,"pPie - Draw 3D ring charts",array("R"=>255,"G"=>255,"B"=>255)); 37 | 38 | /* Set the default font properties */ 39 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 40 | 41 | /* Enable shadow computing */ 42 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 43 | 44 | /* Create the pPie object */ 45 | $PieChart = new pPie($myPicture,$MyData); 46 | 47 | /* Draw an AA pie chart */ 48 | $PieChart->draw3DRing(200,200,array("WriteValues"=>TRUE,"Border"=>TRUE)); 49 | 50 | /* Write the legend box */ 51 | $PieChart->drawPieLegend(80,360,array("Mode"=>LEGEND_HORIZONTAL,"Style"=>LEGEND_NOBORDER,"Alpha"=>20)); 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("pictures/example.draw3DRingValues.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawAntialiasPixel.php: -------------------------------------------------------------------------------- 1 | drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>180,"StartG"=>193,"StartB"=>91,"EndR"=>120,"EndG"=>137,"EndB"=>72,"Alpha"=>100)); 11 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>180,"StartG"=>193,"StartB"=>91,"EndR"=>120,"EndG"=>137,"EndB"=>72,"Alpha"=>20)); 12 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 13 | 14 | /* Add a border to the picture */ 15 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 16 | 17 | /* Write the picture title */ 18 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 19 | $myPicture->drawText(10,13,"drawAntialiasPixel() - Drawing antialiased pixel with transparency",array("R"=>255,"G"=>255,"B"=>255)); 20 | 21 | /* Draw some alpha pixels */ 22 | for($X=0;$X<=160;$X++) 23 | { 24 | for($Y=0;$Y<=160;$Y++) 25 | { 26 | $PixelSettings = array("R"=>128,"G"=>255-$Y,"B"=>$X,"Alpha"=>cos(deg2rad($X*2))*50+50); 27 | 28 | $myPicture->drawAntialiasPixel($X*2+20.4,$Y+45,$PixelSettings); 29 | $myPicture->drawAntialiasPixel($X+400,$Y+45,$PixelSettings); 30 | } 31 | } 32 | 33 | /* Render the picture (choose the best way) */ 34 | $myPicture->autoOutput("pictures/example.drawantialiaspixel.png"); 35 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawAreaChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,2,10,12,8,3),"Probe 1"); 12 | $MyData->addPoints(array(3,12,15,8,5,5),"Probe 2"); 13 | $MyData->addPoints(array(2,7,5,18,15,22),"Probe 3"); 14 | $MyData->setSerieTicks("Probe 2",4); 15 | $MyData->setAxisName(0,"Temperatures"); 16 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 17 | $MyData->setSerieDescription("Labels","Months"); 18 | $MyData->setAbscissa("Labels"); 19 | 20 | /* Create the pChart object */ 21 | $myPicture = new pImage(700,230,$MyData); 22 | 23 | /* Turn of Antialiasing */ 24 | $myPicture->Antialias = FALSE; 25 | 26 | /* Add a border to the picture */ 27 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 28 | 29 | /* Write the chart title */ 30 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 31 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 32 | 33 | /* Set the default font */ 34 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 35 | 36 | /* Define the chart area */ 37 | $myPicture->setGraphArea(60,40,650,200); 38 | 39 | /* Draw the scale */ 40 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 41 | $myPicture->drawScale($scaleSettings); 42 | 43 | /* Write the chart legend */ 44 | $myPicture->drawLegend(540,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 45 | 46 | /* Turn on Antialiasing */ 47 | $myPicture->Antialias = TRUE; 48 | 49 | /* Draw the area chart */ 50 | $myPicture->drawAreaChart(); 51 | 52 | /* Render the picture (choose the best way) */ 53 | $myPicture->autoOutput("pictures/example.drawAreaChart.simple.png"); 54 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawArrow.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawArrow() - Arrows on your charts",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn on shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw some arrows */ 31 | for($i=1;$i<=100;$i=$i+8) 32 | { 33 | $arrowSettings = array("FillR"=>$i*2.5,"FillG"=>$i*2.5,"FillB"=>$i*2.5,"Ticks"=>$i % 5); 34 | 35 | $myPicture->drawArrow($i+5,215,$i*7+5,30,$arrowSettings); 36 | } 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.drawArrow.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawArrowLabel.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawArrowLabel() - Adaptative label positionning",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn on shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 29 | 30 | /* Draw an arrow with a 45 degree angle */ 31 | $ArrowSettings = array("FillR"=>37,"FillG"=>78,"FillB"=>117,"Length"=>40,"Angle"=>45); 32 | $myPicture->drawArrowLabel(348,113,"Blue",$ArrowSettings); 33 | 34 | /* Draw an arrow with a 135 degree angle */ 35 | $ArrowSettings = array("FillR"=>188,"FillG"=>49,"FillB"=>42,"Length"=>40,"Angle"=>135,"Position"=>POSITION_BOTTOM,"Ticks"=>2); 36 | $myPicture->drawArrowLabel(348,117,"Red",$ArrowSettings); 37 | 38 | /* Draw an arrow with a 225 degree angle */ 39 | $ArrowSettings = array("FillR"=>51,"FillG"=>119,"FillB"=>35,"Length"=>40,"Angle"=>225,"Position"=>POSITION_BOTTOM,"Ticks"=>3); 40 | $myPicture->drawArrowLabel(352,117,"Green",$ArrowSettings); 41 | 42 | /* Draw an arrow with a 315 degree angle */ 43 | $ArrowSettings = array("FillR"=>239,"FillG"=>231,"FillB"=>97,"Length"=>40,"Angle"=>315,"Ticks"=>4); 44 | $myPicture->drawArrowLabel(352,113,"Yellow",$ArrowSettings); 45 | 46 | /* Render the picture (choose the best way) */ 47 | $myPicture->autoOutput("pictures/example.drawArrowLabel.png"); 48 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.borders.php: -------------------------------------------------------------------------------- 1 | addPoints(array(150,220,300,-250,-420,-200,300,200,100),"Server A"); 12 | $MyData->addPoints(array(140,0,340,-300,-320,-300,200,100,50),"Server B"); 13 | $MyData->setAxisName(0,"Hits"); 14 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 15 | $MyData->setSerieDescription("Months","Month"); 16 | $MyData->setAbscissa("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of Antialiasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Add a border to the picture */ 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 26 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 27 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 28 | 29 | /* Set the default font */ 30 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 31 | 32 | /* Define the chart area */ 33 | $myPicture->setGraphArea(60,40,650,200); 34 | 35 | /* Draw the scale */ 36 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 37 | $myPicture->drawScale($scaleSettings); 38 | 39 | /* Write the chart legend */ 40 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 41 | 42 | /* Turn on shadow computing */ 43 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 44 | 45 | /* Draw the chart */ 46 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 47 | $settings = array("Surrounding"=>-30,"InnerSurrounding"=>30); 48 | $myPicture->drawBarChart($settings); 49 | 50 | /* Render the picture (choose the best way) */ 51 | $myPicture->autoOutput("pictures/example.drawBarChart.simple.png"); 52 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.can.php: -------------------------------------------------------------------------------- 1 | loadPalette("../palettes/light.color",TRUE); 12 | $MyData->addPoints(array(150,220,300,-250,-420,-200,300,200,100),"Server A"); 13 | $MyData->addPoints(array(140,0,340,-300,-320,-300,200,100,50),"Server B"); 14 | $MyData->setAxisName(0,"Hits"); 15 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 16 | $MyData->setSerieDescription("Months","Month"); 17 | $MyData->setAbscissa("Months"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(700,230,$MyData); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 22 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 23 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 24 | 25 | /* Draw the scale */ 26 | $myPicture->setGraphArea(50,30,680,200); 27 | $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10)); 28 | 29 | /* Turn on shadow computing */ 30 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 31 | 32 | /* Draw the chart */ 33 | $settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255,"DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10); 34 | $myPicture->drawBarChart($settings); 35 | 36 | /* Write the chart legend */ 37 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 38 | 39 | /* Render the picture (choose the best way) */ 40 | $myPicture->autoOutput("pictures/example.drawBarChart.can.png"); 41 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.floating.php: -------------------------------------------------------------------------------- 1 | loadPalette("../palettes/blind.color",TRUE); 12 | $MyData->addPoints(array(150,220,300,250,420,200,300,200,100),"Server A"); 13 | $MyData->addPoints(array(140,0,340,300,320,300,200,100,50),"Server B"); 14 | $MyData->setAxisName(0,"Hits"); 15 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 16 | $MyData->setSerieDescription("Months","Month"); 17 | $MyData->setAbscissa("Months"); 18 | 19 | /* Create the floating 0 data serie */ 20 | $MyData->addPoints(array(60,80,20,40,0,50,90,30,100),"Floating 0"); 21 | $MyData->setSerieDrawable("Floating 0",FALSE); 22 | 23 | /* Create the pChart object */ 24 | $myPicture = new pImage(700,230,$MyData); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 26 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 27 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 28 | 29 | /* Draw the scale */ 30 | $myPicture->setGraphArea(50,30,680,200); 31 | $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10)); 32 | 33 | /* Turn on shadow computing */ 34 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 35 | 36 | /* Draw the chart */ 37 | $settings = array("Floating0Serie"=>"Floating 0","Draw0Line"=>TRUE,"Gradient"=>TRUE,"DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255,"DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10); 38 | $myPicture->drawBarChart($settings); 39 | 40 | /* Write the chart legend */ 41 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 42 | 43 | /* Render the picture (choose the best way) */ 44 | $myPicture->autoOutput("pictures/example.drawBarChart.floating.png"); 45 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.poll.php: -------------------------------------------------------------------------------- 1 | addPoints(array(60,30,10),"Answers"); 12 | $MyData->setAxisName(0,"Answers (%)"); 13 | $MyData->addPoints(array("I do agree ","I disagree ","No opinion "),"Options"); 14 | $MyData->setAbscissa("Options"); 15 | 16 | /* Create the pChart object */ 17 | $myPicture = new pImage(500,220,$MyData); 18 | 19 | /* Write the chart title */ 20 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>15)); 21 | $myPicture->drawText(20,34,"Q: Flexibility is a key point of this library",array("FontSize"=>20)); 22 | 23 | /* Define the default font */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 25 | 26 | /* Set the graph area */ 27 | $myPicture->setGraphArea(70,60,480,200); 28 | $myPicture->drawGradientArea(70,60,480,200,DIRECTION_HORIZONTAL,array("StartR"=>200,"StartG"=>200,"StartB"=>200,"EndR"=>240,"EndG"=>240,"EndB"=>240,"Alpha"=>30)); 29 | 30 | /* Draw the chart scale */ 31 | $scaleSettings = array("DrawXLines"=>FALSE,"Mode"=>SCALE_MODE_START0,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10,"Pos"=>SCALE_POS_TOPBOTTOM); 32 | $myPicture->drawScale($scaleSettings); 33 | 34 | /* Turn on shadow computing */ 35 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 36 | 37 | /* Draw the chart */ 38 | $myPicture->drawBarChart(array("Rounded"=>TRUE,"Surrounding"=>30)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawBarChart.poll.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.shaded.php: -------------------------------------------------------------------------------- 1 | addPoints(array(150,220,300,-250,-420,-200,300,200,100),"Server A"); 12 | $MyData->addPoints(array(140,0,340,-300,-320,-300,200,100,50),"Server B"); 13 | $MyData->setAxisName(0,"Hits"); 14 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 15 | $MyData->setSerieDescription("Months","Month"); 16 | $MyData->setAbscissa("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 22 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 23 | 24 | /* Draw the scale */ 25 | $myPicture->setGraphArea(50,30,680,200); 26 | $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10)); 27 | 28 | /* Turn on shadow computing */ 29 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 30 | 31 | /* Draw the chart */ 32 | $settings = array("Gradient"=>TRUE,"DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255,"DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10); 33 | $myPicture->drawBarChart($settings); 34 | 35 | /* Write the chart legend */ 36 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.drawBarChart.shaded.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(150,220,300,-250,-420,-200,300,200,100),"Server A"); 12 | $MyData->addPoints(array(140,0,340,-300,-320,-300,200,100,50),"Server B"); 13 | $MyData->setAxisName(0,"Hits"); 14 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 15 | $MyData->setSerieDescription("Months","Month"); 16 | $MyData->setAbscissa("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of Antialiasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Add a border to the picture */ 25 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 26 | 27 | /* Set the default font */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 29 | 30 | /* Define the chart area */ 31 | $myPicture->setGraphArea(60,40,650,200); 32 | 33 | /* Draw the scale */ 34 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 35 | $myPicture->drawScale($scaleSettings); 36 | 37 | /* Write the chart legend */ 38 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 39 | 40 | /* Turn on shadow computing */ 41 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 42 | 43 | /* Draw the chart */ 44 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 45 | $settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255,"DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10); 46 | $myPicture->drawBarChart(); 47 | 48 | /* Render the picture (choose the best way) */ 49 | $myPicture->autoOutput("pictures/example.drawBarChart.simple.png"); 50 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.spacing.php: -------------------------------------------------------------------------------- 1 | addPoints(array(150,220,300,250,420,200,300,200,100),"Server A"); 12 | $MyData->addPoints(array(140,0,340,300,320,300,200,100,50),"Server B"); 13 | $MyData->setAxisName(0,"Hits"); 14 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 15 | $MyData->setSerieDescription("Months","Month"); 16 | $MyData->setAbscissa("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of Antialiasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Add a border to the picture */ 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 26 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 27 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 28 | 29 | /* Set the default font */ 30 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 31 | 32 | /* Define the chart area */ 33 | $myPicture->setGraphArea(60,40,650,200); 34 | 35 | /* Draw the scale */ 36 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 37 | $myPicture->drawScale($scaleSettings); 38 | 39 | /* Write the chart legend */ 40 | $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 41 | 42 | /* Turn on shadow computing */ 43 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 44 | 45 | /* Draw the chart */ 46 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 47 | $settings = array("Surrounding"=>-30,"InnerSurrounding"=>30,"Interleave"=>0); 48 | $myPicture->drawBarChart($settings); 49 | 50 | /* Render the picture (choose the best way) */ 51 | $myPicture->autoOutput("pictures/example.drawBarChart.spacing.png"); 52 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.span.php: -------------------------------------------------------------------------------- 1 | loadPalette("../palettes/blind.color",TRUE); 12 | $MyData->addPoints(array(150,220,300,250,420,200,300,200,110),"Server A"); 13 | $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months"); 14 | $MyData->setSerieDescription("Months","Month"); 15 | $MyData->setAbscissa("Months"); 16 | 17 | /* Create the floating 0 data serie */ 18 | $MyData->addPoints(array(60,80,20,40,40,50,90,30,100),"Floating 0"); 19 | $MyData->setSerieDrawable("Floating 0",FALSE); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(700,230,$MyData); 23 | 24 | /* Set the default font */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>110,"G"=>110,"B"=>110)); 26 | 27 | /* Write the title */ 28 | $myPicture->drawText(10,13,"Net Income 2k8"); 29 | 30 | /* Set the graphical area */ 31 | $myPicture->setGraphArea(50,30,680,180); 32 | 33 | /* Draw the scale */ 34 | $AxisBoundaries = array(0=>array("Min"=>0,"Max"=>500)); 35 | $myPicture->drawScale(array("InnerTickWidth"=>0,"OuterTickWidth"=>0,"Mode"=>SCALE_MODE_MANUAL,"ManualScale"=>$AxisBoundaries,"LabelRotation"=>45,"DrawXLines"=>FALSE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridTicks"=>0,"GridAlpha"=>30,"AxisAlpha"=>0)); 36 | 37 | /* Turn on shadow computing */ 38 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 39 | 40 | /* Draw the chart */ 41 | $settings = array("Floating0Serie"=>"Floating 0","Surrounding"=>10); 42 | $myPicture->drawBarChart($settings); 43 | 44 | /* Render the picture (choose the best way) */ 45 | $myPicture->autoOutput("pictures/example.drawBarChart.span.png"); 46 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBarChart.vertical.php: -------------------------------------------------------------------------------- 1 | addPoints(array(13251,4118,3087,1460,1248,156,26,9,8),"Hits"); 12 | $MyData->setAxisName(0,"Hits"); 13 | $MyData->addPoints(array("Firefox","Chrome","Internet Explorer","Opera","Safari","Mozilla","SeaMonkey","Camino","Lunascape"),"Browsers"); 14 | $MyData->setSerieDescription("Browsers","Browsers"); 15 | $MyData->setAbscissa("Browsers"); 16 | $MyData->setAbscissaName("Browsers"); 17 | $MyData->setAxisDisplay(0,AXIS_FORMAT_METRIC,1); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(500,500,$MyData); 21 | $myPicture->drawGradientArea(0,0,500,500,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 22 | $myPicture->drawGradientArea(0,0,500,500,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 23 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 24 | 25 | /* Draw the chart scale */ 26 | $myPicture->setGraphArea(100,30,480,480); 27 | $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10,"Pos"=>SCALE_POS_TOPBOTTOM)); // 28 | 29 | /* Turn on shadow computing */ 30 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 31 | 32 | /* Draw the chart */ 33 | $myPicture->drawBarChart(array("DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"Rounded"=>TRUE,"Surrounding"=>30)); 34 | 35 | /* Write the legend */ 36 | $myPicture->drawLegend(570,215,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.drawBarChart.vertical.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBestfit.php: -------------------------------------------------------------------------------- 1 | addPoints(rand(10,30)+$i,"Probe 1"); } 12 | for($i=0;$i<=20;$i++) { $MyData->addPoints(rand(0,10)+$i,"Probe 2"); } 13 | 14 | /* Give a name to the Y axis */ 15 | $MyData->setAxisName(0,"Temperatures"); 16 | 17 | /* Create the pChart object */ 18 | $myPicture = new pImage(700,230,$MyData); 19 | 20 | /* Turn of Antialiasing */ 21 | $myPicture->Antialias = FALSE; 22 | 23 | /* Add a border to the picture */ 24 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 25 | 26 | /* Write the chart title */ 27 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 28 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 29 | 30 | /* Set the default font */ 31 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 32 | 33 | /* Define the chart area */ 34 | $myPicture->setGraphArea(60,40,650,200); 35 | 36 | /* Draw the scale */ 37 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 38 | $myPicture->drawScale($scaleSettings); 39 | 40 | /* Turn on Antialiasing */ 41 | $myPicture->Antialias = TRUE; 42 | 43 | /* Draw the line of best fit */ 44 | $myPicture->drawBestFit(); 45 | 46 | /* Turn on shadows */ 47 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 48 | 49 | /* Draw the line chart */ 50 | $myPicture->drawPlotChart(); 51 | 52 | /* Write the chart legend */ 53 | $myPicture->drawLegend(580,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 54 | 55 | /* Render the picture (choose the best way) */ 56 | $myPicture->autoOutput("pictures/example.drawBestFit.png"); 57 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBezier.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawBezier() - some cubic curves",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn on shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw one bezier curve */ 31 | $BezierSettings = array("R"=>255,"G"=>255,"B"=>255,"ShowControl"=>TRUE); 32 | $myPicture->drawBezier(20,40,280,170,130,160,160,60,$BezierSettings); 33 | 34 | /* Draw one bezier curve */ 35 | $BezierSettings = array("R"=>255,"G"=>255,"B"=>255,"ShowControl"=>TRUE,"Ticks"=>4,"DrawArrow"=>TRUE,"ArrowTwoHeads"=>TRUE); 36 | $myPicture->drawBezier(360,120,630,120,430,50,560,190,$BezierSettings); 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.drawBezier.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBubbleChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(34,55,15,62,38,42),"Probe1"); 13 | $MyData->addPoints(array(5,30,20,9,15,10),"Probe1Weight"); 14 | $MyData->addPoints(array(5,10,-5,-1,0,-10),"Probe2"); 15 | $MyData->addPoints(array(6,10,14,10,14,6),"Probe2Weight"); 16 | $MyData->setSerieDescription("Probe1","This year"); 17 | $MyData->setSerieDescription("Probe2","Last year"); 18 | $MyData->setAxisName(0,"Current stock"); 19 | $MyData->addPoints(array("Apple","Banana","Orange","Lemon","Peach","Strawberry"),"Product"); 20 | $MyData->setAbscissa("Product"); 21 | $MyData->setAbscissaName("Selected Products"); 22 | 23 | /* Create the pChart object */ 24 | $myPicture = new pImage(700,230,$MyData); 25 | 26 | /* Turn of AAliasing */ 27 | $myPicture->Antialias = FALSE; 28 | 29 | /* Draw the border */ 30 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 31 | 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | 34 | /* Define the chart area */ 35 | $myPicture->setGraphArea(60,30,650,190); 36 | 37 | /* Draw the scale */ 38 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 39 | $myPicture->drawScale($scaleSettings); 40 | 41 | /* Create the Bubble chart object and scale up */ 42 | $myPicture->Antialias = TRUE; 43 | $myBubbleChart = new pBubble($myPicture,$MyData); 44 | 45 | /* Scale up for the bubble chart */ 46 | $bubbleDataSeries = array("Probe1","Probe2"); 47 | $bubbleWeightSeries = array("Probe1Weight","Probe2Weight"); 48 | $myBubbleChart->bubbleScale($bubbleDataSeries,$bubbleWeightSeries); 49 | 50 | /* Draw the bubble chart */ 51 | $myBubbleChart->drawBubbleChart($bubbleDataSeries,$bubbleWeightSeries,array("BorderWidth"=>4,"BorderAlpha"=>50,"Surrounding"=>20)); 52 | 53 | /* Write the chart legend */ 54 | $myPicture->drawLegend(570,13,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 55 | 56 | /* Render the picture (choose the best way) */ 57 | $myPicture->autoOutput("pictures/example.drawBubbleChart.simple.png"); 58 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawBubbleChart.square.php: -------------------------------------------------------------------------------- 1 | addPoints(array(34,55,15,62,38,42),"Probe1"); 13 | $MyData->addPoints(array(5,30,20,9,15,10),"Probe1Weight"); 14 | $MyData->addPoints(array(5,10,-5,-1,0,-10),"Probe2"); 15 | $MyData->addPoints(array(6,10,14,10,14,6),"Probe2Weight"); 16 | $MyData->setSerieDescription("Probe1","This year"); 17 | $MyData->setSerieDescription("Probe2","Last year"); 18 | $MyData->setAxisName(0,"Current stock"); 19 | $MyData->addPoints(array("Apple","Banana","Orange","Lemon","Peach","Strawberry"),"Product"); 20 | $MyData->setAbscissa("Product"); 21 | $MyData->setAbscissaName("Selected Products"); 22 | 23 | /* Create the pChart object */ 24 | $myPicture = new pImage(700,230,$MyData); 25 | 26 | /* Turn of AAliasing */ 27 | $myPicture->Antialias = FALSE; 28 | 29 | /* Draw the border */ 30 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 31 | 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | 34 | /* Define the chart area */ 35 | $myPicture->setGraphArea(60,30,650,190); 36 | 37 | /* Draw the scale */ 38 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 39 | $myPicture->drawScale($scaleSettings); 40 | 41 | /* Create the Bubble chart object and scale up */ 42 | $myPicture->Antialias = TRUE; 43 | $myBubbleChart = new pBubble($myPicture,$MyData); 44 | 45 | /* Scale up for the bubble chart */ 46 | $bubbleDataSeries = array("Probe1","Probe2"); 47 | $bubbleWeightSeries = array("Probe1Weight","Probe2Weight"); 48 | $myBubbleChart->bubbleScale($bubbleDataSeries,$bubbleWeightSeries); 49 | 50 | /* Draw the bubble chart */ 51 | $myBubbleChart->drawBubbleChart($bubbleDataSeries,$bubbleWeightSeries,array("Shape"=>BUBBLE_SHAPE_SQUARE,"ForceAlpha"=>50,"BorderWidth"=>4,"BorderAlpha"=>20,"Surrounding"=>20)); 52 | 53 | /* Write the chart legend */ 54 | $myPicture->drawLegend(570,13,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 55 | 56 | /* Render the picture (choose the best way) */ 57 | $myPicture->autoOutput("pictures/example.drawBubbleChart.square.png"); 58 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawCircle.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawCircle() - Transparency & colors",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Draw some circles */ 28 | $myPicture->drawCircle(100,125,50,50,array("R"=>213,"G"=>226,"B"=>0,"Alpha"=>100)); 29 | $myPicture->drawCircle(140,125,50,50,array("R"=>213,"G"=>226,"B"=>0,"Alpha"=>70)); 30 | $myPicture->drawCircle(180,125,50,50,array("R"=>213,"G"=>226,"B"=>0,"Alpha"=>40)); 31 | $myPicture->drawCircle(220,125,50,50,array("R"=>213,"G"=>226,"B"=>0,"Alpha"=>20)); 32 | 33 | /* Turn on shadow computing */ 34 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 35 | 36 | /* Draw a customized circles */ 37 | $CircleSettings = array("R"=>209,"G"=>31,"B"=>27,"Alpha"=>100); 38 | $myPicture->drawCircle(480,60,20,20,$CircleSettings); 39 | 40 | /* Draw a customized circles */ 41 | $CircleSettings = array("R"=>209,"G"=>125,"B"=>27,"Alpha"=>100); 42 | $myPicture->drawCircle(480,100,30,20,$CircleSettings); 43 | 44 | /* Draw a customized circles */ 45 | $CircleSettings = array("R"=>209,"G"=>198,"B"=>27,"Alpha"=>100,"Ticks"=>4); 46 | $myPicture->drawCircle(480,140,40,20,$CircleSettings); 47 | 48 | /* Draw a customized circles */ 49 | $CircleSettings = array("R"=>134,"G"=>209,"B"=>27,"Alpha"=>100,"Ticks"=>4); 50 | $myPicture->drawCircle(480,180,50,20,$CircleSettings); 51 | 52 | /* Render the picture (choose the best way) */ 53 | $myPicture->autoOutput("pictures/example.drawCircle.png"); 54 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawContour.php: -------------------------------------------------------------------------------- 1 | 179, "G"=>217, "B"=>91, "Dash"=>1, "DashR"=>199, "DashG"=>237, "DashB"=>111); 15 | $myPicture->drawFilledRectangle(0,0,400,400,$Settings); 16 | 17 | /* Do a gradient overlay */ 18 | $Settings = array("StartR"=>194, "StartG"=>231, "StartB"=>44, "EndR"=>43, "EndG"=>107, "EndB"=>58, "Alpha"=>50); 19 | $myPicture->drawGradientArea(0,0,400,400,DIRECTION_VERTICAL,$Settings); 20 | $myPicture->drawGradientArea(0,0,400,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 21 | 22 | /* Add a border to the picture */ 23 | $myPicture->drawRectangle(0,0,399,399,array("R"=>0,"G"=>0,"B"=>0)); 24 | 25 | /* Write the picture title */ 26 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 27 | $myPicture->drawText(10,13,"pSurface() :: 2D surface charts",array("R"=>255,"G"=>255,"B"=>255)); 28 | 29 | /* Define the charting area */ 30 | $myPicture->setGraphArea(20,40,380,380); 31 | $myPicture->drawFilledRectangle(20,40,380,380,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>20)); 32 | 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1)); 34 | 35 | /* Create the surface object */ 36 | $mySurface = new pSurface($myPicture); 37 | 38 | /* Set the grid size */ 39 | $mySurface->setGrid(20,20); 40 | 41 | /* Write the axis labels */ 42 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 43 | $mySurface->writeXLabels(array("Position"=>LABEL_POSITION_BOTTOM)); 44 | $mySurface->writeYLabels(); 45 | 46 | /* Add random values */ 47 | for($i=0; $i<=50; $i++) { $mySurface->addPoint(rand(0,20),rand(0,20),rand(0,100)); } 48 | 49 | /* Compute the missing points */ 50 | $mySurface->computeMissing(); 51 | 52 | /* Draw the surface chart */ 53 | $mySurface->drawSurface(array("Border"=>TRUE,"Surrounding"=>40)); 54 | 55 | /* Draw the contour with a threshold of 50 */ 56 | $mySurface->drawContour(50,array("R"=>0,"G"=>0,"B"=>0)); 57 | 58 | 59 | /* Render the picture (choose the best way) */ 60 | $myPicture->autoOutput("pictures/example.surface.png"); 61 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawDerivative.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(3,12,15,8,5,-5,5,-5,-3,4,5,10),"Probe"); 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),"Labels"); 14 | $MyData->setSerieDescription("Labels","Months"); 15 | $MyData->setAbscissa("Labels"); 16 | $MyData->setAbscissaName("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of AAliasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Set the default font */ 25 | $myPicture->setFontProperties(array("R"=>0,"G"=>0,"B"=>0,"FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 26 | 27 | /* Define the chart area */ 28 | $myPicture->setGraphArea(50,40,680,170); 29 | 30 | /* Draw the scale */ 31 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>100,"GridG"=>100,"GridB"=>100,"GridAlpha"=>15); 32 | $myPicture->drawScale($scaleSettings); 33 | 34 | /* Draw the chart */ 35 | $myPicture->Antialias = TRUE; 36 | $myPicture->drawSplineChart(); 37 | $myPicture->Antialias = FALSE; 38 | 39 | /* Draw the series derivative graph */ 40 | $myPicture->drawDerivative(array("Caption"=>FALSE)); 41 | 42 | /* Write the chart legend */ 43 | $myPicture->drawLegend(640,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 44 | 45 | /* Render the picture (choose the best way) */ 46 | $myPicture->autoOutput("pictures/example.drawDerivative.simple.png"); 47 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawFromGIF.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawFromGIF() - add pictures to your charts",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn off shadow computing */ 28 | $myPicture->setShadow(FALSE); 29 | 30 | /* Draw a GIF object */ 31 | $myPicture->drawFromGIF(180,50,"resources/computer.gif"); 32 | 33 | /* Turn on shadow computing */ 34 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 35 | 36 | /* Draw a GIF object */ 37 | $myPicture->drawFromGIF(400,50,"resources/computer.gif"); 38 | 39 | /* Write the legend */ 40 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 41 | $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>10,"FontName"=>"../fonts/calibri.ttf","Align"=>TEXT_ALIGN_BOTTOMMIDDLE); 42 | $myPicture->drawText(240,200,"Without shadow",$TextSettings); 43 | $myPicture->drawText(460,200,"With enhanced shadow",$TextSettings); 44 | 45 | /* Render the picture (choose the best way) */ 46 | $myPicture->autoOutput("pictures/example.drawFromGIF.png"); 47 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawFromJPG.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawFromJPG() - add pictures to your charts",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn off shadow computing */ 28 | $myPicture->setShadow(FALSE); 29 | 30 | /* Draw a JPG object */ 31 | $myPicture->drawFromJPG(100,45,"resources/landscape1.jpg"); 32 | 33 | /* Turn on shadow computing */ 34 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 35 | 36 | /* Draw a JPG object */ 37 | $myPicture->drawFromJPG(380,45,"resources/landscape2.jpg"); 38 | 39 | /* Write the legend */ 40 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 41 | $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>10,"FontName"=>"../fonts/calibri.ttf","Align"=>TEXT_ALIGN_BOTTOMMIDDLE); 42 | $myPicture->drawText(220,210,"Without shadow",$TextSettings); 43 | $myPicture->drawText(490,210,"With enhanced shadow",$TextSettings); 44 | 45 | /* Render the picture (choose the best way) */ 46 | $myPicture->autoOutput("pictures/example.drawFromJPG.png"); 47 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawFromPNG.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawFromPNG() - add pictures to your charts",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn off shadow computing */ 28 | $myPicture->setShadow(FALSE); 29 | 30 | /* Draw a PNG object */ 31 | $myPicture->drawFromPNG(180,50,"resources/hologram.png"); 32 | 33 | /* Turn on shadow computing */ 34 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 35 | 36 | /* Draw a PNG object */ 37 | $myPicture->drawFromPNG(400,50,"resources/blocnote.png"); 38 | 39 | /* Write the legend */ 40 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 41 | $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>10,"FontName"=>"../fonts/calibri.ttf","Align"=>TEXT_ALIGN_BOTTOMMIDDLE); 42 | $myPicture->drawText(240,190," Without shadow\r\n(only PNG alpha channels)",$TextSettings); 43 | $myPicture->drawText(460,200,"With enhanced shadow",$TextSettings); 44 | 45 | /* Render the picture (choose the best way) */ 46 | $myPicture->autoOutput("pictures/example.drawFromPNG.png"); 47 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawGeometricMean.php: -------------------------------------------------------------------------------- 1 | addPoints(rand(10,30)+$i,"Probe 1"); } 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->setAbscissaName("Samples"); 14 | 15 | /* Create the pChart object */ 16 | $myPicture = new pImage(700,230,$MyData); 17 | 18 | /* Turn of Antialiasing */ 19 | $myPicture->Antialias = FALSE; 20 | 21 | /* Add a border to the picture */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the chart title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 26 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 27 | 28 | /* Set the default font */ 29 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 30 | 31 | /* Define the chart area */ 32 | $myPicture->setGraphArea(60,40,680,200); 33 | 34 | /* Draw the scale */ 35 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 36 | $myPicture->drawScale($scaleSettings); 37 | 38 | /* Turn on Antialiasing */ 39 | $myPicture->Antialias = TRUE; 40 | 41 | /* Turn on shadows */ 42 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 43 | 44 | /* Draw the line chart */ 45 | $myPicture->drawPlotChart(); 46 | 47 | /* Draw the standard mean and the geometric one */ 48 | $Mean = $MyData->getSerieAverage("Probe 1"); 49 | $GeometricMean = $MyData->getGeometricMean("Probe 1"); 50 | $myPicture->drawThreshold($GeometricMean,array("WriteCaption"=>TRUE,"Caption"=>"Geometric mean")); 51 | $myPicture->drawThreshold($Mean,array("WriteCaption"=>TRUE,"Caption"=>"Mean","CaptionAlign"=>CAPTION_RIGHT_BOTTOM)); 52 | 53 | /* Write the computed values */ 54 | $myPicture->drawText(550,20,"Arithmetic average : ".round($Mean,2)); 55 | $myPicture->drawText(550,30,"Geometric Mean : ".round($GeometricMean,2)); 56 | 57 | /* Render the picture (choose the best way) */ 58 | $myPicture->autoOutput("pictures/example.geometricMean.png"); 59 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawHarmonicMean.php: -------------------------------------------------------------------------------- 1 | addPoints(rand(10,30)+$i,"Probe 1"); } 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->setAbscissaName("Samples"); 14 | 15 | /* Create the pChart object */ 16 | $myPicture = new pImage(700,230,$MyData); 17 | 18 | /* Turn of Antialiasing */ 19 | $myPicture->Antialias = FALSE; 20 | 21 | /* Add a border to the picture */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the chart title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 26 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 27 | 28 | /* Set the default font */ 29 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 30 | 31 | /* Define the chart area */ 32 | $myPicture->setGraphArea(60,40,680,200); 33 | 34 | /* Draw the scale */ 35 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 36 | $myPicture->drawScale($scaleSettings); 37 | 38 | /* Turn on Antialiasing */ 39 | $myPicture->Antialias = TRUE; 40 | 41 | /* Turn on shadows */ 42 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 43 | 44 | /* Draw the line chart */ 45 | $myPicture->drawPlotChart(); 46 | 47 | /* Draw the standard mean and the harmonic one */ 48 | $Mean = $MyData->getSerieAverage("Probe 1"); 49 | $HarmonicMean = $MyData->getHarmonicMean("Probe 1"); 50 | $myPicture->drawThreshold($HarmonicMean,array("WriteCaption"=>TRUE,"Caption"=>"Harmonic mean")); 51 | $myPicture->drawThreshold($Mean,array("WriteCaption"=>TRUE,"Caption"=>"Mean","CaptionAlign"=>CAPTION_RIGHT_BOTTOM)); 52 | 53 | /* Write the computed values */ 54 | $myPicture->drawText(550,20,"Arithmetic average : ".round($Mean,2)); 55 | $myPicture->drawText(550,30,"Harmonic Mean : ".round($HarmonicMean,2)); 56 | 57 | /* Render the picture (choose the best way) */ 58 | $myPicture->autoOutput("pictures/example.harmonicMean.png"); 59 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawIndicator.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawIndicator.php -------------------------------------------------------------------------------- /pChart/examples/example.drawLabel.barchart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawLabel.barchart.php -------------------------------------------------------------------------------- /pChart/examples/example.drawLabel.caption.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawLabel.caption.php -------------------------------------------------------------------------------- /pChart/examples/example.drawLabel.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawLabel.php -------------------------------------------------------------------------------- /pChart/examples/example.drawLabel.scatter.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawLabel.scatter.php -------------------------------------------------------------------------------- /pChart/examples/example.drawLabel.stacked.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,1,0,12,8,4,0,12,8),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,VOID,VOID,12,15,8),"Frontend #2"); 13 | $MyData->addPoints(array(4,4,4,4,4,4,4,4,4),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("January","February","March","April","May","June","July","August","September"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(700,230,$MyData); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 22 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 23 | 24 | /* Set the default font properties */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 26 | 27 | /* Draw the scale and the chart */ 28 | $myPicture->setGraphArea(60,20,680,190); 29 | $myPicture->drawScale(array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL_START0)); 30 | $myPicture->drawStackedAreaChart(array("DrawPlot"=>TRUE,"DrawLine"=>TRUE,"LineSurrounding"=>-20)); 31 | 32 | /* Turn on shadow processing */ 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 34 | 35 | /* Write a label */ 36 | $myPicture->writeLabel(array("Frontend #1","Frontend #2","Frontend #3"),1,array("DrawVerticalLine"=>TRUE)); 37 | 38 | /* Write the chart legend */ 39 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 40 | 41 | /* Render the picture (choose the best way) */ 42 | $myPicture->autoOutput("pictures/example.drawLabel.stacked.png"); 43 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawLine.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Draw the picture border */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawLine() - Basis",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Turn on shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw some lines */ 31 | for($i=1;$i<=100;$i=$i+4) 32 | $myPicture->drawLine($i+5,215,$i*7+5,30,array("R"=>rand(0,255),"G"=>rand(0,255),"B"=>rand(0,255),"Ticks"=>rand(0,4))); 33 | 34 | /* Draw an horizontal dashed line with extra weight */ 35 | $myPicture->drawLine(370,160,650,160,array("R"=>0,"G"=>0,"B"=>0,"Ticks"=>4,"Weight"=>3)); 36 | 37 | /* Another example of extra weight */ 38 | $myPicture->drawLine(370,180,650,200,array("R"=>255,"G"=>255,"B"=>255,"Ticks"=>15,"Weight"=>1)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawLine.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawLineChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(-4,VOID,VOID,12,8,3),"Probe 1"); 12 | $MyData->addPoints(array(3,12,15,8,5,-5),"Probe 2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22),"Probe 3"); 14 | $MyData->setSerieTicks("Probe 2",4); 15 | $MyData->setSerieWeight("Probe 3",2); 16 | $MyData->setAxisName(0,"Temperatures"); 17 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 18 | $MyData->setSerieDescription("Labels","Months"); 19 | $MyData->setAbscissa("Labels"); 20 | 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | 25 | /* Turn of Antialiasing */ 26 | $myPicture->Antialias = FALSE; 27 | 28 | /* Add a border to the picture */ 29 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 30 | 31 | /* Write the chart title */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 33 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 34 | 35 | /* Set the default font */ 36 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 37 | 38 | /* Define the chart area */ 39 | $myPicture->setGraphArea(60,40,650,200); 40 | 41 | /* Draw the scale */ 42 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 43 | $myPicture->drawScale($scaleSettings); 44 | 45 | /* Turn on Antialiasing */ 46 | $myPicture->Antialias = TRUE; 47 | 48 | /* Draw the line chart */ 49 | $myPicture->drawLineChart(); 50 | 51 | /* Write the chart legend */ 52 | $myPicture->drawLegend(540,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 53 | 54 | /* Render the picture (choose the best way) */ 55 | $myPicture->autoOutput("pictures/example.drawLineChart.simple.png"); 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawMedian.php: -------------------------------------------------------------------------------- 1 | addPoints(rand(10,30)+$i,"Probe 1"); } 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->setAbscissaName("Samples"); 14 | 15 | /* Create the pChart object */ 16 | $myPicture = new pImage(700,230,$MyData); 17 | 18 | /* Turn of Antialiasing */ 19 | $myPicture->Antialias = FALSE; 20 | 21 | /* Add a border to the picture */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the chart title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 26 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 27 | 28 | /* Set the default font */ 29 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 30 | 31 | /* Define the chart area */ 32 | $myPicture->setGraphArea(60,40,650,200); 33 | 34 | /* Draw the scale */ 35 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 36 | $myPicture->drawScale($scaleSettings); 37 | 38 | /* Turn on Antialiasing */ 39 | $myPicture->Antialias = TRUE; 40 | 41 | /* Draw the line of best fit */ 42 | $myPicture->drawThreshold($MyData->getSerieMedian("Probe 1"),array("WriteCaption"=>TRUE,"Caption"=>"Median value")); 43 | 44 | /* Turn on shadows */ 45 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 46 | 47 | /* Draw the line chart */ 48 | $myPicture->drawPlotChart(); 49 | 50 | /* Write the chart legend */ 51 | $myPicture->drawLegend(580,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("pictures/example.median.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawPlotChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(rand(0,20),"Probe 1"); } 12 | for($i=0;$i<=20;$i++) { $MyData->addPoints(rand(0,20),"Probe 2"); } 13 | $MyData->setSerieShape("Probe 1",SERIE_SHAPE_FILLEDTRIANGLE); 14 | $MyData->setSerieWeight("Probe 1",2); 15 | $MyData->setSerieShape("Probe 2",SERIE_SHAPE_FILLEDSQUARE); 16 | $MyData->setAxisName(0,"Temperatures"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of Antialiasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Add a border to the picture */ 25 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 26 | 27 | /* Write the chart title */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 29 | $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 30 | 31 | /* Set the default font */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | 34 | /* Define the chart area */ 35 | $myPicture->setGraphArea(60,40,650,200); 36 | 37 | /* Draw the scale */ 38 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 39 | $myPicture->drawScale($scaleSettings); 40 | 41 | /* Turn on Antialiasing */ 42 | $myPicture->Antialias = TRUE; 43 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 44 | 45 | /* Draw the line chart */ 46 | $myPicture->drawPlotChart(); 47 | 48 | /* Write the chart legend */ 49 | $myPicture->drawLegend(580,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 50 | 51 | /* Render the picture (choose the best way) */ 52 | $myPicture->autoOutput("pictures/example.drawPlotChart.simple.png"); 53 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawPolygon.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 14 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 15 | 16 | /* Overlay with a gradient */ 17 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 18 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 19 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 20 | 21 | /* Add a border to the picture */ 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 23 | 24 | /* Write the picture title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 26 | $myPicture->drawText(10,13,"drawPolygon - Draw polygons",array("R"=>255,"G"=>255,"B"=>255)); 27 | 28 | /* Enable shadow computing */ 29 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 30 | 31 | /* Create some filling thresholds */ 32 | $Threshold = ""; 33 | $Threshold[] = array("MinX"=>100,"MaxX"=>60,"R"=>200,"G"=>200,"B"=>200,"Alpha"=>50); 34 | $Threshold[] = array("MinX"=>140,"MaxX"=>100,"R"=>220,"G"=>220,"B"=>220,"Alpha"=>50); 35 | $Threshold[] = array("MinX"=>180,"MaxX"=>140,"R"=>240,"G"=>240,"B"=>240,"Alpha"=>50); 36 | 37 | /* Draw some polygons */ 38 | $Step = 8; 39 | $White = array("Threshold"=>$Threshold,"R"=>255,"G"=>255,"B"=>255,"Alpha"=>100,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0,"BorderAlpha"=>100); 40 | 41 | for($i=1;$i<=4;$i++) 42 | { 43 | $Points = ""; 44 | for($j=0;$j<=360;$j=$j+(360/$Step)) 45 | { 46 | $Points[] = cos(deg2rad($j))*50+($i*140); 47 | $Points[] = sin(deg2rad($j))*50+120; 48 | } 49 | $myPicture->drawPolygon($Points,$White); 50 | $Step = $Step * 2; 51 | } 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("pictures/example.drawPolygon.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawRectangle.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawRectangle() - Transparency & colors",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Enable shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw a rectangle */ 31 | $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100); 32 | $myPicture->drawRectangle(20,60,400,170,$RectangleSettings); 33 | 34 | /* Draw a rectangle */ 35 | $RectangleSettings = array("R"=>209,"G"=>134,"B"=>27,"Alpha"=>30); 36 | $myPicture->drawRectangle(30,30,200,200,$RectangleSettings); 37 | 38 | /* Draw a rectangle */ 39 | $RectangleSettings = array("R"=>209,"G"=>31,"B"=>27,"Alpha"=>100); 40 | $myPicture->drawRectangle(480,50,650,80,$RectangleSettings); 41 | 42 | /* Draw a rectangle */ 43 | $RectangleSettings = array("R"=>209,"G"=>125,"B"=>27,"Alpha"=>100); 44 | $myPicture->drawRectangle(480,90,650,120,$RectangleSettings); 45 | 46 | /* Draw a rectangle */ 47 | $RectangleSettings = array("R"=>209,"G"=>198,"B"=>27,"Alpha"=>100,"Ticks"=>2); 48 | $myPicture->drawRectangle(480,130,650,160,$RectangleSettings); 49 | 50 | /* Draw a rectangle */ 51 | $RectangleSettings = array("R"=>134,"G"=>209,"B"=>27,"Alpha"=>100,"Ticks"=>2); 52 | $myPicture->drawRectangle(480,170,650,200,$RectangleSettings); 53 | 54 | /* Render the picture (choose the best way) */ 55 | $myPicture->autoOutput("pictures/example.drawRectangle.png"); 56 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawScale.floating.php: -------------------------------------------------------------------------------- 1 | addPoints(array(8,10,24,25,25,24,23,22,20,12,10),"Temperature"); 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),"Labels"); 14 | $MyData->setSerieDescription("Labels","Months"); 15 | $MyData->setAbscissa("Labels"); 16 | 17 | /* Create the pChart object */ 18 | $myPicture = new pImage(700,230,$MyData); 19 | 20 | /* Draw the background */ 21 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 22 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 23 | 24 | /* Overlay with a gradient */ 25 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 26 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 27 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 28 | 29 | /* Add a border to the picture */ 30 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 31 | 32 | /* Write the picture title */ 33 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 34 | $myPicture->drawText(10,13,"drawScale() - draw the X-Y scales",array("R"=>255,"G"=>255,"B"=>255)); 35 | 36 | /* Set the default font */ 37 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 38 | 39 | /* Write the chart title */ 40 | $myPicture->setGraphArea(60,50,660,200); 41 | $myPicture->drawText(350,55,"My chart title",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 42 | 43 | /* Set the default font */ 44 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 45 | 46 | /* Draw the scale */ 47 | $scaleSettings = array("XMargin"=>15,"YMargin"=>15,"Floating"=>TRUE,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 48 | $myPicture->drawScale($scaleSettings); 49 | 50 | /* Render the picture (choose the best way) */ 51 | $myPicture->autoOutput("pictures/example.drawScale.floating.png"); 52 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawScale.php: -------------------------------------------------------------------------------- 1 | addPoints(array(24,-25,26,25,25),"Temperature"); 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 14 | $MyData->setSerieDescription("Labels","Months"); 15 | $MyData->setAbscissa("Labels"); 16 | $MyData->setAbscissaName("Months"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Draw the background */ 22 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 23 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 24 | 25 | /* Overlay with a gradient */ 26 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 27 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 28 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 29 | 30 | /* Add a border to the picture */ 31 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 32 | 33 | /* Write the picture title */ 34 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 35 | $myPicture->drawText(10,13,"drawScale() - draw the X-Y scales",array("R"=>255,"G"=>255,"B"=>255)); 36 | 37 | /* Set the default font */ 38 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 39 | 40 | /* Write the chart title */ 41 | $myPicture->setGraphArea(60,60,660,190); 42 | $myPicture->drawText(350,55,"My chart title",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 43 | $myPicture->drawFilledRectangle(60,60,660,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10)); 44 | 45 | /* Set the default font */ 46 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 47 | 48 | /* Draw the scale */ 49 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"DrawArrows"=>TRUE,"ArrowSize"=>6)); 50 | 51 | /* Render the picture (choose the best way) */ 52 | $myPicture->autoOutput("pictures/example.drawScale.png"); 53 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawScale.reverse.php: -------------------------------------------------------------------------------- 1 | addPoints(array(24,13,14),"Temperature"); 12 | $MyData->setAxisName(0,"Temperatures"); 13 | $MyData->addPoints(array("Sample #1","Sample #2","Sample #3"),"Labels"); 14 | $MyData->setAbscissa("Labels"); 15 | 16 | /* Create the pChart object */ 17 | $myPicture = new pImage(700,230,$MyData); 18 | 19 | /* Draw the background */ 20 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 21 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 22 | 23 | /* Overlay with a gradient */ 24 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 26 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 27 | 28 | /* Add a border to the picture */ 29 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 30 | 31 | /* Write the picture title */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 33 | $myPicture->drawText(10,13,"drawScale() - draw the X-Y scales",array("R"=>255,"G"=>255,"B"=>255)); 34 | 35 | /* Set the default font */ 36 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 37 | 38 | /* Draw the scale */ 39 | $myPicture->setGraphArea(60,90,660,210); 40 | $myPicture->drawScale(array("AutoAxisLabels"=>FALSE,"Pos"=>SCALE_POS_TOPBOTTOM)); 41 | 42 | /* Write the chart title */ 43 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 44 | $myPicture->drawText(360,55,"My chart title",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 45 | $myPicture->drawFilledRectangle(60,90,660,210,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10)); 46 | 47 | /* Render the picture (choose the best way) */ 48 | $myPicture->autoOutput("pictures/example.drawScale.reverse.png"); 49 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawScatterLineChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawScatterLineChart.php -------------------------------------------------------------------------------- /pChart/examples/example.drawScatterPlotChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawScatterPlotChart.php -------------------------------------------------------------------------------- /pChart/examples/example.drawScatterScale.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawScatterScale.php -------------------------------------------------------------------------------- /pChart/examples/example.drawScatterSplineChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawScatterSplineChart.php -------------------------------------------------------------------------------- /pChart/examples/example.drawSimple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(2,7,5,18,19,22,23,25,22,12,10,10),"DEFCA"); 12 | $MyData->setAxisName(0,"$ Incomes"); 13 | $MyData->setAxisDisplay(0,AXIS_FORMAT_CURRENCY); 14 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aou","Sep","Oct","Nov","Dec"),"Labels"); 15 | $MyData->setSerieDescription("Labels","Months"); 16 | $MyData->setAbscissa("Labels"); 17 | $MyData->setPalette("DEFCA",array("R"=>55,"G"=>91,"B"=>127)); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(700,230,$MyData); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>220,"StartG"=>220,"StartB"=>220,"EndR"=>255,"EndG"=>255,"EndB"=>255,"Alpha"=>100)); 22 | $myPicture->drawRectangle(0,0,699,229,array("R"=>200,"G"=>200,"B"=>200)); 23 | 24 | /* Write the picture title */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 26 | $myPicture->drawText(60,35,"2k9 Average Incomes",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMLEFT)); 27 | 28 | /* Do some cosmetic and draw the chart */ 29 | $myPicture->setGraphArea(60,40,670,190); 30 | $myPicture->drawFilledRectangle(60,40,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10)); 31 | $myPicture->drawScale(array("GridR"=>180,"GridG"=>180,"GridB"=>180)); 32 | 33 | /* Draw a spline chart on top */ 34 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 35 | $myPicture->drawFilledSplineChart(); 36 | 37 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 38 | $myPicture->drawSplineChart(); 39 | $myPicture->setShadow(FALSE); 40 | 41 | /* Write the chart legend */ 42 | $myPicture->drawLegend(643,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 43 | 44 | /* Render the picture (choose the best way) */ 45 | $myPicture->autoOutput("pictures/example.drawSimple.png"); 46 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawSpline.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"drawSpline() - for smooth line drawing",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Enable shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw a spline */ 31 | $SplineSettings = array("R"=>255,"G"=>255,"B"=>255,"ShowControl"=>TRUE); 32 | $Coordinates = array(array(40,80),array(280,60),array(340,166),array(590,120)); 33 | $myPicture->drawSpline($Coordinates,$SplineSettings); 34 | 35 | /* Draw a spline */ 36 | $SplineSettings = array("R"=>255,"G"=>255,"B"=>255,"ShowControl"=>TRUE,"Ticks"=>4); 37 | $Coordinates = array(array(250,50),array(250,180),array(350,180),array(350,50)); 38 | $myPicture->drawSpline($Coordinates,$SplineSettings); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawSpline.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawSplineChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/example.drawSplineChart.php -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedAreaChart.normalized.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,0,0,12,8,3,0,12,8),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,5,5,12,15,8),"Frontend #2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22,7,5,18),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jui","Aug","Sep"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Normalize the data series to 100% */ 20 | $MyData->normalize(100,"%"); 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 26 | 27 | /* Set the default font properties */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 29 | 30 | /* Draw the scale and the chart */ 31 | $myPicture->setGraphArea(60,20,680,190); 32 | $myPicture->drawScale(array("XMargin"=>1,"DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL_START0)); 33 | 34 | /* Turn on shadow processing */ 35 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 36 | 37 | /* Draw the stacked area chart */ 38 | $myPicture->drawStackedAreaChart(array("DrawPlot"=>TRUE,"DrawLine"=>TRUE,"LineSurrounding"=>-20)); 39 | 40 | /* Write the chart legend */ 41 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 42 | 43 | /* Render the picture (choose the best way) */ 44 | $myPicture->autoOutput("pictures/example.drawStackedAreaChart.normalized.png"); 45 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedAreaChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,1,0,12,8,4,0,12,8),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,VOID,VOID,12,15,8),"Frontend #2"); 13 | $MyData->addPoints(array(4,4,4,4,4,4,4,4,4),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("January","February","March","April","May","June","July","August","September"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(700,230,$MyData); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 22 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 23 | 24 | /* Set the default font properties */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 26 | 27 | /* Draw the scale and the chart */ 28 | $myPicture->setGraphArea(60,20,680,190); 29 | $myPicture->drawScale(array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL_START0)); 30 | $myPicture->drawStackedAreaChart(array("DrawPlot"=>TRUE,"DrawLine"=>TRUE,"LineSurrounding"=>-20)); 31 | 32 | /* Turn on shadow processing */ 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 34 | 35 | /* Write the chart legend */ 36 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 37 | 38 | /* Render the picture (choose the best way) */ 39 | $myPicture->autoOutput("pictures/example.drawStackedAreaChart.simple.png"); 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedBarChart.border.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,VOID,VOID,12,8,3),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,5,5),"Frontend #2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | 20 | /* Create the pChart object */ 21 | $myPicture = new pImage(700,230,$MyData); 22 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 23 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 24 | 25 | /* Set the default font properties */ 26 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 27 | 28 | /* Draw the scale and the chart */ 29 | $myPicture->setGraphArea(60,20,680,190); 30 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL_START0)); 31 | $myPicture->setShadow(FALSE); 32 | $myPicture->drawStackedBarChart(array("Surrounding"=>-15,"InnerSurrounding"=>15)); 33 | 34 | /* Write a label */ 35 | $myPicture->writeLabel(array("Frontend #1","Frontend #2","Frontend #3"),1,array("DrawVerticalLine"=>TRUE)); 36 | 37 | /* Write the chart legend */ 38 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawStackedBarChart.shaded.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedBarChart.can.php: -------------------------------------------------------------------------------- 1 | addPoints(array(-4,VOID,VOID,12,8,3),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,5,-5),"Frontend #2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Normalize all the data series to 100% */ 20 | $MyData->normalize(100,"%"); 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 26 | 27 | /* Set the default font properties */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 29 | 30 | /* Draw the scale and the chart */ 31 | $myPicture->setGraphArea(60,20,680,190); 32 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL)); 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 34 | $myPicture->drawStackedBarChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO,"Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"Surrounding"=>30)); 35 | $myPicture->setShadow(FALSE); 36 | 37 | /* Write the chart legend */ 38 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawStackedBarChart.can.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedBarChart.pyramid.php: -------------------------------------------------------------------------------- 1 | addPoints(array(20,40,65,100,70,55,40,22,12),"Male"); 12 | $MyData->addPoints(array(-22,-44,-61,-123,-74,-60,-52,-34,-21),"Female"); 13 | $MyData->setAxisName(0,"Community members"); 14 | $MyData->addPoints(array("0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","80-90"),"Labels"); 15 | $MyData->setSerieDescription("Labels","Ages"); 16 | $MyData->setAbscissa("Labels"); 17 | $MyData->setAxisDisplay(0,AXIS_FORMAT_CUSTOM,"YAxisFormat"); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage(700,230,$MyData); 21 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 22 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 23 | 24 | /* Set the default font properties */ 25 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 26 | 27 | /* Draw the scale and the chart */ 28 | $myPicture->setGraphArea(60,20,680,190); 29 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL)); 30 | $myPicture->setShadow(FALSE); 31 | $myPicture->drawStackedBarChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO,"Gradient"=>TRUE,"Surrounding"=>-20,"InnerSurrounding"=>20)); 32 | 33 | /* Write the chart legend */ 34 | $myPicture->drawLegend(600,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 35 | 36 | /* Render the picture (choose the best way) */ 37 | $myPicture->autoOutput("pictures/example.drawStackedBarChart.pyramid.png"); 38 | 39 | function YAxisFormat($Value) { return(abs($Value)); } 40 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStackedBarChart.shaded.php: -------------------------------------------------------------------------------- 1 | addPoints(array(-4,VOID,VOID,12,8,3),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,5,-5),"Frontend #2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Normalize all the data series to 100% */ 20 | $MyData->normalize(100,"%"); 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 26 | 27 | /* Set the default font properties */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 29 | 30 | /* Draw the scale and the chart */ 31 | $myPicture->setGraphArea(60,20,680,190); 32 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL)); 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 34 | $myPicture->drawStackedBarChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO,"Gradient"=>TRUE,"Surrounding"=>30,"InnerSurrounding"=>20)); 35 | $myPicture->setShadow(FALSE); 36 | 37 | /* Write the chart legend */ 38 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.drawStackedBarChart.shaded.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStepChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(VOID,VOID,VOID,2,6,3),"Probe 1"); 12 | $MyData->addPoints(array(13,12,15,18,15,10),"Probe 2"); 13 | $MyData->setAxisName(0,"Temperatures"); 14 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 15 | $MyData->setSerieDescription("Labels","Months"); 16 | $MyData->setAbscissa("Labels"); 17 | 18 | /* Create the pChart object */ 19 | $myPicture = new pImage(700,230,$MyData); 20 | 21 | /* Turn of AAliasing */ 22 | $myPicture->Antialias = FALSE; 23 | 24 | /* Draw the border */ 25 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 26 | 27 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 28 | 29 | /* Define the chart area */ 30 | $myPicture->setGraphArea(60,30,650,190); 31 | 32 | /* Draw the scale */ 33 | $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 34 | $myPicture->drawScale($scaleSettings); 35 | 36 | /* Draw the step chart */ 37 | $myPicture->drawStepChart(); 38 | 39 | /* Write the chart legend */ 40 | $myPicture->drawLegend(590,17,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 41 | 42 | /* Render the picture (choose the best way) */ 43 | $myPicture->autoOutput("pictures/example.drawStepChart.simple.png"); 44 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStockChart.median.php: -------------------------------------------------------------------------------- 1 | addPoints(array(35,28,17,27,12,12,20,15,20,28),"Open"); 13 | $MyData->addPoints(array(20,17,25,20,25,23,16,29,26,17),"Close"); 14 | $MyData->addPoints(array(10,11,14,11,9,4,3,7,9,5),"Min"); 15 | $MyData->addPoints(array(37,32,33,29,29,25,22,34,29,31),"Max"); 16 | $MyData->addPoints(array(30,20,21,24,22,18,18,24,22,24),"Median"); 17 | $MyData->setAxisDisplay(0,AXIS_FORMAT_CURRENCY,"$"); 18 | 19 | $MyData->addPoints(array("Dec 13","Dec 14","Dec 15","Dec 16","Dec 17", "Dec 20","Dec 21","Dec 22","Dec 23","Dec 24"),"Time"); 20 | $MyData->setAbscissa("Time"); 21 | $MyData->setAbscissaName("Time"); 22 | 23 | /* Create the pChart object */ 24 | $myPicture = new pImage(700,230,$MyData); 25 | 26 | /* Turn of AAliasing */ 27 | $myPicture->Antialias = FALSE; 28 | 29 | /* Draw the border */ 30 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 31 | 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 33 | 34 | /* Define the chart area */ 35 | $myPicture->setGraphArea(60,30,650,190); 36 | 37 | /* Draw the scale */ 38 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 39 | $myPicture->drawScale($scaleSettings); 40 | 41 | /* Create the pStock object */ 42 | $mystockChart = new pStock($myPicture,$MyData); 43 | 44 | /* Draw the stock chart */ 45 | $stockSettings = array("BoxUpR"=>255,"BoxUpG"=>255,"BoxUpB"=>255,"BoxDownR"=>0,"BoxDownG"=>0,"BoxDownB"=>0,"SerieMedian"=>"Median"); 46 | $mystockChart->drawStockChart($stockSettings); 47 | 48 | /* Render the picture (choose the best way) */ 49 | $myPicture->autoOutput("pictures/example.drawStockChart.median.png"); 50 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawStockChart.simple.php: -------------------------------------------------------------------------------- 1 | addPoints(array(35,28,17,27,12,12,20,15,20,28),"Open"); 13 | $MyData->addPoints(array(20,17,25,20,25,23,16,29,26,17),"Close"); 14 | $MyData->addPoints(array(10,11,14,11,9,4,3,7,9,5),"Min"); 15 | $MyData->addPoints(array(37,32,33,29,29,25,22,34,29,31),"Max"); 16 | $MyData->setAxisDisplay(0,AXIS_FORMAT_CURRENCY,"$"); 17 | 18 | $MyData->addPoints(array("Dec 13","Dec 14","Dec 15","Dec 16","Dec 17", "Dec 20","Dec 21","Dec 22","Dec 23","Dec 24"),"Time"); 19 | $MyData->setAbscissa("Time"); 20 | $MyData->setAbscissaName("Time"); 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | 25 | /* Turn of AAliasing */ 26 | $myPicture->Antialias = FALSE; 27 | 28 | /* Draw the border */ 29 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 30 | 31 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 32 | 33 | /* Define the chart area */ 34 | $myPicture->setGraphArea(60,30,650,190); 35 | 36 | /* Draw the scale */ 37 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 38 | $myPicture->drawScale($scaleSettings); 39 | 40 | /* Create the pStock object */ 41 | $mystockChart = new pStock($myPicture,$MyData); 42 | 43 | /* Draw the stock chart */ 44 | $stockSettings = array("BoxUpR"=>255,"BoxUpG"=>255,"BoxUpB"=>255,"BoxDownR"=>0,"BoxDownG"=>0,"BoxDownB"=>0); 45 | $mystockChart->drawStockChart($stockSettings); 46 | 47 | /* Render the picture (choose the best way) */ 48 | $myPicture->autoOutput("pictures/example.drawStockChart.simple.png"); 49 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawSurface.php: -------------------------------------------------------------------------------- 1 | 179, "G"=>217, "B"=>91, "Dash"=>1, "DashR"=>199, "DashG"=>237, "DashB"=>111); 15 | $myPicture->drawFilledRectangle(0,0,400,400,$Settings); 16 | 17 | /* Do a gradient overlay */ 18 | $Settings = array("StartR"=>194, "StartG"=>231, "StartB"=>44, "EndR"=>43, "EndG"=>107, "EndB"=>58, "Alpha"=>50); 19 | $myPicture->drawGradientArea(0,0,400,400,DIRECTION_VERTICAL,$Settings); 20 | $myPicture->drawGradientArea(0,0,400,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 21 | 22 | /* Add a border to the picture */ 23 | $myPicture->drawRectangle(0,0,399,399,array("R"=>0,"G"=>0,"B"=>0)); 24 | 25 | /* Write the picture title */ 26 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 27 | $myPicture->drawText(10,13,"pSurface() :: 2D surface charts",array("R"=>255,"G"=>255,"B"=>255)); 28 | 29 | /* Define the charting area */ 30 | $myPicture->setGraphArea(20,40,380,380); 31 | $myPicture->drawFilledRectangle(20,40,380,380,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>20)); 32 | 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1)); 34 | 35 | /* Create the surface object */ 36 | $mySurface = new pSurface($myPicture); 37 | 38 | /* Set the grid size */ 39 | $mySurface->setGrid(20,20); 40 | 41 | /* Write the axis labels */ 42 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 43 | $mySurface->writeXLabels(); 44 | $mySurface->writeYLabels(); 45 | 46 | /* Add random values */ 47 | for($i=0; $i<=50; $i++) { $mySurface->addPoint(rand(0,20),rand(0,20),rand(0,100)); } 48 | 49 | /* Compute the missing points */ 50 | $mySurface->computeMissing(); 51 | 52 | /* Draw the surface chart */ 53 | $mySurface->drawSurface(array("Border"=>TRUE,"Surrounding"=>40)); 54 | 55 | /* Render the picture (choose the best way) */ 56 | $myPicture->autoOutput("pictures/example.surface.png"); 57 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawSurface.simple.php: -------------------------------------------------------------------------------- 1 | 179, "G"=>217, "B"=>91, "Dash"=>1, "DashR"=>199, "DashG"=>237, "DashB"=>111); 15 | $myPicture->drawFilledRectangle(0,0,210,100,$Settings); 16 | 17 | /* Do a gradient overlay */ 18 | $Settings = array("StartR"=>194, "StartG"=>231, "StartB"=>44, "EndR"=>43, "EndG"=>107, "EndB"=>58, "Alpha"=>50); 19 | $myPicture->drawGradientArea(0,0,210,100,DIRECTION_VERTICAL,$Settings); 20 | $myPicture->drawGradientArea(0,0,210,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 21 | 22 | /* Add a border to the picture */ 23 | $myPicture->drawRectangle(0,0,209,99,array("R"=>0,"G"=>0,"B"=>0)); 24 | 25 | /* Write the picture title */ 26 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 27 | $myPicture->drawText(10,13,"pSurface() :: Surface charts",array("R"=>255,"G"=>255,"B"=>255)); 28 | 29 | /* Define the charting area */ 30 | $myPicture->setGraphArea(50,60,180,80); 31 | $myPicture->drawFilledRectangle(50,60,180,80,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>20)); 32 | 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1)); 34 | 35 | /* Create the surface object */ 36 | $mySurface = new pSurface($myPicture); 37 | 38 | /* Set the grid size */ 39 | $mySurface->setGrid(9,1); 40 | 41 | /* Write the axis labels */ 42 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 43 | 44 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Bedizen.ttf","FontSize"=>7)); 45 | 46 | 47 | $mySurface->writeXLabels(array("Angle"=>45,"Labels"=>array("Run 1","Run 2","Run 3","Run 4","Run 5","Run 6","Run 7","Run 8","Run 9","Run 10"))); 48 | $mySurface->writeYLabels(array("Labels"=>array("Probe 1","Probe 2"))); 49 | 50 | /* Add random values */ 51 | for($i=0; $i<=10; $i++) { $mySurface->addPoint($i,rand(0,1),rand(0,100)); } 52 | 53 | /* Draw the surface chart */ 54 | $mySurface->drawSurface(array("Border"=>TRUE,"Surrounding"=>40)); 55 | 56 | /* Render the picture (choose the best way) */ 57 | $myPicture->autoOutput("pictures/example.surface.simple.png"); 58 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.drawingObjects.php: -------------------------------------------------------------------------------- 1 | setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>14)); 13 | 14 | /* Create the background */ 15 | $myPicture->drawGradientArea(0,0,500,230,DIRECTION_HORIZONTAL,array("StartR"=>217,"StartG"=>250,"StartB"=>116,"EndR"=>181,"EndG"=>209,"EndB"=>27,"Alpha"=>100)); 16 | $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100); 17 | $myPicture->drawFilledRectangle(500,0,700,230,$RectangleSettings); 18 | 19 | /* Enable shadow computing on a (+1,+1) basis */ 20 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 21 | 22 | /* Draw the left area */ 23 | $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100); 24 | $myPicture->drawRoundedFilledRectangle(-5,0,20,240,10,$RectangleSettings); 25 | $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLELEFT); 26 | $myPicture->drawText(10,220,"My first chart",$TextSettings); 27 | 28 | /* Draw the right area */ 29 | $RectangleSettings = array("R"=>191,"G"=>219,"B"=>37,"Alpha"=>100,"Surrounding"=>20,"Ticks"=>2); 30 | $myPicture->drawFilledRectangle(510,10,689,219,$RectangleSettings); 31 | 32 | /* Write the legend */ 33 | $TextSettings = array("R"=>255,"G"=>255,"B"=>255,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE); 34 | $myPicture->drawText(600,30,"Weather data",$TextSettings); 35 | $TextSettings = array("R"=>106,"G"=>125,"B"=>3,"Align"=>TEXT_ALIGN_TOPLEFT,"FontSize"=>11); 36 | $myPicture->drawText(520,45,"The data shown here has been",$TextSettings); 37 | $myPicture->drawText(520,60,"collected from European locations",$TextSettings); 38 | $myPicture->drawText(520,75,"by the French NAVI system.",$TextSettings); 39 | $myPicture->drawFromPNG(540,90,"resources/blocnote.png"); 40 | 41 | /* Disable shadow computing */ 42 | $myPicture->setShadow(FALSE); 43 | 44 | /* Draw the picture border */ 45 | $RectangleSettings = array("R"=>181,"G"=>209,"B"=>27,"Alpha"=>100); 46 | $myPicture->drawRectangle(0,0,699,229,$RectangleSettings); 47 | 48 | /* Render the picture (choose the best way) */ 49 | $myPicture->autoOutput("pictures/example.drawingObjects.png"); 50 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.normalize.php: -------------------------------------------------------------------------------- 1 | addPoints(array(-4,VOID,VOID,12,8,3),"Frontend #1"); 12 | $MyData->addPoints(array(3,12,15,8,5,-5),"Frontend #2"); 13 | $MyData->addPoints(array(2,7,5,18,19,22),"Frontend #3"); 14 | $MyData->setAxisName(0,"Average Usage"); 15 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); 16 | $MyData->setSerieDescription("Labels","Months"); 17 | $MyData->setAbscissa("Labels"); 18 | 19 | /* Normalize the data series to 100% */ 20 | $MyData->normalize(100,"%"); 21 | 22 | /* Create the pChart object */ 23 | $myPicture = new pImage(700,230,$MyData); 24 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100)); 25 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20)); 26 | 27 | /* Set the default font properties */ 28 | $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 29 | 30 | /* Draw the scale and the chart */ 31 | $myPicture->setGraphArea(60,20,680,190); 32 | $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL)); 33 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 34 | $myPicture->drawStackedBarChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO,"Rounded"=>FALSE,"Surrounding"=>60)); 35 | $myPicture->setShadow(FALSE); 36 | 37 | /* Write the chart legend */ 38 | $myPicture->drawLegend(480,210,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 39 | 40 | /* Render the picture (choose the best way) */ 41 | $myPicture->autoOutput("pictures/example.normalize.png"); 42 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.polar.values.php: -------------------------------------------------------------------------------- 1 | addPoints(array(10,20,30,40,50,60,70,80,90),"ScoreA"); 13 | $MyData->addPoints(array(20,40,50,30,10,30,40,50,60),"ScoreB"); 14 | $MyData->setSerieDescription("ScoreA","Coverage A"); 15 | $MyData->setSerieDescription("ScoreB","Coverage B"); 16 | 17 | /* Define the absissa serie */ 18 | $MyData->addPoints(array(40,80,120,160,200,240,280,320,360),"Coord"); 19 | $MyData->setAbscissa("Coord"); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(300,300,$MyData); 23 | $myPicture->drawGradientArea(0,0,300,300,DIRECTION_VERTICAL,array("StartR"=>200,"StartG"=>200,"StartB"=>200,"EndR"=>240,"EndG"=>240,"EndB"=>240,"Alpha"=>100)); 24 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_HORIZONTAL,array("StartR"=>30,"StartG"=>30,"StartB"=>30,"EndR"=>100,"EndG"=>100,"EndB"=>100,"Alpha"=>100)); 25 | $myPicture->drawLine(0,20,300,20,array("R"=>255,"G"=>255,"B"=>255)); 26 | $RectangleSettings = array("R"=>180,"G"=>180,"B"=>180,"Alpha"=>100); 27 | 28 | /* Add a border to the picture */ 29 | $myPicture->drawRectangle(0,0,299,299,array("R"=>0,"G"=>0,"B"=>0)); 30 | 31 | /* Write the picture title */ 32 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 33 | $myPicture->drawText(10,13,"pRadar - Draw radar charts",array("R"=>255,"G"=>255,"B"=>255)); 34 | 35 | /* Set the default font properties */ 36 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 37 | 38 | /* Enable shadow computing */ 39 | $myPicture->setShadow(FALSE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 40 | 41 | /* Create the pRadar object */ 42 | $SplitChart = new pRadar(); 43 | 44 | /* Draw a radar chart */ 45 | $myPicture->setGraphArea(10,25,290,290); 46 | $Options = array("DrawPoly"=>TRUE,"WriteValues"=>TRUE,"ValueFontSize"=>8,"Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50)); 47 | $SplitChart->drawPolar($myPicture,$MyData,$Options); 48 | 49 | /* Render the picture (choose the best way) */ 50 | $myPicture->autoOutput("pictures/example.polar.values.png"); 51 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.radar.labels.php: -------------------------------------------------------------------------------- 1 | addPoints(array(4,4,10,10,4,4,15,15,4,4,10,10,4,4,15,15,4,4,10,10,4,4,15,15),"ScoreA"); 13 | $MyData->setSerieDescription("ScoreA","Application A"); 14 | $MyData->setPalette("ScoreA",array("R"=>150,"G"=>5,"B"=>217)); 15 | 16 | /* Define the absissa serie */ 17 | $MyData->addPoints(array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24),"Time"); 18 | $MyData->setAbscissa("Time"); 19 | 20 | /* Create the pChart object */ 21 | $myPicture = new pImage(300,300,$MyData); 22 | $myPicture->drawGradientArea(0,0,300,300,DIRECTION_VERTICAL,array("StartR"=>200,"StartG"=>200,"StartB"=>200,"EndR"=>240,"EndG"=>240,"EndB"=>240,"Alpha"=>100)); 23 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_HORIZONTAL,array("StartR"=>30,"StartG"=>30,"StartB"=>30,"EndR"=>100,"EndG"=>100,"EndB"=>100,"Alpha"=>100)); 24 | $myPicture->drawLine(0,20,300,20,array("R"=>255,"G"=>255,"B"=>255)); 25 | $RectangleSettings = array("R"=>180,"G"=>180,"B"=>180,"Alpha"=>100); 26 | 27 | /* Add a border to the picture */ 28 | $myPicture->drawRectangle(0,0,299,299,array("R"=>0,"G"=>0,"B"=>0)); 29 | 30 | /* Write the picture title */ 31 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 32 | $myPicture->drawText(10,13,"pRadar - Draw radar charts",array("R"=>255,"G"=>255,"B"=>255)); 33 | 34 | /* Set the default font properties */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 36 | 37 | /* Enable shadow computing */ 38 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 39 | 40 | /* Create the pRadar object */ 41 | $SplitChart = new pRadar(); 42 | 43 | /* Draw a radar chart */ 44 | $myPicture->setGraphArea(10,25,290,290); 45 | $Options = array("SkipLabels"=>3,"LabelMiddle"=>TRUE,"Layout"=>RADAR_LAYOUT_STAR,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50)); 46 | $SplitChart->drawRadar($myPicture,$MyData,$Options); 47 | 48 | /* Render the picture (choose the best way) */ 49 | $myPicture->autoOutput("pictures/example.radar.labels.png"); 50 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.radar.values.php: -------------------------------------------------------------------------------- 1 | addPoints(array(8,4,6,4,2,7),"Score"); 13 | $MyData->setSerieDescription("Score","Application A"); 14 | $MyData->setPalette("Score",array("R"=>157,"G"=>196,"B"=>22)); 15 | 16 | /* Define the absissa serie */ 17 | $MyData->addPoints(array("Speed","Weight","Cost","Size","Ease","Utility"),"Families"); 18 | $MyData->setAbscissa("Families"); 19 | 20 | /* Create the pChart object */ 21 | $myPicture = new pImage(300,300,$MyData); 22 | $myPicture->drawGradientArea(0,0,300,300,DIRECTION_VERTICAL,array("StartR"=>200,"StartG"=>200,"StartB"=>200,"EndR"=>240,"EndG"=>240,"EndB"=>240,"Alpha"=>100)); 23 | $myPicture->drawGradientArea(0,0,300,20,DIRECTION_HORIZONTAL,array("StartR"=>30,"StartG"=>30,"StartB"=>30,"EndR"=>100,"EndG"=>100,"EndB"=>100,"Alpha"=>100)); 24 | $myPicture->drawLine(0,20,300,20,array("R"=>255,"G"=>255,"B"=>255)); 25 | $RectangleSettings = array("R"=>180,"G"=>180,"B"=>180,"Alpha"=>100); 26 | 27 | /* Add a border to the picture */ 28 | $myPicture->drawRectangle(0,0,299,299,array("R"=>0,"G"=>0,"B"=>0)); 29 | 30 | /* Write the picture title */ 31 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 32 | $myPicture->drawText(10,13,"pRadar - Draw radar charts",array("R"=>255,"G"=>255,"B"=>255)); 33 | 34 | /* Set the default font properties */ 35 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 36 | 37 | /* Enable shadow computing */ 38 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 39 | 40 | /* Create the pRadar object */ 41 | $SplitChart = new pRadar(); 42 | 43 | /* Draw a radar chart */ 44 | $myPicture->setGraphArea(10,25,290,290); 45 | $Options = array("DrawPoly"=>TRUE,"WriteValues"=>TRUE,"ValueFontSize"=>8,"Layout"=>RADAR_LAYOUT_CIRCLE,"BackgroundGradient"=>array("StartR"=>255,"StartG"=>255,"StartB"=>255,"StartAlpha"=>100,"EndR"=>207,"EndG"=>227,"EndB"=>125,"EndAlpha"=>50)); 46 | $SplitChart->drawRadar($myPicture,$MyData,$Options); 47 | 48 | /* Render the picture (choose the best way) */ 49 | $myPicture->autoOutput("pictures/example.radar.values.png"); 50 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.setShadow.php: -------------------------------------------------------------------------------- 1 | 170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 13 | $myPicture->drawFilledRectangle(0,0,700,230,$Settings); 14 | 15 | /* Overlay with a gradient */ 16 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 17 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings); 18 | $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80)); 19 | 20 | /* Add a border to the picture */ 21 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 22 | 23 | /* Write the picture title */ 24 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6)); 25 | $myPicture->drawText(10,13,"setShadow() - Add shadows",array("R"=>255,"G"=>255,"B"=>255)); 26 | 27 | /* Enable shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw a filled circle */ 31 | $formSettings = array("R"=>201,"G"=>230,"B"=>40,"Alpha"=>100,"Surrounding"=>30); 32 | $myPicture->drawFilledCircle(90,120,30,$formSettings); 33 | 34 | /* Draw a filled rectangle */ 35 | $formSettings = array("R"=>231,"G"=>197,"B"=>40,"Alpha"=>100,"Surrounding"=>30); 36 | $myPicture->drawFilledRectangle(160,90,280,150,$formSettings); 37 | 38 | /* Draw a filled rounded rectangle */ 39 | $formSettings = array("R"=>231,"G"=>102,"B"=>40,"Alpha"=>100,"Surrounding"=>70); 40 | $myPicture->drawRoundedFilledRectangle(320,90,440,150,5,$formSettings); 41 | 42 | /* Render the picture (choose the best way) */ 43 | $myPicture->autoOutput("pictures/example.setShadow.png"); 44 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.singlebarcode128.php: -------------------------------------------------------------------------------- 1 | TRUE,"DrawArea"=>TRUE); 17 | $Size = $Barcode->getSize($String,$Settings); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage($Size["Width"],$Size["Height"]); 21 | 22 | /* Set the font to use */ 23 | $myPicture->setFontProperties(array("FontName"=>"../fonts/GeosansLight.ttf")); 24 | 25 | /* Render the barcode */ 26 | $Barcode->draw($myPicture,$String,10,10,$Settings); 27 | 28 | /* Render the picture (choose the best way) */ 29 | $myPicture->autoOutput("pictures/example.singlebarcode128.png"); 30 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.singlebarcode39.php: -------------------------------------------------------------------------------- 1 | TRUE,"DrawArea"=>TRUE); 17 | $Size = $Barcode->getSize($String,$Settings); 18 | 19 | /* Create the pChart object */ 20 | $myPicture = new pImage($Size["Width"],$Size["Height"]); 21 | 22 | /* Set the font to use */ 23 | $myPicture->setFontProperties(array("FontName"=>"../fonts/GeosansLight.ttf")); 24 | 25 | /* Render the barcode */ 26 | $Barcode->draw($myPicture,$String,10,10,$Settings); 27 | 28 | /* Render the picture (choose the best way) */ 29 | $myPicture->autoOutput("pictures/example.singlebarcode39.png"); 30 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.transparent.background.php: -------------------------------------------------------------------------------- 1 | 209,"G"=>31,"B"=>27,"Alpha"=>50,"Surrounding"=>30); 13 | $myPicture->drawRoundedFilledRectangle(10,25,70,55,5,$RectangleSettings); 14 | 15 | /* Draw a rounded filled rectangle */ 16 | $RectangleSettings = array("R"=>209,"G"=>125,"B"=>27,"Alpha"=>50,"Surrounding"=>30); 17 | $myPicture->drawRoundedFilledRectangle(10,85,70,115,5,$RectangleSettings); 18 | 19 | /* Draw a rounded filled rectangle */ 20 | $RectangleSettings = array("R"=>209,"G"=>198,"B"=>27,"Alpha"=>50,"Surrounding"=>30); 21 | $myPicture->drawRoundedFilledRectangle(10,135,70,165,5,$RectangleSettings); 22 | 23 | /* Draw a rounded filled rectangle */ 24 | $RectangleSettings = array("R"=>134,"G"=>209,"B"=>27,"Alpha"=>50,"Surrounding"=>30); 25 | $myPicture->drawRoundedFilledRectangle(10,185,70,215,5,$RectangleSettings); 26 | 27 | /* Enable shadow computing */ 28 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 29 | 30 | /* Draw a rounded filled rectangle */ 31 | $RectangleSettings = array("R"=>209,"G"=>198,"B"=>27,"Alpha"=>100,"Surrounding"=>30,"Radius"=>20); 32 | $myPicture->drawRoundedFilledRectangle(100,20,680,210,20,$RectangleSettings); 33 | 34 | /* Render the picture (choose the best way) */ 35 | $myPicture->autoOutput("pictures/example.transparent.background.png"); 36 | ?> -------------------------------------------------------------------------------- /pChart/examples/example.writeBounds.php: -------------------------------------------------------------------------------- 1 | addPoints(array(2,7,5,18,VOID,12,10,15,8,5,6,9),"Help Desk"); 12 | $MyData->setAxisName(0,"Incidents"); 13 | $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun","Jui","Aou","Sep","Oct","Nov","Dec"),"Labels"); 14 | $MyData->setSerieDescription("Labels","Months"); 15 | $MyData->setAbscissa("Labels"); 16 | 17 | /* Create the pChart object */ 18 | $myPicture = new pImage(700,230,$MyData); 19 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 20 | $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>100,"StartG"=>100,"StartB"=>100,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>20)); 21 | $myPicture->drawGradientArea(0,0,60,230,DIRECTION_HORIZONTAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>100)); 22 | 23 | /* Do some cosmetics */ 24 | $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 25 | $myPicture->drawLine(60,0,60,230,array("R"=>70,"G"=>70,"B"=>70)); 26 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 27 | $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11)); 28 | $myPicture->drawText(35,115,"Recorded cases",array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>20,"Angle"=>90,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); 29 | 30 | /* Draw a spline chart */ 31 | $myPicture->setGraphArea(100,30,680,190); 32 | $myPicture->drawFilledRectangle(100,30,680,190,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>20)); 33 | $myPicture->setFontProperties(array("R"=>255,"G"=>255,"B"=>255,"FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); 34 | $myPicture->drawScale(array("AxisR"=>255,"AxisG"=>255,"AxisB"=>255,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE)); 35 | $myPicture->drawSplineChart(); 36 | 37 | /* Write the data bounds */ 38 | $myPicture->writeBounds(); 39 | $myPicture->setShadow(FALSE); 40 | 41 | /* Write the chart legend */ 42 | $myPicture->drawLegend(630,215,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL)); 43 | 44 | /* Render the picture (choose the best way) */ 45 | $myPicture->autoOutput("pictures/example.writeBounds.png"); 46 | ?> -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/2DPie.php: -------------------------------------------------------------------------------- 1 | addPoints(array(40,60,15,10,6,4),"ScoreA"); 15 | $MyData->setSerieDescription("ScoreA","Application A"); 16 | 17 | /* Define the absissa serie */ 18 | $MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels"); 19 | $MyData->setAbscissa("Labels"); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(300,260,$MyData); 23 | 24 | /* Retrieve the image map */ 25 | if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"])) 26 | $myPicture->dumpImageMap("ImageMap2DPieChart",IMAGE_MAP_STORAGE_FILE,"2DPieChart","../tmp"); 27 | 28 | /* Set the image map name */ 29 | $myPicture->initialiseImageMap("ImageMap2DPieChart",IMAGE_MAP_STORAGE_FILE,"2DPieChart","../tmp"); 30 | 31 | /* Draw a solid background */ 32 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 33 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 34 | 35 | /* Overlay with a gradient */ 36 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 37 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 38 | 39 | /* Add a border to the picture */ 40 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 41 | 42 | /* Set the default font properties */ 43 | $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 44 | 45 | /* Enable shadow computing */ 46 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 47 | 48 | /* Create the pPie object */ 49 | $Settings = array("RecordImageMap"=>TRUE); 50 | $PieChart = new pPie($myPicture,$MyData,$Settings); 51 | 52 | /* Draw an AA pie chart */ 53 | $PieSettings = array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE,"RecordImageMap"=>TRUE); 54 | $PieChart->draw2DPie(160,125,$PieSettings); 55 | 56 | /* Render the picture (choose the best way) */ 57 | $myPicture->autoOutput("../tmp/2DPieChart.png"); 58 | ?> -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/2DRing.php: -------------------------------------------------------------------------------- 1 | addPoints(array(40,60,15,10,6,4),"ScoreA"); 15 | $MyData->setSerieDescription("ScoreA","Application A"); 16 | 17 | /* Define the absissa serie */ 18 | $MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels"); 19 | $MyData->setAbscissa("Labels"); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(300,260,$MyData); 23 | 24 | /* Retrieve the image map */ 25 | if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"])) 26 | $myPicture->dumpImageMap("ImageMap2DRingChart",IMAGE_MAP_STORAGE_FILE,"2DRingChart","../tmp"); 27 | 28 | /* Set the image map name */ 29 | $myPicture->initialiseImageMap("ImageMap2DRingChart",IMAGE_MAP_STORAGE_FILE,"2DRingChart","../tmp"); 30 | 31 | /* Draw a solid background */ 32 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 33 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 34 | 35 | /* Overlay with a gradient */ 36 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 37 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 38 | 39 | /* Add a border to the picture */ 40 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 41 | 42 | /* Set the default font properties */ 43 | $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 44 | 45 | /* Enable shadow computing */ 46 | $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>50)); 47 | 48 | /* Create the pPie object */ 49 | $Settings = array("RecordImageMap"=>TRUE); 50 | $PieChart = new pPie($myPicture,$MyData,$Settings); 51 | 52 | /* Draw an AA pie chart */ 53 | $PieSettings = array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE,"RecordImageMap"=>TRUE); 54 | $PieChart->draw2DRing(160,125,$PieSettings); 55 | 56 | /* Render the picture (choose the best way) */ 57 | $myPicture->autoOutput("../tmp/2DRingChart.png"); 58 | ?> -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/3DPie.php: -------------------------------------------------------------------------------- 1 | addPoints(array(40,60,15,10,6,4),"ScoreA"); 15 | $MyData->setSerieDescription("ScoreA","Application A"); 16 | 17 | /* Define the absissa serie */ 18 | $MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels"); 19 | $MyData->setAbscissa("Labels"); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(300,260,$MyData); 23 | 24 | /* Retrieve the image map */ 25 | if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"])) 26 | $myPicture->dumpImageMap("ImageMap3DPieChart",IMAGE_MAP_STORAGE_FILE,"3DPieChart","../tmp"); 27 | 28 | /* Set the image map name */ 29 | $myPicture->initialiseImageMap("ImageMap3DPieChart",IMAGE_MAP_STORAGE_FILE,"3DPieChart","../tmp"); 30 | 31 | /* Draw a solid background */ 32 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 33 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 34 | 35 | /* Overlay with a gradient */ 36 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 37 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 38 | 39 | /* Add a border to the picture */ 40 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 41 | 42 | /* Set the default font properties */ 43 | $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 44 | 45 | /* Create the pPie object */ 46 | $Settings = array("RecordImageMap"=>TRUE); 47 | $PieChart = new pPie($myPicture,$MyData,$Settings); 48 | 49 | /* Draw an AA pie chart */ 50 | $PieSettings = array("DrawLabels"=>TRUE,"LabelStacked"=>TRUE,"Border"=>TRUE,"RecordImageMap"=>TRUE); 51 | $PieChart->draw3DPie(160,150,$PieSettings); 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("../tmp/3DPieChart.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/3DRing.php: -------------------------------------------------------------------------------- 1 | addPoints(array(40,60,15,10,6,4),"ScoreA"); 15 | $MyData->setSerieDescription("ScoreA","Application A"); 16 | 17 | /* Define the absissa serie */ 18 | $MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels"); 19 | $MyData->setAbscissa("Labels"); 20 | 21 | /* Create the pChart object */ 22 | $myPicture = new pImage(300,260,$MyData); 23 | 24 | /* Retrieve the image map */ 25 | if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"])) 26 | $myPicture->dumpImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp"); 27 | 28 | /* Set the image map name */ 29 | $myPicture->initialiseImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp"); 30 | 31 | /* Draw a solid background */ 32 | $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107); 33 | $myPicture->drawFilledRectangle(0,0,300,300,$Settings); 34 | 35 | /* Overlay with a gradient */ 36 | $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50); 37 | $myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings); 38 | 39 | /* Add a border to the picture */ 40 | $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0)); 41 | 42 | /* Set the default font properties */ 43 | $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80)); 44 | 45 | /* Create the pPie object */ 46 | $Settings = array("RecordImageMap"=>TRUE); 47 | $PieChart = new pPie($myPicture,$MyData,$Settings); 48 | 49 | /* Draw an AA pie chart */ 50 | $PieSettings = array("InnerRadius"=>30,"OuterRadius"=>80,"DrawLabels"=>TRUE,"Border"=>TRUE,"RecordImageMap"=>TRUE); 51 | $PieChart->draw3DRing(160,150,$PieSettings); 52 | 53 | /* Render the picture (choose the best way) */ 54 | $myPicture->autoOutput("../tmp/3DRingChart.png"); 55 | ?> -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/ScatterLineChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/imageMap/scripts/ScatterLineChart.php -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/ScatterPlotChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/imageMap/scripts/ScatterPlotChart.php -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/ScatterSplineChart.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/imageMap/scripts/ScatterSplineChart.php -------------------------------------------------------------------------------- /pChart/examples/imageMap/scripts/StockChart.php: -------------------------------------------------------------------------------- 1 | addPoints(array(35,28,17,27,12,12,20,15,20,28),"Open"); 15 | $MyData->addPoints(array(20,17,25,20,25,23,16,29,26,17),"Close"); 16 | $MyData->addPoints(array(10,11,14,11,9,4,3,7,9,5),"Min"); 17 | $MyData->addPoints(array(37,32,33,29,29,25,22,34,29,31),"Max"); 18 | $MyData->addPoints(array(30,20,21,24,22,18,18,24,22,24),"Median"); 19 | $MyData->setAxisDisplay(0,AXIS_FORMAT_CURRENCY,"$"); 20 | 21 | $MyData->addPoints(array("Dec 13","Dec 14","Dec 15","Dec 16","Dec 17", "Dec 20","Dec 21","Dec 22","Dec 23","Dec 24"),"Time"); 22 | $MyData->setAbscissa("Time"); 23 | $MyData->setAbscissaName("Time"); 24 | 25 | /* Create the pChart object */ 26 | $myPicture = new pImage(700,230,$MyData); 27 | 28 | /* Retrieve the image map */ 29 | if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"])) 30 | $myPicture->dumpImageMap("ImageMapStockChart",IMAGE_MAP_STORAGE_FILE,"StockChart","../tmp"); 31 | 32 | /* Set the image map name */ 33 | $myPicture->initialiseImageMap("ImageMapStockChart",IMAGE_MAP_STORAGE_FILE,"StockChart","../tmp"); 34 | 35 | /* Turn of AAliasing */ 36 | $myPicture->Antialias = FALSE; 37 | 38 | /* Draw the border */ 39 | $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0)); 40 | 41 | $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/pf_arma_five.ttf","FontSize"=>6)); 42 | 43 | /* Define the chart area */ 44 | $myPicture->setGraphArea(60,30,650,190); 45 | 46 | /* Draw the scale */ 47 | $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE); 48 | $myPicture->drawScale($scaleSettings); 49 | 50 | /* Create the pStock object */ 51 | $mystockChart = new pStock($myPicture,$MyData); 52 | 53 | /* Draw the stock chart */ 54 | $stockSettings = array("RecordImageMap"=>TRUE,"BoxUpR"=>255,"BoxUpG"=>255,"BoxUpB"=>255,"BoxDownR"=>0,"BoxDownG"=>0,"BoxDownB"=>0,"SerieMedian"=>"Median"); 55 | $mystockChart->drawStockChart($stockSettings); 56 | 57 | /* Render the picture (choose the best way) */ 58 | $myPicture->autoOutput("../tmp/StockChart.png"); 59 | ?> -------------------------------------------------------------------------------- /pChart/examples/resources/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/accept.png -------------------------------------------------------------------------------- /pChart/examples/resources/application_view_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/application_view_list.png -------------------------------------------------------------------------------- /pChart/examples/resources/application_view_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/application_view_tile.png -------------------------------------------------------------------------------- /pChart/examples/resources/blocnote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/blocnote.png -------------------------------------------------------------------------------- /pChart/examples/resources/chart_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/chart_bar.png -------------------------------------------------------------------------------- /pChart/examples/resources/chart_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/chart_line.png -------------------------------------------------------------------------------- /pChart/examples/resources/computer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/computer.gif -------------------------------------------------------------------------------- /pChart/examples/resources/dash-explorer-blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/dash-explorer-blank.png -------------------------------------------------------------------------------- /pChart/examples/resources/dash-explorer-last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/dash-explorer-last.png -------------------------------------------------------------------------------- /pChart/examples/resources/dash-explorer-noleaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/dash-explorer-noleaf.png -------------------------------------------------------------------------------- /pChart/examples/resources/dash-explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/dash-explorer.png -------------------------------------------------------------------------------- /pChart/examples/resources/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/dash.png -------------------------------------------------------------------------------- /pChart/examples/resources/dataset.txt: -------------------------------------------------------------------------------- 1 | Hour,Temperature,Humidity 2 | 0,10,40 3 | 1,9,41 4 | 2,8,44 5 | 3,8,42 6 | 4,9,40 7 | 5,9,38 8 | 6,10,39 9 | 7,11,35 10 | 8,12,33 11 | 9,14,32 12 | 10,16,30 13 | 11,18,30 14 | 12,20,30 15 | 13,21,31 16 | 14,22,33 17 | 15,23,34 18 | 16,22,36 19 | 17,20,37 20 | 18,16,38 21 | 19,14,38 22 | 20,12,39 23 | 21,11,40 24 | 22,11,44 25 | 23,10,40 -------------------------------------------------------------------------------- /pChart/examples/resources/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/folder.png -------------------------------------------------------------------------------- /pChart/examples/resources/hologram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/hologram.png -------------------------------------------------------------------------------- /pChart/examples/resources/landscape1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/landscape1.jpg -------------------------------------------------------------------------------- /pChart/examples/resources/landscape2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/landscape2.jpg -------------------------------------------------------------------------------- /pChart/examples/resources/palette.txt: -------------------------------------------------------------------------------- 1 | 239,210,121,100 2 | 149,203,233,100 3 | 2,71,105,100 4 | 175,215,117,100 5 | 44,87,0,100 6 | 222,157,127,100 7 | -------------------------------------------------------------------------------- /pChart/examples/resources/serie1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/serie1.png -------------------------------------------------------------------------------- /pChart/examples/resources/serie2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/serie2.png -------------------------------------------------------------------------------- /pChart/examples/resources/wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/resources/wait.gif -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/accept.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/application_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/application_form.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/background.console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/background.console.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/chart_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/chart_bar.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/chart_bar_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/chart_bar_edit.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/chart_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/chart_curve.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/chart_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/chart_line.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/cog.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/color_swatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/color_swatch.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/comment.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/database_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/database_table.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/layout_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/layout_edit.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/page_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/page_edit.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/paintcan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/paintcan.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/shape_flip_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/shape_flip_vertical.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/tab.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/vector.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/wait.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/wait.gif -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/wand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/wand.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/graphix/wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/graphix/wrench.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/includes/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/includes/arrow.gif -------------------------------------------------------------------------------- /pChart/examples/sandbox/includes/constants.txt: -------------------------------------------------------------------------------- 1 | 0.12345,VOID 2 | 680001,AXIS_FORMAT_DEFAULT 3 | 680002,AXIS_FORMAT_TIME 4 | 680003,AXIS_FORMAT_DATE 5 | 680004,AXIS_FORMAT_METRIC 6 | 680005,AXIS_FORMAT_CURRENCY 7 | 681001,AXIS_POSITION_LEFT 8 | 681002,AXIS_POSITION_RIGHT 9 | 682001,AXIS_X 10 | 682002,AXIS_Y 11 | 690001,DIRECTION_VERTICAL 12 | 690002,DIRECTION_HORIZONTAL 13 | 690101,SCALE_POS_LEFTRIGHT 14 | 690102,SCALE_POS_TOPBOTTOM 15 | 690201,SCALE_MODE_FLOATING 16 | 690202,SCALE_MODE_START0 17 | 690203,SCALE_MODE_ADDALL 18 | 690204,SCALE_MODE_ADDALL_START0 19 | 690301,SCALE_SKIP_NONE 20 | 690302,SCALE_SKIP_SAME 21 | 690303,SCALE_SKIP_NUMBERS 22 | 690401,TEXT_ALIGN_TOPLEFT 23 | 690402,TEXT_ALIGN_TOPMIDDLE 24 | 690403,TEXT_ALIGN_TOPRIGHT 25 | 690404,TEXT_ALIGN_MIDDLELEFT 26 | 690405,TEXT_ALIGN_MIDDLEMIDDLE 27 | 690406,TEXT_ALIGN_MIDDLERIGHT 28 | 690407,TEXT_ALIGN_BOTTOMLEFT 29 | 690408,TEXT_ALIGN_BOTTOMMIDDLE 30 | 690409,TEXT_ALIGN_BOTTOMRIGHT 31 | 690501,POSITION_TOP 32 | 690502,POSITION_BOTTOM 33 | 690601,LABEL_POS_LEFT 34 | 690602,LABEL_POS_CENTER 35 | 690603,LABEL_POS_RIGHT 36 | 690604,LABEL_POS_TOP 37 | 690605,LABEL_POS_BOTTOM 38 | 690606,LABEL_POS_INSIDE 39 | 690607,LABEL_POS_OUTSIDE 40 | 690701,ORIENTATION_HORIZONTAL 41 | 690702,ORIENTATION_VERTICAL 42 | 690800,LEGEND_NOBORDER 43 | 690801,LEGEND_BOX 44 | 690802,LEGEND_ROUND 45 | 690901,LEGEND_VERTICAL 46 | 690902,LEGEND_HORIZONTAL 47 | 691051,LEGEND_FAMILY_BOX 48 | 691052,LEGEND_FAMILY_CIRCLE 49 | 691053,LEGEND_FAMILY_LINE 50 | 691001,DISPLAY_AUTO 51 | 691002,DISPLAY_MANUAL 52 | 691011,LABELING_ALL 53 | 691012,LABELING_DIFFERENT 54 | 691021,BOUND_MIN 55 | 691022,BOUND_MAX 56 | 691023,BOUND_BOTH 57 | 691031,BOUND_LABEL_POS_TOP 58 | 691032,BOUND_LABEL_POS_BOTTOM 59 | 691033,BOUND_LABEL_POS_AUTO 60 | 691041,CAPTION_LEFT_TOP 61 | 691042,CAPTION_RIGHT_BOTTOM -------------------------------------------------------------------------------- /pChart/examples/sandbox/includes/cross.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/includes/cross.gif -------------------------------------------------------------------------------- /pChart/examples/sandbox/includes/hs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/includes/hs.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/includes/hv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/examples/sandbox/includes/hv.png -------------------------------------------------------------------------------- /pChart/examples/sandbox/script/session.php: -------------------------------------------------------------------------------- 1 | $Value) 19 | { $_SESSION[$Key] = $Value; } 20 | 21 | print_r($_SESSION); 22 | 23 | usleep(200000); 24 | ?> -------------------------------------------------------------------------------- /pChart/examples/sandbox/style.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | margin: 4px; 4 | text-align: left; 5 | font-family: tahoma; 6 | background-color: #FFFFFF; 7 | background-image: url('graphix/background.console.png'); 8 | } 9 | 10 | table { margin: 0px; padding: 0px;} 11 | 12 | td { margin: 0px; padding: 0px; } 13 | 14 | tr { margin: 0px; padding: 0px; } 15 | 16 | td.topMenu { font-family: tahoma; font-size: 11px; } 17 | 18 | div.roundedCorner { font-size: 10px; } 19 | 20 | div.topMenu { border: 1px solid #FEFEFE; background-color: #EAEAEA; cursor: hand; cursor: pointer; } 21 | 22 | input 23 | { 24 | font-family: tahoma; 25 | font-size: 10px; 26 | } 27 | 28 | input[type="text"] 29 | { 30 | width: 325px; 31 | border: 1px solid #D0D0D0; 32 | background-color: #FFFFFF; 33 | vertical-align: middle; 34 | font-weight: normal; 35 | color: #707070; 36 | outline: none; 37 | height: 15px; 38 | } 39 | 40 | select 41 | { 42 | border: 1px solid #D0D0D0; 43 | background-color: #FFFFFF; 44 | vertical-align: middle; 45 | font-weight: normal; 46 | color: #707070; 47 | outline: none; 48 | font-size: 10px; 49 | height: 19px; 50 | } 51 | 52 | input[type="submit"] 53 | { 54 | border: 1px solid #D0D0D0; 55 | background-color: #FFFFFF; 56 | vertical-align: middle; 57 | font-weight: normal; 58 | color: #707070; 59 | outline: none; 60 | } 61 | 62 | pre 63 | { 64 | font-family; tahoma; 65 | font-size: 11px; 66 | background-color: #FFFFFF; 67 | border: 1px solid #E0E0E0; 68 | padding: 5px; 69 | margin-top: 20px; 70 | text-align: left; 71 | overflow-x: auto; 72 | white-space: pre-wrap; 73 | white-space: -moz-pre-wrap !important; 74 | white-space: -pre-wrap; 75 | white-space: -o-pre-wrap; 76 | word-wrap: break-word; 77 | } 78 | 79 | a.link:link { text-decoration: none; } 80 | a.link:visited { text-decoration: none; } 81 | a.link:hover { text-decoration: underline; } 82 | 83 | a.smallLinkGrey:link { text-decoration: none; color: #6A6A6A; } 84 | a.smallLinkGrey:visited { text-decoration: none; color: #6A6A6A; } 85 | a.smallLinkGrey:hover { text-decoration: underline; color: #6A6A6A; } 86 | 87 | a.smallLinkBlack:link { text-decoration: none; color: #000000; } 88 | a.smallLinkBlack:visited { text-decoration: none; color: #000000; } 89 | a.smallLinkBlack:hover { text-decoration: underline; color: #000000; } 90 | -------------------------------------------------------------------------------- /pChart/fonts/Bedizen.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/Bedizen.ttf -------------------------------------------------------------------------------- /pChart/fonts/Forgotte.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/Forgotte.ttf -------------------------------------------------------------------------------- /pChart/fonts/GeosansLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/GeosansLight.ttf -------------------------------------------------------------------------------- /pChart/fonts/MankSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/MankSans.ttf -------------------------------------------------------------------------------- /pChart/fonts/Silkscreen.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/Silkscreen.ttf -------------------------------------------------------------------------------- /pChart/fonts/advent_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/advent_light.ttf -------------------------------------------------------------------------------- /pChart/fonts/calibri.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/calibri.ttf -------------------------------------------------------------------------------- /pChart/fonts/pf_arma_five.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/pf_arma_five.ttf -------------------------------------------------------------------------------- /pChart/fonts/verdana.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/fonts/verdana.ttf -------------------------------------------------------------------------------- /pChart/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pChart/palettes/autumn.color: -------------------------------------------------------------------------------- 1 | 185,106,154,100 2 | 216,137,184,100 3 | 156,192,137,100 4 | 216,243,201,100 5 | 253,232,215,100 6 | 255,255,255,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/blind.color: -------------------------------------------------------------------------------- 1 | 109,152,171,100 2 | 0,39,94,100 3 | 254,183,41,100 4 | 168,177,184,100 5 | 255,255,255,100 6 | 0,0,0,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/evening.color: -------------------------------------------------------------------------------- 1 | 242,245,237,100 2 | 255,194,0,100 3 | 255,91,0,100 4 | 184,0,40,100 5 | 132,0,46,100 6 | 74,192,242,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/kitchen.color: -------------------------------------------------------------------------------- 1 | 155,225,251,100 2 | 197,239,253,100 3 | 189,32,49,100 4 | 35,31,32,100 5 | 255,255,255,100 6 | 0,98,149,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/light.color: -------------------------------------------------------------------------------- 1 | 239,210,121,100 2 | 149,203,233,100 3 | 2,71,105,100 4 | 175,215,117,100 5 | 44,87,0,100 6 | 222,157,127,100 7 | 8 | -------------------------------------------------------------------------------- /pChart/palettes/navy.color: -------------------------------------------------------------------------------- 1 | 25,78,132,100 2 | 59,107,156,100 3 | 31,36,42,100 4 | 55,65,74,100 5 | 96,187,34,100 6 | 242,186,187,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/shade.color: -------------------------------------------------------------------------------- 1 | 117,113,22,100 2 | 174,188,33,100 3 | 217,219,86,100 4 | 0,71,127,100 5 | 76,136,190,100 6 | 141,195,233,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/spring.color: -------------------------------------------------------------------------------- 1 | 146,123,81,100 2 | 168,145,102,100 3 | 128,195,28,100 4 | 188,221,90,100 5 | 255,121,0,100 6 | 251,179,107,100 7 | -------------------------------------------------------------------------------- /pChart/palettes/summer.color: -------------------------------------------------------------------------------- 1 | 253,184,19,100 2 | 246,139,31,100 3 | 241,112,34,100 4 | 98,194,204,100 5 | 228,246,248,100 6 | 238,246,108,100 7 | -------------------------------------------------------------------------------- /pChart/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/pChart/readme.txt -------------------------------------------------------------------------------- /start_hal10k.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM /** 3 | REM * HAL10K - Bitcoin PHP Trading bot 4 | REM * 5 | REM * After losing some money on Bitcoin exchanges, I decided to develop my own Trading bot/helper. 6 | REM * This bot acts with pre-defined parameters based on statistics/strategies and not with the emotion of the moment, so it's much easier to perform trading operations. 7 | REM * 8 | REM * @package HAL10K 9 | REM * @version 2.2 10 | REM * @category bitcoin 11 | REM * @author intrd - http://dann.com.br/ 12 | REM * @link https://github.com/intrd/bitcoin-hal10k 13 | REM * @see http://dann.com.br/hal-10k-php-trading-helper-bot/ 14 | REM * @copyright 2013 intrd 15 | REM * @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/ 16 | REM * 17 | REM */ 18 | 19 | REM start cmd /k Call webserver.bat 4444 20 | echo # At first RUN, please correct the PHP path on start_hal10k.bat or use simply the 1-click-run version: http://dann.com.br/hal10k_1click_apache.php-winx86.zip 21 | pause 22 | :Logit 23 | echo Start time is: %date% %TIME% 24 | 25 | 26 | cd \xampp\php 27 | php c:\xampp\htdocs\bitcoin\hal10k\start.php 28 | 29 | GOTO Logit -------------------------------------------------------------------------------- /twitter_api/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "themattharris/tmhoauth", 3 | "description": "An OAuth library written in PHP by @themattharris", 4 | "license": "Apache-2.0", 5 | "authors": [ 6 | { 7 | "name": "themattharris", 8 | "email": "matt@themattharris.com", 9 | "role": "Developer" 10 | } 11 | ], 12 | "keywords": [ 13 | "twitter", 14 | "oauth" 15 | ], 16 | "support": { 17 | "issues": "https://github.com/themattharris/tmhOAuth/issues" 18 | }, 19 | "require": { 20 | "php": ">=5.3.0", 21 | "ext-curl": "*" 22 | }, 23 | "autoload": { 24 | "psr-0": { "tmhOAuth": "" } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/README.md: -------------------------------------------------------------------------------- 1 | # tmhOAuth-examples 2 | 3 | A repository containing example uses of tmhOAuth. 4 | 5 | ## Dependencies 6 | 7 | These examples require [tmhOAuth](https://github.com/themattharris/tmhOAuth) version 0.8.0 or higher. They have been 8 | tested with PHP 5.3+. 9 | 10 | The easiest way to install tmhOAuth is to use [composer](http://getcomposer.org). if you prefer to do things the manual way 11 | make sure you `git clone` tmhOAuth into the main tmhOAuthExamples directory (the same one this file is in). 12 | 13 | ## Usage 14 | 15 | Edit `tmhOAuthExample.php` and enter your application and user values for: 16 | - 'consumer_key' 17 | - 'consumer_secret' 18 | - 'user_token' 19 | - 'user_secret' 20 | - 'bearer' 21 | 22 | If you're just trying things out it's recommended you use a test account instead of your real one as some examples do things 23 | like tweet or follow. 24 | 25 | To create an application, visit [dev.twitter.com/apps](https://dev.twitter.com/apps) 26 | 27 | For command line examples, go into the `cli` directory and execute any of the examples using `php .php`. Remember 28 | some examples make POST actions, and will tweet or follow on your behalf. 29 | 30 | For web based examples add tmhOAuthExamples to a location on your webserver that you access via a URL. 31 | 32 | ## Change History 33 | ### 0.1 - 14 June 2013 34 | - switched all examples to Twitter API v1.1 35 | - removed redundant/confusing examples 36 | - centralised examples as children of a master example configuration script (`tmhOAuthExample.php`) 37 | 38 | ## Community 39 | 40 | License: Apache 2 (see [included LICENSE file](https://github.com/themattharris/tmhOAuth/blob/master/LICENSE)) 41 | 42 | Follow [@tmhOAuth](https://twitter.com/intent/follow?screen_name=tmhOAuth) to receive updates on releases, or ask for support 43 | Follow me on Twitter: [@themattharris](https://twitter.com/intent/follow?screen_name=themattharris) 44 | Check out the Twitter Developer Resources: 45 | 46 | ## To Do 47 | 48 | - More streaming api examples 49 | - Control Streams examples 50 | - More Web request examples -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/follow.php: -------------------------------------------------------------------------------- 1 | user_request(array( 7 | 'method' => 'POST', 8 | 'url' => $tmhOAuth->url('1.1/friendships/create'), 9 | 'params' => array( 10 | 'screen_name' => 'tmhOAuth' 11 | ) 12 | )); 13 | 14 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/followings.php: -------------------------------------------------------------------------------- 1 | request( 29 | 'GET', 30 | $tmhOAuth->url('1.1/friends/list'), 31 | array( 32 | 'cursor' => $cursor, 33 | 'skip_status' => true, 34 | 'screen_name' => $screen_name 35 | ) 36 | ); 37 | 38 | check_rate_limit($tmhOAuth->response); 39 | 40 | if ($code == 200) { 41 | $data = json_decode($tmhOAuth->response['response'], true); 42 | $friends = array_merge($friends, $data['users']); 43 | $cursor = $data['next_cursor_str']; 44 | } else { 45 | $tmhOAuth->render_response(); 46 | break; 47 | } 48 | usleep(500000); 49 | endwhile; 50 | 51 | echo '@' . $screen_name . ' follows ' . count($friends) . ' users.' . PHP_EOL . PHP_EOL; 52 | foreach ($friends as $friend) { 53 | echo '@' . $friend['screen_name'] . ' (' . $friend['id_str'] . ')' . PHP_EOL; 54 | } -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/multi_tokens.php: -------------------------------------------------------------------------------- 1 | user_request(array( 11 | 'url' => $tmhOAuth->url('1.1/account/verify_credentials') 12 | )); 13 | 14 | $d = json_decode($tmhOAuth->response['response']); 15 | if ($code == 200) { 16 | echo 'hello @' . $d->screen_name . PHP_EOL; 17 | } elseif (isset($d->errors[0]->message)) { 18 | echo 'hmm, the API returned an error: ' . $d->errors[0]->message . PHP_EOL; 19 | } else { 20 | echo 'hmm, the API returned an error: ' . $tmhOAuth->response['response'] . PHP_EOL; 21 | } 22 | } 23 | 24 | request(); 25 | 26 | // change to another set of credentials by copying the current config and merging new values on top 27 | $tmhOAuth->reconfigure(array_merge($tmhOAuth->config, array( 28 | 'token' => 'ANOTHER_USER_TOKEN', 29 | 'secret' => 'ANOTHER_USER_SECRET', 30 | )); 31 | 32 | request(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/obtain_bearer.php: -------------------------------------------------------------------------------- 1 | bearer_token_credentials(); 8 | $params = array( 9 | 'grant_type' => 'client_credentials', 10 | ); 11 | 12 | $code = $tmhOAuth->request( 13 | 'POST', 14 | $tmhOAuth->url('/oauth2/token', null), 15 | $params, 16 | false, 17 | false, 18 | array( 19 | 'Authorization' => "Basic ${bearer}" 20 | ) 21 | ); 22 | 23 | if ($code == 200) { 24 | $data = json_decode($tmhOAuth->response['response']); 25 | if (isset($data->token_type) && strcasecmp($data->token_type, 'bearer') === 0) { 26 | $new_bearer = $data->access_token; 27 | echo 'Your app-only bearer token is: ' . $new_bearer . PHP_EOL; 28 | } 29 | } else { 30 | $tmhOAuth->render_response(); 31 | } -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/photo_tweet.php: -------------------------------------------------------------------------------- 1 | user_request(array( 11 | 'method' => 'POST', 12 | 'url' => $tmhOAuth->url('1.1/statuses/update_with_media'), 13 | 'params' => array( 14 | 'media[]' => "@{$image};type=image/jpeg;filename={$name}", 15 | 'status' => $status, 16 | ), 17 | 'multipart' => true, 18 | )); 19 | 20 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/search.php: -------------------------------------------------------------------------------- 1 | apponly_request(array( 7 | 'method' => 'GET', 8 | 'url' => $tmhOAuth->url('1.1/search/tweets'), 9 | 'params' => array( 10 | 'q' => 'tmhoauth' 11 | ) 12 | )); 13 | 14 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/streaming_api.php: -------------------------------------------------------------------------------- 1 | streaming_request( 22 | 'GET', 23 | 'https://stream.twitter.com/1.1/statuses/sample.json', 24 | array(), 25 | 'my_streaming_callback' 26 | ); 27 | 28 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/tweet.php: -------------------------------------------------------------------------------- 1 | user_request(array( 7 | 'method' => 'POST', 8 | 'url' => $tmhOAuth->url('1.1/statuses/update'), 9 | 'params' => array( 10 | 'status' => 'Something for the weekend' 11 | ) 12 | )); 13 | 14 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/user_lookup.php: -------------------------------------------------------------------------------- 1 | user_request(array( 7 | 'method' => 'GET', 8 | 'url' => $tmhOAuth->url('1.1/users/lookup'), 9 | 'params' => array( 10 | 'user_id' => array( 11 | 777925, 12 | ), 13 | 'screen_name' => array( 14 | 'tmhoauth', 15 | ), 16 | 'map' => 1 17 | ), 18 | )); 19 | 20 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/verify_credentials.php: -------------------------------------------------------------------------------- 1 | user_request(array( 7 | 'url' => $tmhOAuth->url('1.1/account/verify_credentials') 8 | )); 9 | 10 | $tmhOAuth->render_response(); -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/cli/xauth.php: -------------------------------------------------------------------------------- 1 | apponly_request(array( 7 | 'without_bearer' => true, 8 | 'method' => 'POST', 9 | 'url' => $tmhOAuth->url('oauth/access_token', ''), 10 | 'params' => array( 11 | 'x_auth_username' => 'USERNAME', 12 | 'x_auth_password' => 'PASSWORD', 13 | 'x_auth_mode' => 'client_auth', 14 | 'send_error_codes' => true, 15 | ) 16 | )); 17 | 18 | if ($code == 200) { 19 | $data = $tmhOAuth->extract_params($tmhOAuth->response['response']); 20 | if (isset($data['oauth_token'])) { 21 | echo 'OAuth Credentials for @'.$data['screen_name'].' ('.$data['user_id'].')' . PHP_EOL; 22 | echo 'Token: '.$data['oauth_token'].PHP_EOL; 23 | echo 'Secret: '.$data['oauth_token_secret'].PHP_EOL; 24 | 25 | // instead of printing these to screen you would typically save them to a database 26 | // if you do store the oauth_token and oauth_secret to a database it's best practice 27 | // store them with some kind of encryption. e.g. mcrypt_encrypt 28 | } 29 | } else { 30 | $tmhOAuth->render_response(); 31 | } -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "themattharris/tmhoauth": "*" 4 | } 5 | } -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/index.php: -------------------------------------------------------------------------------- 1 | ${name}"; 39 | } 40 | 41 | $demos = available_demos(DEMO_ROOT); 42 | $current_demo = current_demo($demos); 43 | ?> 44 | 45 | 46 | 47 | <?php page_title($current_demo); ?> 48 | 71 | 72 | 73 |
74 |

Demos

75 | 76 |
    77 | $v) : ?> 78 |
  • 79 | 80 |
81 | 82 |
83 | 84 |
85 | 88 |

Select a demo from the list.

89 | 90 |
91 | 92 | response['raw'])) : ?> 93 |
94 |

Raw Response

95 |
 96 |       response['raw']; ?>
 97 |     
98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/web/photo_tweet.php: -------------------------------------------------------------------------------- 1 |
2 |

Photo Tweet

3 | "@{$_FILES['image']['tmp_name']};type={$_FILES['image']['type']};filename={$_FILES['image']['name']}", 9 | 'status' => $_POST['status'] 10 | ); 11 | 12 | $code = $tmhOAuth->user_request(array( 13 | 'method' => 'POST', 14 | 'url' => $tmhOAuth->url("1.1/statuses/update_with_media"), 15 | 'params' => $params, 16 | 'multipart' => true 17 | )); 18 | 19 | if ($code == 200) : 20 | $data = json_decode($tmhOAuth->response['response'], true); 21 | ?> 22 |

Hello, @.

23 | You just tweeted 24 | 25 |

Something went wrong

26 |

response['error'] ?>

27 | 28 |
29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 | 37 | 38 |
39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/web/search_tweets.php: -------------------------------------------------------------------------------- 1 |
2 |

Search Tweets

3 | apponly_request(array( 8 | 'url' => $tmhOAuth->url('1.1/search/tweets'), 9 | 'params' => array( 10 | 'q' => $_GET['q'] 11 | ) 12 | )); 13 | 14 | if ($code == 200) : 15 | $data = json_decode($tmhOAuth->response['response'], true); 16 | ?> 17 |

Oh, results .. cool.

18 | 19 |

Something went wrong

20 |

response['error'] ?>

21 | 22 |
23 | 24 |
25 |
26 | 27 | 28 | 29 | 30 |
31 | 32 |
33 |
34 | -------------------------------------------------------------------------------- /twitter_api/tmhOAuthExamples-master/web/verify_credentials.php: -------------------------------------------------------------------------------- 1 |
2 |

Verify Credentials

3 | user_request(array( 6 | 'url' => $tmhOAuth->url('1.1/account/verify_credentials') 7 | )); 8 | 9 | if ($code == 200) : 10 | $data = json_decode($tmhOAuth->response['response'], true); 11 | 12 | if (isset($data['status'])) { 13 | $code = $tmhOAuth->user_request(array( 14 | 'url' => $tmhOAuth->url('1.1/statuses/oembed'), 15 | 'params' => array( 16 | 'id' => $data['status']['id_str'] 17 | ) 18 | )); 19 | 20 | if ($code == 200) 21 | $tweet = json_decode($tmhOAuth->response['response'], true); 22 | } 23 | ?> 24 |

Hello, @.

25 | 26 | 27 |

Something went wrong

28 |

response['error'] ?>

29 | 30 |
-------------------------------------------------------------------------------- /web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrd/bitcoin-hal10k/86e44251ea3ba8b61357bd252bc9bc2c86c7dce0/web.png --------------------------------------------------------------------------------