diff --git a/.gitattributes b/.gitattributes index 923432a5..c6b12e16 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,3 +17,7 @@ /codeception.yml export-ignore /composer.lock export-ignore /jpgraph_logo.jpg export-ignore +/.php_cs.cache export-ignore +/.phpunit.result.cache export-ignore +/.build/csfixer.cache export-ignore +/.build/phplint.cache export-ignore \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bf572ecf..b0383a28 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -53,7 +53,7 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install PHP dependencies - run: composer update --'prefer-stable' --no-interaction --no-progress + run: composer install --prefer-dist --no-interaction --no-progress --ignore-platform-reqs - name: Coverage run: composer coverage diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 187d01ba..9c5c62bf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install PHP dependencies - run: composer update --'prefer-stable' --no-interaction --no-progress --ignore-platform-reqs + run: composer install --no-plugins --prefer-dist --no-interaction --no-progress --ignore-platform-reqs - name: PHPLint run: composer lint diff --git a/.php_cs.cache b/.php_cs.cache deleted file mode 100644 index 9e6f2bc1..00000000 --- a/.php_cs.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"7.2.25-1+ubuntu18.04.1+deb.sury.org+1","version":"2.15.0:v2.15.0#adfab51ae979ee8b0fcbc55aa231ec2786cb1f91","indent":" ","lineEnding":"\n","rules":{"no_php4_constructor":true,"php_unit_namespaced":{"target":"6.0"},"php_unit_dedicate_assert":{"target":"5.6"},"php_unit_expectation":{"target":"5.6"},"php_unit_mock":{"target":"5.5"},"php_unit_no_expectation_annotation":{"target":"4.3"},"binary_operator_spaces":{"align_double_arrow":true,"align_equals":true},"blank_line_after_opening_tag":true,"blank_line_before_statement":true,"braces":true,"cast_spaces":true,"class_attributes_separation":{"elements":["method"]},"class_definition":true,"concat_space":{"spacing":"one"},"declare_equal_normalize":true,"function_typehint_space":true,"include":true,"increment_style":true,"lowercase_cast":true,"lowercase_static_reference":true,"magic_constant_casing":true,"magic_method_casing":true,"method_argument_space":{"ensure_fully_multiline":true},"native_function_casing":true,"native_function_type_declaration_casing":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_empty_comment":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["break","continue","extra","return","throw","use","parenthesis_brace_block","square_brace_block","curly_brace_block"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_around_offset":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_unneeded_control_parentheses":true,"no_unneeded_curly_braces":true,"no_unneeded_final_method":true,"no_unused_imports":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"object_operator_without_whitespace":true,"php_unit_fqcn_annotation":true,"phpdoc_align":true,"phpdoc_annotation_without_dot":true,"phpdoc_indent":true,"phpdoc_inline_tag":true,"phpdoc_no_access":true,"phpdoc_no_alias_tag":true,"phpdoc_no_empty_return":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true,"phpdoc_separation":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":true,"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_types_order":true,"phpdoc_var_without_name":true,"protected_to_private":true,"return_type_declaration":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_class_element_per_statement":{"elements":["property"]},"single_quote":true,"single_trait_insert_per_statement":true,"space_after_semicolon":{"remove_in_empty_for_expressions":true},"standardize_increment":true,"standardize_not_equals":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline_array":true,"trim_array_spaces":true,"unary_operator_spaces":true,"whitespace_after_comma_in_array":true,"blank_line_after_namespace":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"modernize_types_casting":true,"align_multiline_comment":true,"array_syntax":{"syntax":"short"},"combine_consecutive_issets":true,"combine_consecutive_unsets":true,"compact_nullable_typehint":true,"escape_implicit_backslashes":true,"explicit_indirect_variable":true,"explicit_string_variable":true,"final_internal_class":true,"header_comment":{"commentType":"PHPDoc","header":"JPGraph v4.0.0"},"heredoc_to_nowdoc":true,"list_syntax":{"syntax":"long"},"method_chaining_indentation":true,"multiline_comment_opening_closing":true,"no_null_property_initialization":true,"no_short_echo_tag":true,"no_superfluous_elseif":true,"no_unreachable_default_argument_value":true,"no_useless_else":true,"no_useless_return":true,"ordered_imports":true,"php_unit_strict":true,"php_unit_test_annotation":true,"php_unit_test_class_requires_covers":true,"phpdoc_add_missing_param_annotation":true,"phpdoc_order":true,"strict_param":true},"hashes":{"Examples\/examples_axis\/axislabelbkgex05.php":1759485393,"Examples\/examples_axis\/axislabelbkgex07.php":2192521527,"Examples\/examples_axis\/topxaxis.php":3196655853,"Examples\/examples_axis\/axislabelbkgex04.php":50610810,"Examples\/examples_axis\/mulyaxisex1.php":1187126820,"Examples\/examples_axis\/inyaxisex1.php":517396201,"Examples\/examples_axis\/inyaxisex2.php":2364750263,"Examples\/examples_axis\/axislabelbkgex02.php":2056980487,"Examples\/examples_axis\/inyaxisex3.php":1274998304,"Examples\/examples_axis\/axislabelbkgex03.php":87248563,"Examples\/examples_axis\/axislabelbkgex01.php":740044155,"Examples\/examples_axis\/axislabelbkgex06.php":1411831829,"Examples\/examples_axis\/dupyaxisex1.php":3288066482,"Examples\/examples_radar\/no_test_radarex3.php":2779928066,"Examples\/examples_radar\/no_test_radarex6.php":1269764359,"Examples\/examples_radar\/no_test_radarex8.1.php":3302161840,"Examples\/examples_radar\/no_test_radarex5.php":2985686765,"Examples\/examples_radar\/no_test_radarlogex1-aa.php":1198398340,"Examples\/examples_radar\/no_test_radarex2.php":2271679967,"Examples\/examples_radar\/no_test_radarmarkex1.php":117059392,"Examples\/examples_radar\/no_test_radarex6.1.php":4000994083,"Examples\/examples_radar\/no_test_radarex4.php":2110963000,"Examples\/examples_radar\/no_test_radarex1.php":390277548,"Examples\/examples_radar\/no_test_radarlogex2.php":896245536,"Examples\/examples_radar\/no_test_radarex9.php":868610821,"Examples\/examples_radar\/no_test_fixscale_radarex1.php":3669407442,"Examples\/examples_radar\/no_test_radarlogex1.php":728762360,"Examples\/examples_radar\/no_test_radarex7.php":1240293235,"Examples\/examples_radar\/no_test_radarex8.php":3766292693,"Examples\/examples_qr\/no_test_qrexample12.php":969772685,"Examples\/examples_qr\/no_test_qrexample11.php":4076326493,"Examples\/examples_qr\/no_test_qr_template.php":4235038275,"Examples\/examples_qr\/no_test_qrexample03.php":786877606,"Examples\/examples_qr\/no_test_qrexample08.php":4255043824,"Examples\/examples_qr\/no_test_qrexample07.php":4119236108,"Examples\/examples_qr\/no_test_qrexample02.php":2743888955,"Examples\/examples_qr\/no_test_qrexample05.php":3368447682,"Examples\/examples_qr\/no_test_qrexample09.php":2722296159,"Examples\/examples_qr\/no_test_qrexample04.php":1439752972,"Examples\/examples_qr\/no_test_qrexample00.php":694931049,"Examples\/examples_qr\/no_test_qrexample01.php":1329872836,"Examples\/examples_qr\/no_test_qrexample10.php":3234248850,"Examples\/examples_qr\/no_test_qrexample0.php":107337635,"Examples\/examples_qr\/no_test_qrexample06.php":2551538089,"Examples\/examples_tables\/no_test_tableex00.php":1031785484,"Examples\/examples_tables\/no_test_table_vtext.php":2731380737,"Examples\/examples_tables\/no_test_table_mex3.php":2393340785,"Examples\/examples_tables\/no_test_table_howto5.php":136858856,"Examples\/examples_tables\/no_test_table_howto1.php":524519782,"Examples\/examples_tables\/no_test_table_mex1.php":1524590985,"Examples\/examples_tables\/no_test_table_howto7.php":2994249961,"Examples\/examples_tables\/no_test_tableex04.php":3803289147,"Examples\/examples_tables\/no_test_table_howto8.php":3374942483,"Examples\/examples_tables\/no_test_table_howto7.2.php":2994249961,"Examples\/examples_tables\/no_test_table_howto4.php":3204538249,"Examples\/examples_tables\/no_test_tableex05.php":17882985,"Examples\/examples_tables\/no_test_table_flagex1.php":727745378,"Examples\/examples_tables\/no_test_table_howto2.php":609271369,"Examples\/examples_tables\/no_test_table_mex0.php":3382239488,"Examples\/examples_tables\/no_test_table_howto9.php":41051795,"Examples\/examples_tables\/no_test_tableex01.php":81037069,"Examples\/examples_tables\/no_test_table_howto7.1.php":3588625229,"Examples\/examples_tables\/no_test_table_howto3.php":3971965130,"Examples\/examples_tables\/no_test_table_howto6.php":2481349773,"Examples\/examples_tables\/no_test_table_vtext_ex1.php":1160732788,"Examples\/examples_tables\/no_test_table_mex00.php":2340033975,"Examples\/examples_tables\/no_test_tablebarex1.php":2363123125,"Examples\/examples_tables\/no_test_table_mex2.php":628903699,"Examples\/examples_tables\/no_test_tableex03.php":1747401013,"Examples\/examples_tables\/no_test_tableex02.php":1321779093,"Examples\/examples_rotate\/rotex4.php":3170555959,"Examples\/examples_rotate\/rotex0.php":3979600988,"Examples\/examples_rotate\/rotex2.php":3662066651,"Examples\/examples_rotate\/rotex1.php":1095761255,"Examples\/examples_rotate\/rotateex1.php":1796146303,"Examples\/examples_rotate\/rotex3.php":1292114585,"Examples\/examples_rotate\/rotex5.php":524780724,"Examples\/show-example.php":1543080987,"Examples\/checkttf.php":186395781,"Examples\/listallflags.php":960540511,"Examples\/examples_led\/no_test_ledex13.php":2212987444,"Examples\/examples_led\/no_test_ledex14.php":3157904637,"Examples\/examples_led\/no_test_ledex3.php":1668222451,"Examples\/examples_led\/no_test_ledex5.php":2001750537,"Examples\/examples_led\/no_test_ledex4.1.php":2334379830,"Examples\/examples_led\/no_test_ledex7.php":2344991881,"Examples\/examples_led\/no_test_ledex1.php":1218820615,"Examples\/examples_led\/no_test_ledex10.php":1708304390,"Examples\/examples_led\/no_test_ledex6.php":2468077344,"Examples\/examples_led\/no_test_ledex8.php":1109859753,"Examples\/examples_led\/no_test_ledex12.php":3122975372,"Examples\/examples_led\/no_test_ledex_cyrillic2.php":2374151908,"Examples\/examples_led\/no_test_ledex9.php":37746845,"Examples\/examples_led\/no_test_ledex15.php":407349482,"Examples\/examples_led\/no_test_ledex17.php":2884083211,"Examples\/examples_led\/no_test_ledex4.2.php":4216642000,"Examples\/examples_led\/no_test_ledex4.php":3004712005,"Examples\/examples_led\/no_test_ledex16.php":1359061332,"Examples\/examples_led\/no_test_ledex_cyrillic.php":1918769542,"Examples\/examples_led\/no_test_ledex2.php":3600088464,"Examples\/examples_led\/no_test_ledex11.php":723708937,"Examples\/checkgd.php":3059580498,"Examples\/csim_in_html_ex2.php":308665523,"Examples\/examples_img\/imgmarkerex1.php":4025215141,"Examples\/examples_img\/bkgimgflagex1.php":1432504919,"Examples\/examples_img\/no_dim_bkgimgflagex4.php":639197028,"Examples\/examples_img\/no_dim_bkgimgflagex3.php":674431062,"Examples\/examples_img\/no_dim_bkgimgflagex5.php":4187725535,"Examples\/examples_img\/antispamex01.php":1095228719,"Examples\/examples_img\/no_dim_bkgimgflagex2.php":2632392698,"Examples\/examples_odometer\/no_test_odoex09.php":1373413836,"Examples\/examples_odometer\/no_test_odotutex01.php":2467976778,"Examples\/examples_odometer\/no_test_odotutex17.php":1805354633,"Examples\/examples_odometer\/no_test_odotutex03.php":2726243403,"Examples\/examples_odometer\/no_test_odoex03.php":2736833783,"Examples\/examples_odometer\/no_test_odotutex15.php":3107047345,"Examples\/examples_odometer\/no_test_odotutex16.1.php":184926700,"Examples\/examples_odometer\/no_test_odoex011.php":1556909925,"Examples\/examples_odometer\/no_test_odotutex19.php":4237229363,"Examples\/examples_odometer\/no_test_odotutex11.php":1215439613,"Examples\/examples_odometer\/no_test_odoex07.php":2537823154,"Examples\/examples_odometer\/no_test_odoex02.php":2209491339,"Examples\/examples_odometer\/no_test_odotutex14.php":588763063,"Examples\/examples_odometer\/no_test_odotutex12.php":2275149401,"Examples\/examples_odometer\/no_test_odotutex08.php":1564422435,"Examples\/examples_odometer\/no_test_odotutex18.php":2360522070,"Examples\/examples_odometer\/no_test_odotutex06.php":3668681761,"Examples\/examples_odometer\/no_test_odotutex09.php":475402084,"Examples\/examples_odometer\/no_test_odotutex02.php":4134740225,"Examples\/examples_odometer\/no_test_odotutex10.php":1313622312,"Examples\/examples_odometer\/no_test_odoex012.php":1227835858,"Examples\/examples_odometer\/no_test_odotutex04.php":3123660747,"Examples\/examples_odometer\/no_test_odotutex07.php":3449228909,"Examples\/examples_odometer\/no_test_odotutex00.php":556342226,"Examples\/examples_odometer\/no_test_odotutex16.php":976220855,"Examples\/examples_odometer\/no_test_odoex05.php":2400056131,"Examples\/examples_odometer\/no_test_odoex06.php":926447899,"Examples\/examples_odometer\/no_test_odotutex08.1.php":1507518868,"Examples\/examples_odometer\/no_test_odoex01.php":3022935921,"Examples\/examples_odometer\/no_test_odoex04.php":56072471,"Examples\/examples_odometer\/no_test_odoex08.php":2979728819,"Examples\/examples_odometer\/no_test_odoex00.php":1158410692,"Examples\/examples_odometer\/no_test_odotutex13.php":2807240552,"Examples\/examples_odometer\/no_test_odoex010.php":2240472040,"Examples\/examples_matrix\/no_test_matrix_ex04.php":923393043,"Examples\/examples_matrix\/no_test_matrix_ex01.php":50319649,"Examples\/examples_matrix\/no_test_matrixex00.php":863797823,"Examples\/examples_matrix\/no_test_matrix_ex03.php":1615885068,"Examples\/examples_matrix\/no_test_matrix_edgeex02.php":2242296877,"Examples\/examples_matrix\/no_test_matrix_edgeex01.php":2213697297,"Examples\/examples_matrix\/no_test_matrix_ex06.php":3378893491,"Examples\/examples_matrix\/no_test_matrix_layout_ex1.php":3868652052,"Examples\/examples_matrix\/no_test_matrix_ex05.php":3792878701,"Examples\/examples_matrix\/no_test_matrix_ex02.php":566490301,"Examples\/examples_matrix\/no_test_matrix_ex04.2.php":2431139422,"Examples\/examples_matrix\/no_test_matrix_ex04.1.php":3590101168,"Examples\/examples_matrix\/no_test_matrix_ex0.php":2509629825,"Examples\/examples_matrix\/no_test_matrix_introex.php":3728217922,"Examples\/builtinplotmarksex1.php":1124628874,"Examples\/testsuitversus.php":125199041,"Examples\/linlogex1.php":637606420,"Examples\/titleex1.php":3479797644,"Examples\/y2synch2.php":2786114186,"Examples\/checkgd2.php":94287310,"Examples\/show-image.php":1567245115,"Examples\/examples_staticband\/staticbandbarex1.php":973462625,"Examples\/examples_staticband\/staticbandbarex4.php":132178157,"Examples\/examples_staticband\/staticbandbarex3.php":3444208197,"Examples\/examples_staticband\/smallstaticbandsex6.php":1863626661,"Examples\/examples_staticband\/smallstaticbandsex9.php":4119417726,"Examples\/examples_staticband\/smallstaticbandsex7.php":3798958567,"Examples\/examples_staticband\/smallstaticbandsex10.php":3686963739,"Examples\/examples_staticband\/staticbandbarex5.php":3363116429,"Examples\/examples_staticband\/smallstaticbandsex5.php":188485656,"Examples\/examples_staticband\/smallstaticbandsex8.php":47341234,"Examples\/examples_staticband\/staticbandbarex7.php":2696472814,"Examples\/examples_staticband\/smallstaticbandsex4.php":3957622709,"Examples\/examples_staticband\/staticbandbarex2.php":3094921916,"Examples\/examples_staticband\/smallstaticbandsex1.php":2502316746,"Examples\/examples_staticband\/smallstaticbandsex2.php":3260513358,"Examples\/examples_staticband\/smallstaticbandsex3.php":1623869243,"Examples\/examples_staticband\/staticbandbarex6.php":468627645,"Examples\/examples_staticband\/smallstaticbandsex11.php":3686963739,"Examples\/example_list.php":2426909901,"Examples\/new_step1.php":3941253578,"Examples\/examples_date\/datescaleticksex01.php":251848426,"Examples\/examples_date\/dateaxisex1.php":3029450210,"Examples\/examples_date\/dateaxisex3.php":3897228751,"Examples\/examples_date\/dateaxisex4.php":1966174124,"Examples\/examples_date\/dateutilex01.php":2881102358,"Examples\/examples_date\/dateaxisex2.php":1226720100,"Examples\/examples_date\/dateutilex02.php":2676681924,"Examples\/examples_date\/prepaccdata_example.php":3217171289,"Examples\/listfontsex1.php":554142333,"Examples\/colormaps.php":2755782388,"Examples\/examples_line\/gradlinefillex1.php":2620911653,"Examples\/examples_line\/filledgridex1.php":1237207855,"Examples\/examples_line\/linebarex3.php":1659993081,"Examples\/examples_line\/clipping_ex1.php":3009890800,"Examples\/examples_line\/linebarex2.php":194916088,"Examples\/examples_line\/lineimagefillex1.php":3401842299,"Examples\/examples_line\/manscaleex1.php":85037592,"Examples\/examples_line\/filledstepstyleex1.php":3512616519,"Examples\/examples_line\/centeredlineex01.php":3039037006,"Examples\/examples_line\/gradlinefillex3.php":3307293832,"Examples\/examples_line\/funcex2.php":3417639798,"Examples\/examples_line\/builtinplotmarksex1.php":1015401645,"Examples\/examples_line\/no_test_lineiconex2.php":2205950351,"Examples\/examples_line\/linlogex1.php":1764786628,"Examples\/examples_line\/linegraceex.php":2901569442,"Examples\/examples_line\/titleex1.php":2579971906,"Examples\/examples_line\/y2synch2.php":2338214124,"Examples\/examples_line\/no_test_new_line5.php":1362363069,"Examples\/examples_line\/no_dim_plotlineex1.php":2726889594,"Examples\/examples_line\/manscaleex4.php":2070520373,"Examples\/examples_line\/filledline01.php":2898052118,"Examples\/examples_line\/filledlineex01.1.php":1503982005,"Examples\/examples_line\/staticlinebarex1.php":3790771081,"Examples\/examples_line\/no_test_new_line4.php":4001000423,"Examples\/examples_line\/filledlineex03.php":1344006057,"Examples\/examples_line\/manscaleex3.php":299467349,"Examples\/examples_line\/filledlineex01.php":2910439161,"Examples\/examples_line\/new_line3.php":3765582955,"Examples\/examples_line\/no_test_new_line1.php":290807618,"Examples\/examples_line\/funcex3.php":1772328869,"Examples\/examples_line\/y2synch.php":2458932049,"Examples\/examples_line\/no_test_lineiconex1.php":2188757476,"Examples\/examples_line\/centerlinebarex1.php":1514772066,"Examples\/examples_line\/gradlinefillex4.php":1569038092,"Examples\/examples_line\/funcex1.php":838756433,"Examples\/examples_line\/interpolation-growth.php":3887353342,"Examples\/examples_line\/gradlinefillex2.php":3193560947,"Examples\/examples_line\/interpolation-growth-log.php":4017084893,"Examples\/examples_line\/funcex4.php":3510597340,"Examples\/examples_line\/gradbkgex1.php":2144794295,"Examples\/examples_line\/manscaleex2.php":3243711275,"Examples\/examples_line\/timestampex01.php":2357749761,"Examples\/examples_line\/clipping_ex2.php":4145754298,"Examples\/examples_line\/centeredlineex03.php":1195080683,"Examples\/examples_line\/centeredlineex02.php":2842188343,"Examples\/examples_line\/partiallyfilledlineex1.php":850863102,"Examples\/examples_line\/filledlineex02.php":4178104613,"Examples\/examples_line\/no_test_new_line2.php":1896385918,"Examples\/examples_line\/linebarex1.php":4281212603,"Examples\/examples_line\/linebarcentex1.php":1700437391,"Examples\/examples_line\/nullvalueex01.php":781718998,"Examples\/examples_line\/splineex1.php":4236034499,"Examples\/examples_line\/tabtitleex1.php":1182762629,"Examples\/examples_line\/no_test_new_step1.php":2674237061,"Examples\/examples_multigraph\/no_test_combgraphex2.php":1294378824,"Examples\/examples_multigraph\/no_test_comb90dategraphex01.php":2865873836,"Examples\/examples_multigraph\/no_test_combgraphex1.php":34254009,"Examples\/examples_multigraph\/no_test_comb90dategraphex02.php":3161324291,"Examples\/examples_multigraph\/no_test_comb90dategraphex03.php":3276589437,"Examples\/examples_sunspot\/no_test_sunspotsex3.php":4144274901,"Examples\/examples_sunspot\/no_test_sunspotsex1.php":3292199752,"Examples\/examples_sunspot\/no_test_sunspotsex6.php":1099877817,"Examples\/examples_sunspot\/no_test_sunspotsex5.php":2955703050,"Examples\/examples_sunspot\/no_test_sunspotsex4.php":1870331008,"Examples\/examples_sunspot\/no_test_sunspotsex7.php":3084068433,"Examples\/examples_sunspot\/no_test_sunspotsex2.php":123785609,"Examples\/y2synch.php":4204734912,"Examples\/examples_gantt\/ganttex01.php":1215082372,"Examples\/examples_gantt\/gantt_samerowex2.php":3547364152,"Examples\/examples_gantt\/gantt_samerowex1.php":1991848820,"Examples\/examples_gantt\/ganttex07.php":1146745962,"Examples\/examples_gantt\/ganttex11.php":4125242244,"Examples\/examples_gantt\/gantt_textex1.php":1671807939,"Examples\/examples_gantt\/ganttmonthyearex3.php":1129244055,"Examples\/examples_gantt\/ganttconstrainex1.php":915603396,"Examples\/examples_gantt\/gantticonex1.php":3218745056,"Examples\/examples_gantt\/ganttcolumnfontsex01.php":949340152,"Examples\/examples_gantt\/gantthgridex1.php":1587702732,"Examples\/examples_gantt\/ganttex00.php":3476314331,"Examples\/examples_gantt\/ganttmonthyearex1.php":770053665,"Examples\/examples_gantt\/ganttex10.php":2834674357,"Examples\/examples_gantt\/ganttex17.php":2652571129,"Examples\/examples_gantt\/ganttex02.php":2657257655,"Examples\/examples_gantt\/ganttex13-zoom1.php":2509472462,"Examples\/examples_gantt\/ganttex17-flag.php":1169505813,"Examples\/examples_gantt\/ganttex14.php":1428475399,"Examples\/examples_gantt\/ganttex09.php":59319143,"Examples\/examples_gantt\/ganttex13.php":1121934547,"Examples\/examples_gantt\/ganttmonthyearex2.php":1203926037,"Examples\/examples_gantt\/gantthourex1.php":3086091131,"Examples\/examples_gantt\/ganttex_slice.php":4049850033,"Examples\/examples_gantt\/ganttsimpleex1.php":3629417136,"Examples\/examples_gantt\/ganttmonthyearex4.php":2586297529,"Examples\/examples_gantt\/ganttex03.php":1919959434,"Examples\/examples_gantt\/multconstganttex01.php":3477867887,"Examples\/examples_gantt\/ganttex08.php":491255859,"Examples\/examples_gantt\/no_test_ganttex19.php":832935409,"Examples\/examples_gantt\/ganttex30.php":3947180964,"Examples\/examples_gantt\/ganttex04.php":2356731932,"Examples\/examples_gantt\/ganttconstrainex0.php":1561681810,"Examples\/examples_gantt\/ganttex06.php":3930478555,"Examples\/examples_gantt\/ganttex12.php":2296639315,"Examples\/examples_gantt\/ganttex16.php":1149798780,"Examples\/examples_gantt\/ganttex05.php":3407828967,"Examples\/examples_gantt\/ganttex18.php":2945856519,"Examples\/examples_gantt\/ganttconstrainex2.php":502859377,"Examples\/examples_gantt\/ganttex15.php":3944333095,"Examples\/examples_gantt\/ganttex13-zoom2.php":679673189,"Examples\/examples_gantt\/gantthourminex1.php":3041566538,"Examples\/examples_theme\/no_test_fusion_example.php":1477970693,"Examples\/examples_theme\/no_test_theme_example.php":2785919712,"Examples\/examples_theme\/no_test_orange_example.php":3113965687,"Examples\/examples_theme\/no_test_vivid_example.php":4235378347,"Examples\/examples_theme\/no_test_pastel_example.php":803381419,"Examples\/examples_theme\/aqua_example.php":2857346087,"Examples\/examples_theme\/no_test_green_example.php":1958621456,"Examples\/examples_theme\/no_test_rose_example.php":3990444150,"Examples\/examples_theme\/no_test_softy_example.php":1097792985,"Examples\/examples_theme\/no_test_ocean_example.php":1714207412,"Examples\/examples_theme\/no_test_universal_example.php":3060474503,"Examples\/examples_pdf\/no_test_pdf417_ex3.php":1069248813,"Examples\/examples_pdf\/no_test_pdf417_ex0.php":333747031,"Examples\/examples_pdf\/no_test_pdf417_ex4.php":834847587,"Examples\/examples_pdf\/no_test_pdf417_ex6.php":3846353109,"Examples\/examples_pdf\/no_test_pdf417_ex1b.php":1926751413,"Examples\/examples_pdf\/no_test_pdf417_ex5.php":2069768443,"Examples\/examples_pdf\/no_test_pdf417_ex1.php":3910677207,"Examples\/examples_pdf\/no_test_pdf417_ex2.php":2258539167,"Examples\/examples_pdf\/no_test_pdf417_ex1c.php":1311437441,"Examples\/interpolation-growth.php":4227358013,"Examples\/examples_polar\/no_test_polarex1.php":3476832700,"Examples\/examples_polar\/no_test_polarex5.php":583473751,"Examples\/examples_polar\/no_test_polarex7-2.php":3025931135,"Examples\/examples_polar\/no_test_polarex0-180.php":2993891107,"Examples\/examples_polar\/no_test_polarex8.php":308783839,"Examples\/examples_polar\/no_test_polarex2.php":93198711,"Examples\/examples_polar\/no_test_polarex0.php":2611117867,"Examples\/examples_polar\/no_test_polarex6.php":3315399034,"Examples\/examples_polar\/no_test_polarex9.php":2014144154,"Examples\/examples_polar\/no_test_polarclockex2.php":4074280339,"Examples\/examples_polar\/no_test_polarex3.php":2905286776,"Examples\/examples_polar\/no_test_polarclockex1.php":3799449392,"Examples\/examples_polar\/no_test_polarex10.php":1738236400,"Examples\/examples_polar\/no_test_polarex7.php":2330213927,"Examples\/examples_polar\/no_test_polarex3-lin.php":2101040885,"Examples\/examples_polar\/no_test_polarex4.php":1183421867,"Examples\/examples_polar\/no_test_polarex7-1.php":3007685459,"Examples\/interpolation-growth-log.php":2960029069,"Examples\/multconstganttex01.php":4029135318,"Examples\/defined_constants.php":1337884041,"Examples\/titlecsimex01.php":2480049148,"Examples\/gradbkgex1.php":1577152449,"Examples\/examples_canvas\/no_test_mkgrad.php":1269100105,"Examples\/examples_canvas\/canvasex06.php":3234870902,"Examples\/examples_canvas\/no_test_listfontsex1.php":1789332094,"Examples\/examples_canvas\/no_test_colormaps.php":2755782388,"Examples\/examples_canvas\/no_dim_canvasex04.php":398431560,"Examples\/examples_canvas\/no_test_text-example2.php":979869200,"Examples\/examples_canvas\/no_test_textalignex1.php":834689966,"Examples\/examples_canvas\/canvaspiralex1.php":3886284819,"Examples\/examples_canvas\/no_dim_canvasex02.php":974801682,"Examples\/examples_canvas\/no_dim_canvas_jpgarchex.php":3574240344,"Examples\/examples_canvas\/no_dim_canvasex01.php":720063450,"Examples\/examples_canvas\/canvasbezierex1.php":803763363,"Examples\/examples_canvas\/no_dim_canvasex03.php":1516717114,"Examples\/examples_canvas\/no_test_textpalignex1.php":299956668,"Examples\/examples_canvas\/canvasex05.php":163447943,"Examples\/examples_canvas\/no_test_text-example1.php":3085755642,"Examples\/examples_tick\/no_test_manualtickex1a.php":4137788383,"Examples\/examples_tick\/manualtickex2.php":4280833958,"Examples\/examples_tick\/manualtickex4.php":1713343115,"Examples\/examples_tick\/manualtickex3.php":124771253,"Examples\/examples_tick\/no_test_manualtickex1.php":4137788383,"Examples\/antispamex01.php":1598694200,"Examples\/dataset01.inc.php":2020456451,"Examples\/examples_pie\/pielabelsex2.php":1138740966,"Examples\/examples_pie\/pieex5.php":817796906,"Examples\/examples_pie\/pie3dex5.php":2980736342,"Examples\/examples_pie\/new_pie4.php":3963717405,"Examples\/examples_pie\/no_dim_piecex1.php":4093686262,"Examples\/examples_pie\/pieex2.php":846884926,"Examples\/examples_pie\/pie3dex1.php":1685554085,"Examples\/examples_pie\/pielabelsex1.php":859228868,"Examples\/examples_pie\/pieex8.php":331280339,"Examples\/examples_pie\/pieex1.php":170067650,"Examples\/examples_pie\/pieex9.php":375920002,"Examples\/examples_pie\/pie3dex3.php":1239584783,"Examples\/examples_pie\/no_test_new_pie2.php":1111064030,"Examples\/examples_pie\/pieex4.php":3691984784,"Examples\/examples_pie\/pie3dex2.php":2981977779,"Examples\/examples_pie\/no_test_new_pie3.php":4181096205,"Examples\/examples_pie\/pieex3.php":3188672769,"Examples\/examples_pie\/pie3dex4.php":1525666052,"Examples\/examples_pie\/new_pie1.php":3304509446,"Examples\/examples_pie\/no_dim_piebkgex1.php":4141445591,"Examples\/examples_pie\/pieex6.php":4207985019,"Examples\/examples_pie\/pielabelsex3.php":1054401861,"Examples\/examples_pie\/pieex7.php":942313430,"Examples\/examples_pie\/no_dim_piecex2.php":2682864962,"Examples\/examples_pie\/pielabelsex4.php":1892376045,"Examples\/examples_pie\/pielabelsex5.php":155046889,"Examples\/show-source.php":2412100822,"Examples\/listallflags_helper.php":2688594178,"Examples\/examples_windrose\/windrose_ex2.php":722786444,"Examples\/examples_windrose\/no_test_windrose_icon_ex1.php":2088692380,"Examples\/examples_windrose\/windrose_bgimg_ex1.php":3636282378,"Examples\/examples_windrose\/windrose_ex3.php":2872135782,"Examples\/examples_windrose\/windrose_ex6.php":720746251,"Examples\/examples_windrose\/no_test_windrose_layout_ex1.php":2990842050,"Examples\/examples_windrose\/no_test_windrose_ex9.1.php":2830761834,"Examples\/examples_windrose\/windrose_ex1.php":1752604901,"Examples\/examples_windrose\/windrose_2plots_ex1.php":1879069593,"Examples\/examples_windrose\/windrose_ex8.php":2412780810,"Examples\/examples_windrose\/windrose_ex9.php":2625093990,"Examples\/examples_windrose\/windrose_ex6.1.php":2657425307,"Examples\/examples_windrose\/no_test_windrose_layout_ex0.php":3669510874,"Examples\/examples_windrose\/windrose_ex1b.php":655064535,"Examples\/examples_windrose\/no_test_windrose_ex5.php":3364912621,"Examples\/examples_windrose\/windrose_ex8.1.php":845526938,"Examples\/examples_windrose\/windrose_ex2.1.php":3136712271,"Examples\/examples_windrose\/windrose_ex0.php":1603376337,"Examples\/examples_windrose\/windrose_ex7.php":203682587,"Examples\/examples_windrose\/windrose_ex4.php":3041752281,"Examples\/examples_windrose\/windrose_ex7.1.php":4257301809,"Examples\/examples_scatter\/no_dim_balloonex2.php":2819914204,"Examples\/examples_scatter\/scatterlinkex2.php":1060656785,"Examples\/examples_scatter\/pushpinex1.php":3070496879,"Examples\/examples_scatter\/no_dim_balloonex1.php":898702682,"Examples\/examples_scatter\/ccbp_ex2.php":1650545822,"Examples\/examples_scatter\/footerex1.php":2734747829,"Examples\/examples_scatter\/impulsex3.php":4053599913,"Examples\/examples_scatter\/pushpinex2.php":2212152005,"Examples\/examples_scatter\/scatterex1.php":377777085,"Examples\/examples_scatter\/fieldscatterex1.php":3913986420,"Examples\/examples_scatter\/scatterrotex1.php":742609488,"Examples\/examples_scatter\/scatterlinkex3.php":3981757883,"Examples\/examples_scatter\/ccbp_ex1.php":3303516134,"Examples\/examples_scatter\/markflagex1.php":3219720758,"Examples\/examples_scatter\/loglogex1.php":3917303968,"Examples\/examples_scatter\/impulsex4.php":649442265,"Examples\/examples_scatter\/scatterlinkex4.php":929654985,"Examples\/examples_scatter\/scatterlinkex1.php":2566955766,"Examples\/examples_scatter\/impulsex1.php":130717718,"Examples\/examples_scatter\/impulsex2.php":1612910437,"Examples\/examples_scatter\/bezierex1.php":3074016665,"Examples\/examples_scatter\/scatterex2.php":2225151047,"Examples\/csim_in_html_ex1.php":1023854077,"Examples\/timestampex01.php":1608271147,"Examples\/testsuit.php":2451475634,"Examples\/examples_contour\/no_test_contour2_ex2.php":777638497,"Examples\/examples_contour\/no_test_contour2_ex1.php":3185786246,"Examples\/examples_contour\/no_test_contour2_ex6.php":2128003828,"Examples\/examples_contour\/basic_contourex04.php":1882550663,"Examples\/examples_contour\/basic_contourex01.php":3268206595,"Examples\/examples_contour\/contourex04.php":3469034161,"Examples\/examples_contour\/no_test_contour2_ex5.php":1955182297,"Examples\/examples_contour\/contourex01.php":4111843231,"Examples\/examples_contour\/no_test_contour2_ex7.php":3418669271,"Examples\/examples_contour\/basic_contourex02.php":1597197162,"Examples\/examples_contour\/no_test_contour2_ex4.php":1704148736,"Examples\/examples_contour\/basic_contourex03-2.php":3565467737,"Examples\/examples_contour\/basic_contourex05.php":3789439518,"Examples\/examples_contour\/contourex02.php":2289658920,"Examples\/examples_contour\/contourex05.php":3156278295,"Examples\/examples_contour\/basic_contourex03-1.php":1555920127,"Examples\/examples_contour\/contourex03.php":2025621558,"Examples\/examples_contour\/basic_contourex03-3.php":801494087,"Examples\/examples_contour\/no_test_contour2_ex3.php":841643900,"Examples\/csim_in_html_graph_ex2.php":84265148,"Examples\/examples_general\/example10.php":3605084193,"Examples\/examples_general\/example26.1.php":1110054587,"Examples\/examples_general\/example27.2.php":1803999579,"Examples\/examples_general\/example3.0.2.php":2932540835,"Examples\/examples_general\/example2.1.php":2080038067,"Examples\/examples_general\/example16.1.php":4111975384,"Examples\/examples_general\/example6.1.php":189714940,"Examples\/examples_general\/example15.php":550626648,"Examples\/examples_general\/example17.php":3765642027,"Examples\/examples_general\/example11.php":2685914773,"Examples\/examples_general\/example2.5.php":894204589,"Examples\/examples_general\/example4.php":3400746439,"Examples\/examples_general\/example2.php":930695723,"Examples\/examples_general\/example3.1.1.php":1252058528,"Examples\/examples_general\/example14.php":2601405424,"Examples\/examples_general\/example28.1.php":4144963577,"Examples\/examples_general\/example8.php":3124716901,"Examples\/examples_general\/example27.3.php":3052046577,"Examples\/examples_general\/example3.2.1.php":4022022753,"Examples\/examples_general\/example16.6.php":3585447504,"Examples\/examples_general\/example3.php":442667314,"Examples\/examples_general\/example6.2.php":2064598227,"Examples\/examples_general\/example3.0.3.php":1686410268,"Examples\/examples_general\/example1.2.php":1990990000,"Examples\/examples_general\/example5.1.php":2771834842,"Examples\/examples_general\/example28.3.php":2969799324,"Examples\/examples_general\/example9.1.php":17918131,"Examples\/examples_general\/example28.php":130300580,"Examples\/examples_general\/example1.php":2157549833,"Examples\/examples_general\/example3.4.php":2195603465,"Examples\/examples_general\/example8.1.php":186060499,"Examples\/examples_general\/example0.php":2831626515,"Examples\/examples_general\/example13.php":37110442,"Examples\/examples_general\/example1.1.php":3511124089,"Examples\/examples_general\/example9.php":2147118250,"Examples\/examples_general\/example6.php":3282181510,"Examples\/examples_general\/example3.2.php":1447071124,"Examples\/examples_general\/example27.1.php":1429093581,"Examples\/examples_general\/example0-0.php":2066946568,"Examples\/examples_general\/example3.1.php":4021802656,"Examples\/examples_general\/example7.php":4045065990,"Examples\/examples_general\/example27.php":2261669287,"Examples\/examples_general\/example3.4.1.php":2219067548,"Examples\/examples_general\/exampleex9.php":1594721471,"Examples\/examples_general\/example5.php":1502876208,"Examples\/examples_general\/example28.2.php":2860494426,"Examples\/examples_general\/example26.php":1441475455,"Examples\/examples_general\/example9.2.php":1377208584,"Examples\/examples_general\/example16.php":3996629462,"Examples\/examples_general\/example3.0.1.php":3278904186,"Examples\/examples_general\/example2.6.php":4004128745,"Examples\/examples_general\/example3.2.2.php":4073282684,"Examples\/examples_general\/example3.3.php":2313044045,"Examples\/assets\/dataset01.inc.php":2020456451,"Examples\/csim_in_html_graph_ex1.php":3041610065,"Examples\/examples_background\/background_type_ex2.php":3597061857,"Examples\/examples_background\/backgroundex02.php":530500674,"Examples\/examples_background\/background_type_ex4.php":3440987253,"Examples\/examples_background\/background_type_ex3.php":1071989076,"Examples\/examples_background\/backgroundex03.php":323890316,"Examples\/examples_background\/background_type_ex1.php":947090104,"Examples\/examples_background\/background_type_ex0.php":274211385,"Examples\/examples_background\/backgroundex01.php":2842538680,"Examples\/examples_stock\/no_test_boxstockex2.php":1038191341,"Examples\/examples_stock\/no_test_stockex1.php":1463289409,"Examples\/examples_stock\/no_test_stockex2.php":2104809252,"Examples\/examples_stock\/no_test_boxstockex1.php":3196081499,"Examples\/nullvalueex01.php":490215382,"Examples\/examples_csim\/mulyaxiscsimex1.php":859126986,"Examples\/examples_csim\/csim_in_html_ex2.php":308665523,"Examples\/examples_csim\/scatter_csimex1.php":3605667389,"Examples\/examples_csim\/pie_csimex1.php":2521371828,"Examples\/examples_csim\/barcsim_details_omit.php":150148336,"Examples\/examples_csim\/barline_csimex1.php":1792710276,"Examples\/examples_csim\/no_test_tableex01_csim.php":3236381968,"Examples\/examples_csim\/no_test_ganttcsimex02.php":1021871128,"Examples\/examples_csim\/bar_csimex3.php":1393937049,"Examples\/examples_csim\/no_test_matrix_csimex01.php":3873151991,"Examples\/examples_csim\/no_test_tablebarex1_csim.php":500557947,"Examples\/examples_csim\/bar_csimex1.php":3056759717,"Examples\/examples_csim\/barlinefreq_csimex1.php":1951608013,"Examples\/examples_csim\/titlecsimex01.php":3482411650,"Examples\/examples_csim\/no_test_polar_csimex1.php":3028181567,"Examples\/examples_csim\/csim_in_html_ex1.php":1023854077,"Examples\/examples_csim\/no_test_radar_csimex1.php":3313163807,"Examples\/examples_csim\/no_test_piec_csimex1.php":3620803832,"Examples\/examples_csim\/no_test_ganttcsimex01.php":1485064227,"Examples\/examples_csim\/csim_in_html_graph_ex2.php":3342568144,"Examples\/examples_csim\/bar_csimex2.php":1224026938,"Examples\/examples_csim\/csim_in_html_graph_ex1.php":3192174498,"Examples\/examples_csim\/imgmarkercsimex1.php":76274080,"Examples\/examples_csim\/barcsim_popup.php":2977205185,"Examples\/examples_csim\/pie3d_csimex1.php":3902599551,"Examples\/examples_csim\/no_test_boxstockcsimex1.php":1615786675,"Examples\/examples_bar\/no_dim_horizbarex6.php":4281058342,"Examples\/examples_bar\/plotbanddensity_ex2.php":2724966724,"Examples\/examples_bar\/example20.5.php":4283182421,"Examples\/examples_bar\/example18.php":2589998003,"Examples\/examples_bar\/barimg1.php":1695995693,"Examples\/examples_bar\/barlinealphaex1.php":3531744531,"Examples\/examples_bar\/no_test_new_bar4.php":267332694,"Examples\/examples_bar\/accbarframeex01.php":4218945349,"Examples\/examples_bar\/groupbar1.php":2850564231,"Examples\/examples_bar\/manual_textscale_ex3.php":2053521905,"Examples\/examples_bar\/plotbanddensity_ex1.php":3872796579,"Examples\/examples_bar\/example20.4.php":1593622196,"Examples\/examples_bar\/manual_textscale_ex2.php":583127958,"Examples\/examples_bar\/no_dim_bartutex5.php":531001653,"Examples\/examples_bar\/bargradsmallex2.php":4036272169,"Examples\/examples_bar\/example16.2.php":739861846,"Examples\/examples_bar\/barscalecallback1.php":4169911871,"Examples\/examples_bar\/example21.php":2885636790,"Examples\/examples_bar\/barint2.php":787676210,"Examples\/examples_bar\/bargradsmallex4.php":4029637921,"Examples\/examples_bar\/bargradsmallex1.php":3077005220,"Examples\/examples_bar\/example25.php":3514703073,"Examples\/examples_bar\/example25.2.php":2572856146,"Examples\/examples_bar\/accbarex1.php":4273822482,"Examples\/examples_bar\/no_dim_grace_ex0.php":1285183608,"Examples\/examples_bar\/alphabar.php":2727084363,"Examples\/examples_bar\/bargradex2.php":619163370,"Examples\/examples_bar\/bargradsmallex5.php":874912562,"Examples\/examples_bar\/bartutex12.php":2268487716,"Examples\/examples_bar\/bartutex1.php":3120234593,"Examples\/examples_bar\/example16.4.php":3471832280,"Examples\/examples_bar\/no_dim_grace_ex3.php":1344888519,"Examples\/examples_bar\/no_dim_bartutex6.php":998457972,"Examples\/examples_bar\/no_dim_horizbarex2.php":1620506080,"Examples\/examples_bar\/example25.1.php":1187219793,"Examples\/examples_bar\/bargradsmallex3.php":709676326,"Examples\/examples_bar\/example20.2.php":2996130725,"Examples\/examples_bar\/bargradex1.php":673433303,"Examples\/examples_bar\/no_test_new_bar6.php":2329583222,"Examples\/examples_bar\/example24.php":4069839189,"Examples\/examples_bar\/barlinefreqex1.php":1579119390,"Examples\/examples_bar\/negbarvalueex01.php":620861965,"Examples\/examples_bar\/no_dim_logbarex1.php":1369665623,"Examples\/examples_bar\/bargradex5.php":613224969,"Examples\/examples_bar\/example20.php":3445898131,"Examples\/examples_bar\/example19.1.php":1500220585,"Examples\/examples_bar\/horizbarex4.php":469018933,"Examples\/examples_bar\/example22.php":1954784550,"Examples\/examples_bar\/barint1.php":3107457505,"Examples\/examples_bar\/example19.php":3491736028,"Examples\/examples_bar\/example16.5.php":3410546084,"Examples\/examples_bar\/bargradex6.php":2040242625,"Examples\/examples_bar\/new_bar3.php":255967884,"Examples\/examples_bar\/bargradex3.php":988195439,"Examples\/examples_bar\/bartut4.php":2658355420,"Examples\/examples_bar\/plotbanddensity_ex0.php":3567323455,"Examples\/examples_bar\/accbarframeex02.php":755924279,"Examples\/examples_bar\/no_dim_horizbarex3.php":666280243,"Examples\/examples_bar\/bargradsmallex8.php":2228730475,"Examples\/examples_bar\/barformatcallbackex1.php":2280534859,"Examples\/examples_bar\/no_dim_horizbarex1.php":2738179777,"Examples\/examples_bar\/bargradsmallex7.php":4096612819,"Examples\/examples_bar\/example16.3.php":1804648743,"Examples\/examples_bar\/example20.3.php":4016924449,"Examples\/examples_bar\/bargradex4.php":2206227269,"Examples\/examples_bar\/bartut2.php":3591510693,"Examples\/examples_bar\/no_dim_manual_textscale_ex1.php":479271997,"Examples\/examples_bar\/example20.1.php":2166797334,"Examples\/examples_bar\/no_dim_grace_ex2.php":3871239530,"Examples\/examples_bar\/no_test_new_bar1.php":2261160551,"Examples\/examples_bar\/manual_textscale_ex4.php":675896381,"Examples\/examples_bar\/bar2scalesex1.php":3921743753,"Examples\/examples_bar\/barpatternex1.php":67093787,"Examples\/examples_bar\/bargradsmallex6.php":2116615247,"Examples\/examples_bar\/bartut3.php":739192445,"Examples\/examples_bar\/example23.php":1090983928,"Examples\/examples_bar\/accbarframeex03.php":4146517148,"Examples\/examples_bar\/no_dim_grace_ex1.php":3020275855,"Examples\/prepaccdata_example.php":3678466055,"Examples\/tabtitleex1.php":818574203,"src\/util\/ColorFactory.php":1052826095,"src\/util\/ReadFileData.php":4049970401,"src\/util\/FuncGenerator.php":3927321571,"src\/util\/Rectangle.php":4280331924,"src\/util\/JpGraphError.php":3155162120,"src\/util\/LinearRegression.php":885847148,"src\/util\/ErrMsgText.php":1668802218,"src\/util\/Constants.php":2814181351,"src\/util\/Helper.php":2354442648,"src\/util\/JpGraphException.php":424501896,"src\/util\/FlagCache.php":3652676929,"src\/util\/Bezier.php":1038694385,"src\/util\/GanttConstraint.php":3624780959,"src\/util\/Spline.php":411438215,"src\/util\/DateLocale.php":657794205,"src\/util\/JpgTimer.php":375733437,"src\/image\/Progress.php":280698706,"src\/image\/HandDigits.php":666372080,"src\/image\/LinkArrow.php":1392962961,"src\/image\/PredefIcons.php":3123717380,"src\/image\/Footer.php":502393418,"src\/image\/ImgStreamCache.php":3787815454,"src\/image\/AntiSpam.php":2651515839,"src\/image\/ImgTrans.php":1106362479,"src\/image\/FieldArrow.php":1666341488,"src\/image\/GanttLink.php":1476270323,"src\/image\/Constants.php":2529609421,"src\/image\/ImgData_PushPins.php":186565683,"src\/image\/RGB.php":44695606,"src\/image\/ImgData_Bevels.php":3609057848,"src\/image\/ImgData_Squares.php":829805429,"src\/image\/IconImage.php":3232973281,"src\/image\/ImgData_Diamonds.php":1737199804,"src\/image\/ImgData_Balls.php":2217751931,"src\/image\/RotImage.php":41572398,"src\/image\/ImgData.php":2031485240,"src\/image\/ImgData_Stars.php":1122775794,"src\/image\/DigitalLED74.php":338923329,"src\/image\/Image.php":3960445376,"src\/image\/FlagImages.php":4202921449,"src\/plot\/ContourPlot.php":769551566,"src\/plot\/RadarPlot.php":3150747146,"src\/plot\/GanttPlotObject.php":678845078,"src\/plot\/AccLinePlot.php":2182914435,"src\/plot\/WindrosePlot.php":2167860690,"src\/plot\/PiePlot.php":3821724407,"src\/plot\/IconPlot.php":3043526833,"src\/plot\/PolarPlot.php":3031217819,"src\/plot\/GroupBarPlot.php":2798316978,"src\/plot\/Contour.php":1091908839,"src\/plot\/DisplayValue.php":3116657967,"src\/plot\/FieldPlot.php":2831449332,"src\/plot\/PlotBand.php":420231876,"src\/plot\/PlotMark.php":2388818461,"src\/plot\/LinePlot.php":1805444293,"src\/plot\/GanttVLine.php":3094051652,"src\/plot\/PlotLine.php":1776900896,"src\/plot\/Constants.php":2425811817,"src\/plot\/ErrorLinePlot.php":3301151053,"src\/plot\/LegendStyle.php":371061796,"src\/plot\/ErrorPlot.php":268766954,"src\/plot\/StockPlot.php":1915748396,"src\/plot\/MileStone.php":4249556177,"src\/plot\/ScatterPlot.php":4266365175,"src\/plot\/AccBarPlot.php":3149444717,"src\/plot\/Plot.php":692455097,"src\/plot\/LineErrorPlot.php":1849425615,"src\/plot\/BoxPlot.php":2281446906,"src\/plot\/GanttBar.php":1689065280,"src\/plot\/BarPlot.php":737038656,"src\/plot\/Gradient.php":509382830,"src\/plot\/PiePlotC.php":2529366385,"src\/plot\/PiePlot3D.php":4193440338,"src\/plot\/MeshInterpolate.php":2837018689,"src\/unused\/DateScaleUtils.php":3785118471,"src\/graph\/GanttActivityInfo.php":3722020196,"src\/graph\/PolarAxis.php":4274578971,"src\/graph\/PolarScale.php":2713178952,"src\/graph\/MGraph.php":504022627,"src\/graph\/LinearTicks.php":953370111,"src\/graph\/RadarLogTicks.php":4071570835,"src\/graph\/WindrosePlotScale.php":476068710,"src\/graph\/Ticks.php":3164348343,"src\/graph\/Grid.php":1302300759,"src\/graph\/RectPatternDiagCross.php":1846729938,"src\/graph\/RectPatternVert.php":3843120523,"src\/graph\/Rectangle.php":890893736,"src\/graph\/HeaderProperty.php":459056962,"src\/graph\/CanvasScale.php":1075692189,"src\/graph\/LogTicks.php":3746450377,"src\/graph\/RadarGraph.php":2158319271,"src\/graph\/LineProperty.php":2785330486,"src\/graph\/RadarAxis.php":2960126205,"src\/graph\/Axis.php":2746556504,"src\/graph\/RectPatternHor.php":1720196803,"src\/graph\/Constants.php":2718037565,"src\/graph\/DateScale.php":810002221,"src\/graph\/PieGraph.php":2172843589,"src\/graph\/RectPatternFactory.php":3111399812,"src\/graph\/PolarGraph.php":1684233987,"src\/graph\/WindroseGraph.php":4016230360,"src\/graph\/RectPattern3DPlane.php":3762076780,"src\/graph\/RectPattern.php":4216970862,"src\/graph\/CCBPGraph.php":260271937,"src\/graph\/SymChar.php":3304748193,"src\/graph\/RadarLinearTicks.php":831007843,"src\/graph\/PolarLogScale.php":2212804544,"src\/graph\/RectPatternRDiag.php":3874896272,"src\/graph\/Shape.php":3180938425,"src\/graph\/LogScale.php":3127907477,"src\/graph\/RectPatternLDiag.php":3910455513,"src\/graph\/GanttScale.php":3551884072,"src\/graph\/AxisPrototype.php":3587289459,"src\/graph\/Legend.php":922178998,"src\/graph\/RadarGrid.php":3017867721,"src\/graph\/HorizontalGridLine.php":560195002,"src\/graph\/GanttGraph.php":3478769082,"src\/graph\/RectPatternCross.php":578882587,"src\/graph\/LinearScale.php":2730172715,"src\/graph\/Graph.php":180064554,"src\/graph\/CanvasGraph.php":3683639043,"src\/graph\/RectPatternSolid.php":1791400224,"src\/config.inc.php":2481474141,"src\/lang\/en.inc.php":312931806,"src\/lang\/de.inc.php":479657751,"src\/lang\/prod.inc.php":4252430346,"src\/themes\/OceanTheme.php":2857323119,"src\/themes\/SoftyTheme.php":613804062,"src\/themes\/GreenTheme.php":147329564,"src\/themes\/Theme.php":1000912975,"src\/themes\/OrangeTheme.php":3603867561,"src\/themes\/AquaTheme.php":2968107384,"src\/themes\/RoseTheme.php":1911953556,"src\/themes\/PastelTheme.php":3733019998,"src\/themes\/UniversalTheme.php":55712916,"src\/themes\/VividTheme.php":3825538192,"src\/includes\/polyfills.php":2638163207,"src\/includes\/_font.constants.php":1068117750,"src\/includes\/_general.constants.php":4239026716,"src\/includes\/all_constants.php":76481714,"src\/includes\/_cache.constants.php":1905219645,"src\/includes\/_format.constants.php":1307015972,"src\/text\/CanvasRectangleText.php":2498730544,"src\/text\/SuperScriptText.php":97491044,"src\/text\/GTextTable.php":3842679379,"src\/text\/GraphTabTitle.php":2073973059,"src\/text\/LanguageConv.php":938304366,"src\/text\/Constants.php":3709973571,"src\/text\/TTF.php":1003664220,"src\/text\/TextPropertyBelow.php":3000650346,"src\/text\/TextProperty.php":2796195837,"src\/text\/GTextTableCell.php":2864120085,"src\/text\/Text.php":4291034488}} \ No newline at end of file diff --git a/.php_cs.php b/.php_cs.php index e0769a63..bf17f560 100644 --- a/.php_cs.php +++ b/.php_cs.php @@ -12,7 +12,7 @@ $version = $composerinfo->extra->version; $header = "JPGraph - Community Edition"; -$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php73($header), [ +$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php74($header), [ 'declare_strict_types' => false, 'void_return' => false, 'static_lambda' => false, @@ -33,7 +33,8 @@ $project_path = getcwd(); $config->getFinder() ->in([ - __DIR__ + __DIR__.'/src', + __DIR__.'/tests' ]) ->name('*.php') ->exclude([ diff --git a/Examples/assets/dataset01.inc.php b/Examples/assets/dataset01.inc.php index 5d3b5b1a..20dbc5b5 100755 --- a/Examples/assets/dataset01.inc.php +++ b/Examples/assets/dataset01.inc.php @@ -1,14 +1,14 @@ 1.0885908919277, 1 => 0.99034385297982, 2 => 0.97005467188578, 3 => 0.99901201350824, 4 => 1.1263167971152, 5 => 1.0582808133448, 6 => 1.0216740689064, 7 => 0.96626236356644, 8 => 1.0125912828768, 9 => 0.99047473992496, 10 => 0.99102472104561, 11 => 0.98500781573283, 12 => 0.91933668914198, 13 => 0.92234602792711, 14 => 0.88933863410054, 15 => 0.94236150975178, 16 => 0.98924287679116, 17 => 1.0342765545566, 18 => 1.0538510278089, 19 => 0.93496076181191, 20 => 0.90944479677235, 21 => 0.80831866316983, 22 => 0.81912434615535, 23 => 0.83143770042109, 24 => 0.86972168159496, 25 => 0.92645774571577, 26 => 0.81169120061422, 27 => 0.84409853057606, 28 => 0.89065856249272, 29 => 0.83551478929348, 30 => 0.87015680306726, 31 => 0.76063327042172, 32 => 0.82720958380697, 33 => 0.86565279505723, 34 => 0.77858966246836, 35 => 0.81009606378237, 36 => 0.80485136798149, 37 => 0.82641461943804, 38 => 0.87442020676513, 39 => 0.89589150146825, 40 => 0.92082995956816, 41 => 0.92614241931726, 42 => 0.96915564652581, 43 => 1.003753706293, 44 => 0.97438809368023, 45 => 1.011556766867, 46 => 1.0785692014115, 47 => 1.0586915420364, 48 => 1.284210059027, 49 => 1.3424512661794, 50 => 1.1743365450983, 51 => 1.2387345559532, 52 => 1.2485728609648, 53 => 1.2330096418558, 54 => 1.1857882621709, 55 => 1.2344956522411, 56 => 1.2047675730648, 57 => 1.292419000136, 58 => 1.3405480219013, 59 => 1.3971752198648, 60 => 1.4359555309649, 61 => 1.3243735045701, 62 => 1.2359389187087, 63 => 1.2201320423161, 64 => 1.3602246705197, 65 => 1.360886940568, 66 => 1.3493553211075, 67 => 1.4401769929405, 68 => 1.3979767849951, 69 => 1.4545882591647, 70 => 1.337801210539, 71 => 1.3793601365977, 72 => 1.4586769476223, 73 => 1.5230946076475, 74 => 1.4124735946125, 75 => 1.4030318592551, 76 => 1.349158816711, 77 => 1.3994840622105, 78 => 1.4239672612346, 79 => 1.40812256221, 80 => 1.4583856197192, 81 => 1.4613314581567, 82 => 1.6756755916668, 83 => 1.8580313939158, 84 => 1.8342360959805, 85 => 1.9216082598086, 86 => 1.9478846253628, 87 => 2.0244872112436, 88 => 1.9560660777181, 89 => 1.8415152640121, 90 => 1.8471764273372, 91 => 1.8889886695023, 92 => 1.8195007209252, 93 => 1.8960270595999, 94 => 1.8644490575386, 95 => 1.971196340772, 96 => 2.015583152659, 97 => 1.9959882430428, 98 => 2.1063668082622, 99 => 2.1719175769191, 100 => 2.1875938345039, 101 => 2.1587594039981, 102 => 2.1278241823627, 103 => 2.298793912594, 104 => 2.3723774302753, 105 => 2.4413392788904, 106 => 2.4834594954125, 107 => 2.5164271989421, 108 => 2.48274719503, 109 => 2.4492997581034, 110 => 2.1412357263019, 111 => 2.0314268112566, 112 => 1.9596098764628, 113 => 2.0250983127109, 114 => 1.924959829851, 115 => 1.9603612943993, 116 => 2.0540576271866, 117 => 2.0568349960689, 118 => 2.0811524692325, 119 => 2.0581964759165, 120 => 2.020162840272, 121 => 2.0626517638667, 122 => 1.9286563823225, 123 => 2.0127912437563, 124 => 1.9491858277931, 125 => 1.8692310150316, 126 => 1.6993275416762, 127 => 1.5849680675709, 128 => 1.5422481968304, 129 => 1.603188853916, 130 => 1.6449504349551, 131 => 1.6570332084417, 132 => 1.7563884552262, 133 => 1.7346008663135, 134 => 1.741307942998, 135 => 1.7415848536123, 136 => 1.7014366147405, 137 => 1.6719646364256, 138 => 1.7092888030342, 139 => 1.7371529028402, 140 => 1.7019154041991, 141 => 1.7662473702497, 142 => 1.8480766044197, 143 => 1.8355114169662, 144 => 1.7819817315586, 145 => 1.7148079481036, 146 => 1.6241989833489, 147 => 1.4624626548138, 148 => 1.5040542012939, 149 => 1.442295346913, 150 => 1.4187087000604, 151 => 1.4225097958511, 152 => 1.5001324671865, 153 => 1.4584802723727, 154 => 1.5342572961469, 155 => 1.514133174734, 156 => 1.5443934302345, 157 => 1.5476883863698, 158 => 1.6080128685721, 159 => 1.5816649899396, 160 => 1.5310436755918, 161 => 1.518280754595, 162 => 1.5216184249044, 163 => 1.4393414811719, 164 => 1.409379582707, 165 => 1.436861898056, 166 => 1.4739894373751, 167 => 1.4512785421546, 168 => 1.496057581316, 169 => 1.3817455776456, 170 => 1.2990312802211, 171 => 1.3073949130374, 172 => 1.2473214566896, 173 => 1.1105915111374, 174 => 1.0420360580822, 175 => 1.1744654786356, 176 => 1.0602876800127, 177 => 1.074408841208, 178 => 1.18387615056, 179 => 1.1890999077101, 180 => 1.0549293038746, 181 => 1.0570601708416, 182 => 1.0800216692849, 183 => 0.96274117702549, 184 => 0.9501673977047, 185 => 0.97710108451711, 186 => 0.89886322996001, 187 => 0.9239453369566, 188 => 0.96299807255386, 189 => 1.0105532418267, 190 => 1.0164009465948, 191 => 1.0413107606824, 192 => 1.0475248122459, 193 => 1.0266007451985, 194 => 1.0159556206533, 195 => 1.0943852922517, 196 => 1.0750418553654, 197 => 0.97774129938915, 198 => 0.98590717162284, 199 => 0.87713795242119, 200 => 0.90770624057599, 201 => 0.87557547650302, 202 => 0.95754187545856, 203 => 1.0111465867283, 204 => 0.93224663470275, 205 => 0.93886113881632, 206 => 0.94128877256653, 207 => 0.9559086414866, 208 => 0.97782683000598, 209 => 1.0648991708916, 210 => 1.1759619281479, 211 => 1.1323001889786, 212 => 1.2173222321276, 213 => 1.192219780365, 214 => 1.1507367671992, 215 => 1.0062415877475, 216 => 1.0017043563084, 217 => 0.94468309902865, 218 => 0.99384124056529, 219 => 1.0514822705943, 220 => 1.0451723914426, 221 => 1.0776122119814, 222 => 1.2013601009631, 223 => 1.1765086398423, 224 => 1.2387735028784, 225 => 1.2441365026242, 226 => 1.2694500268723, 227 => 1.2789962941485, 228 => 1.2442094256309, 229 => 1.2352688438234, 230 => 1.2571277155372, 231 => 1.3291795377077, 232 => 1.2703480599183, 233 => 1.30729508393, 234 => 1.3233030218068, 235 => 1.2861232143244, 236 => 1.3168684998023, 237 => 1.2499001566772, 238 => 1.2622769692485, 239 => 1.2160789893735, 240 => 1.2288877111321, 241 => 1.222967255453, 242 => 1.2998243638567, 243 => 1.3443008723449, 244 => 1.339680674028, 245 => 1.3779965791538, 246 => 1.3560080691721, 247 => 1.3470544172094, 248 => 1.3166882067851, 249 => 1.4452459865932, 250 => 1.4514278120119, 251 => 1.413690283372, 252 => 1.4178934332405, 253 => 1.4237414657565, 254 => 1.3777636409301, 255 => 1.4041849448389, 256 => 1.4049533546771, 257 => 1.4277375831259, 258 => 1.4224090113077, 259 => 1.4647907974628, 260 => 1.4243190632657, 261 => 1.4286580133998, 262 => 1.4348828641501, 263 => 1.415409243977, 264 => 1.4476028555859, 265 => 1.4538821661641, 266 => 1.4883184435336, 267 => 1.4205032194634, 268 => 1.3856543933372, 269 => 1.2716906168086, 270 => 1.3462117624752, 271 => 1.3003015423298, 272 => 1.2148491725878, 273 => 1.2605381058318, 274 => 1.2690047369619, 275 => 1.3327723638582, 276 => 1.3118643588249, 277 => 1.293007944258, 278 => 1.2548761810876, 279 => 1.3335015938603, 280 => 1.3152744239077, 281 => 1.2564376463182, 282 => 1.2478417859372, 283 => 1.2518821298414, 284 => 1.2036453589032, 285 => 1.1798564480155, 286 => 1.2062515260098, 287 => 1.2129817801455, 288 => 1.1405762096618, 289 => 1.0161049810033, 290 => 1.0030124197677, 291 => 1.0111565082559, 292 => 1.0084286839061, 293 => 0.95068297130577, 294 => 1.0450005357207, 295 => 1.211596899292, 296 => 1.3762615912002, 297 => 1.530127116787, 298 => 1.5167370832585, 299 => 1.6259521507076, 300 => 1.6518467383405, 301 => 1.7713043850286, 302 => 1.6396708687084, 303 => 1.6116177484122, 304 => 1.5225729470695, 305 => 1.6101471149808, ]; $xdata = [ - 0 => 444348000, 1 => 446853600, 2 => 449532000, 3 => 452124000, 4 => 454802400, 5 => 457394400, 6 => 460072800, 7 => 462751200, 8 => 465343200, 9 => 468021600, 10 => 470613600, 11 => 473292000, 12 => 475970400, 13 => 478389600, 14 => 481068000, 15 => 483660000, 16 => 486338400, 17 => 488930400, 18 => 491608800, 19 => 494287200, 20 => 496879200, 21 => 499557600, 22 => 502149600, 23 => 504828000, 24 => 507506400, 25 => 509925600, 26 => 512604000, 27 => 515196000, 28 => 517874400, 29 => 520466400, 30 => 523144800, 31 => 525823200, 32 => 528415200, 33 => 531093600, 34 => 533685600, 35 => 536364000, 36 => 539042400, 37 => 541461600, 38 => 544140000, 39 => 546732000, 40 => 549410400, 41 => 552002400, 42 => 554680800, 43 => 557359200, 44 => 559951200, 45 => 562629600, 46 => 565221600, 47 => 567900000, 48 => 570578400, 49 => 573084000, 50 => 575762400, 51 => 578354400, 52 => 581032800, 53 => 583624800, 54 => 586303200, 55 => 588981600, 56 => 591573600, 57 => 594252000, 58 => 596844000, 59 => 599522400, 60 => 602200800, 61 => 604620000, 62 => 607298400, 63 => 609890400, 64 => 612568800, 65 => 615160800, 66 => 617839200, 67 => 620517600, 68 => 623109600, 69 => 625788000, 70 => 628380000, 71 => 631058400, 72 => 633736800, 73 => 636156000, 74 => 638834400, 75 => 641426400, 76 => 644104800, 77 => 646696800, 78 => 649375200, 79 => 652053600, 80 => 654645600, 81 => 657324000, 82 => 659916000, 83 => 662594400, 84 => 665272800, 85 => 667692000, 86 => 670370400, 87 => 672962400, 88 => 675640800, 89 => 678232800, 90 => 680911200, 91 => 683589600, 92 => 686181600, 93 => 688860000, 94 => 691452000, 95 => 694130400, 96 => 696808800, 97 => 699314400, 98 => 701992800, 99 => 704584800, 100 => 707263200, 101 => 709855200, 102 => 712533600, 103 => 715212000, 104 => 717804000, 105 => 720482400, 106 => 723074400, 107 => 725752800, 108 => 728431200, 109 => 730850400, 110 => 733528800, 111 => 736120800, 112 => 738799200, 113 => 741391200, 114 => 744069600, 115 => 746748000, 116 => 749340000, 117 => 752018400, 118 => 754610400, 119 => 757288800, 120 => 759967200, 121 => 762386400, 122 => 765064800, 123 => 767656800, 124 => 770335200, 125 => 772927200, 126 => 775605600, 127 => 778284000, 128 => 780876000, 129 => 783554400, 130 => 786146400, 131 => 788824800, 132 => 791503200, 133 => 793922400, 134 => 796600800, 135 => 799192800, 136 => 801871200, 137 => 804463200, 138 => 807141600, 139 => 809820000, 140 => 812412000, 141 => 815090400, 142 => 817682400, 143 => 820360800, 144 => 823039200, 145 => 825544800, 146 => 828223200, 147 => 830815200, 148 => 833493600, 149 => 836085600, 150 => 838764000, 151 => 841442400, 152 => 844034400, 153 => 846712800, 154 => 849304800, 155 => 851983200, 156 => 854661600, 157 => 857080800, 158 => 859759200, 159 => 862351200, 160 => 865029600, 161 => 867621600, 162 => 870300000, 163 => 872978400, 164 => 875570400, 165 => 878248800, 166 => 880840800, 167 => 883519200, 168 => 886197600, 169 => 888616800, 170 => 891295200, 171 => 893887200, 172 => 896565600, 173 => 899157600, 174 => 901836000, 175 => 904514400, 176 => 907106400, 177 => 909784800, 178 => 912376800, 179 => 915055200, 180 => 917733600, 181 => 920152800, 182 => 922831200, 183 => 925423200, 184 => 928101600, 185 => 930693600, 186 => 933372000, 187 => 936050400, 188 => 938642400, 189 => 941320800, 190 => 943912800, 191 => 946591200, 192 => 949269600, 193 => 951775200, 194 => 954453600, 195 => 957045600, 196 => 959724000, 197 => 962316000, 198 => 964994400, 199 => 967672800, 200 => 970264800, 201 => 972943200, 202 => 975535200, 203 => 978213600, 204 => 980892000, 205 => 983311200, 206 => 985989600, 207 => 988581600, 208 => 991260000, 209 => 993852000, 210 => 996530400, 211 => 999208800, 212 => 1001800800, 213 => 1004479200, 214 => 1007071200, + 0 => 444348000, 1 => 446853600, 2 => 449532000, 3 => 452124000, 4 => 454802400, 5 => 457394400, 6 => 460072800, 7 => 462751200, 8 => 465343200, 9 => 468021600, 10 => 470613600, 11 => 473292000, 12 => 475970400, 13 => 478389600, 14 => 481068000, 15 => 483660000, 16 => 486338400, 17 => 488930400, 18 => 491608800, 19 => 494287200, 20 => 496879200, 21 => 499557600, 22 => 502149600, 23 => 504828000, 24 => 507506400, 25 => 509925600, 26 => 512604000, 27 => 515196000, 28 => 517874400, 29 => 520466400, 30 => 523144800, 31 => 525823200, 32 => 528415200, 33 => 531093600, 34 => 533685600, 35 => 536364000, 36 => 539042400, 37 => 541461600, 38 => 544140000, 39 => 546732000, 40 => 549410400, 41 => 552002400, 42 => 554680800, 43 => 557359200, 44 => 559951200, 45 => 562629600, 46 => 565221600, 47 => 567900000, 48 => 570578400, 49 => 573084000, 50 => 575762400, 51 => 578354400, 52 => 581032800, 53 => 583624800, 54 => 586303200, 55 => 588981600, 56 => 591573600, 57 => 594252000, 58 => 596844000, 59 => 599522400, 60 => 602200800, 61 => 604620000, 62 => 607298400, 63 => 609890400, 64 => 612568800, 65 => 615160800, 66 => 617839200, 67 => 620517600, 68 => 623109600, 69 => 625788000, 70 => 628380000, 71 => 631058400, 72 => 633736800, 73 => 636156000, 74 => 638834400, 75 => 641426400, 76 => 644104800, 77 => 646696800, 78 => 649375200, 79 => 652053600, 80 => 654645600, 81 => 657324000, 82 => 659916000, 83 => 662594400, 84 => 665272800, 85 => 667692000, 86 => 670370400, 87 => 672962400, 88 => 675640800, 89 => 678232800, 90 => 680911200, 91 => 683589600, 92 => 686181600, 93 => 688860000, 94 => 691452000, 95 => 694130400, 96 => 696808800, 97 => 699314400, 98 => 701992800, 99 => 704584800, 100 => 707263200, 101 => 709855200, 102 => 712533600, 103 => 715212000, 104 => 717804000, 105 => 720482400, 106 => 723074400, 107 => 725752800, 108 => 728431200, 109 => 730850400, 110 => 733528800, 111 => 736120800, 112 => 738799200, 113 => 741391200, 114 => 744069600, 115 => 746748000, 116 => 749340000, 117 => 752018400, 118 => 754610400, 119 => 757288800, 120 => 759967200, 121 => 762386400, 122 => 765064800, 123 => 767656800, 124 => 770335200, 125 => 772927200, 126 => 775605600, 127 => 778284000, 128 => 780876000, 129 => 783554400, 130 => 786146400, 131 => 788824800, 132 => 791503200, 133 => 793922400, 134 => 796600800, 135 => 799192800, 136 => 801871200, 137 => 804463200, 138 => 807141600, 139 => 809820000, 140 => 812412000, 141 => 815090400, 142 => 817682400, 143 => 820360800, 144 => 823039200, 145 => 825544800, 146 => 828223200, 147 => 830815200, 148 => 833493600, 149 => 836085600, 150 => 838764000, 151 => 841442400, 152 => 844034400, 153 => 846712800, 154 => 849304800, 155 => 851983200, 156 => 854661600, 157 => 857080800, 158 => 859759200, 159 => 862351200, 160 => 865029600, 161 => 867621600, 162 => 870300000, 163 => 872978400, 164 => 875570400, 165 => 878248800, 166 => 880840800, 167 => 883519200, 168 => 886197600, 169 => 888616800, 170 => 891295200, 171 => 893887200, 172 => 896565600, 173 => 899157600, 174 => 901836000, 175 => 904514400, 176 => 907106400, 177 => 909784800, 178 => 912376800, 179 => 915055200, 180 => 917733600, 181 => 920152800, 182 => 922831200, 183 => 925423200, 184 => 928101600, 185 => 930693600, 186 => 933372000, 187 => 936050400, 188 => 938642400, 189 => 941320800, 190 => 943912800, 191 => 946591200, 192 => 949269600, 193 => 951775200, 194 => 954453600, 195 => 957045600, 196 => 959724000, 197 => 962316000, 198 => 964994400, 199 => 967672800, 200 => 970264800, 201 => 972943200, 202 => 975535200, 203 => 978213600, 204 => 980892000, 205 => 983311200, 206 => 985989600, 207 => 988581600, 208 => 991260000, 209 => 993852000, 210 => 996530400, 211 => 999208800, 212 => 1001800800, 213 => 1004479200, 214 => 1007071200, 215 => 1009749600, 216 => 1012428000, 217 => 1014847200, 218 => 1017525600, 219 => 1020117600, 220 => 1022796000, 221 => 1025388000, 222 => 1028066400, 223 => 1030744800, 224 => 1033336800, 225 => 1036015200, 226 => 1038607200, 227 => 1041285600, 228 => 1043964000, 229 => 1046383200, @@ -28,4 +28,4 @@ 295 => 1220133600, 296 => 1222725600, 297 => 1225404000, 298 => 1227996000, 299 => 1230674400, 300 => 1233352800, 301 => 1235772000, 302 => 1238450400, 303 => 1241042400, 304 => 1243720800, 305 => 1246312800, - ]; +]; diff --git a/Examples/example_list.php b/Examples/example_list.php index df599b12..58bcab2f 100755 --- a/Examples/example_list.php +++ b/Examples/example_list.php @@ -1,7 +1,7 @@ Read()) { - if (is_dir($entry) && ($entry != 'assets') && $entry !== '.' && $entry !== '..') { - $examplefolder = dir($entry); + if (\is_dir($entry) && ('assets' !== $entry) && '.' !== $entry && '..' !== $entry) { + $examplefolder = \dir($entry); + while ($file = $examplefolder->Read()) { - if (is_dir($file) || !strstr($file, '.php')) { + if (\is_dir($file) || !\mb_strstr($file, '.php')) { continue; } - if (!strstr($entry, 'csim') && strstr($file, 'x') && !strstr($file, 'show') && !strstr($file, 'csim')) { + + if (!\mb_strstr($entry, 'csim') && \mb_strstr($file, 'x') && !\mb_strstr($file, 'show') && !\mb_strstr($file, 'csim')) { $a[] = $entry . '/' . $file; - } elseif (strstr($entry, 'csim') && !strstr($entry, 'graph')) { + } elseif (\mb_strstr($entry, 'csim') && !\mb_strstr($entry, 'graph')) { $a[] = $entry . '/' . $file; } } } } $d->Close(); - if (count($a) == 0) { - die("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: {$this->iDir}"); + + if (\count($a) === 0) { + exit("PANIC: Apache/PHP does not have enough permission to read the scripts in directory: {$this->iDir}"); } - sort($a); + \sort($a); return $a; } $files = GetFiles(); -echo "window.files='" . json_encode($files) . "';"; +echo "window.files='" . \json_encode($files) . "';"; diff --git a/Examples/examples_axis/axislabelbkgex01.php b/Examples/examples_axis/axislabelbkgex01.php index 2e6ae698..17d46a9a 100755 --- a/Examples/examples_axis/axislabelbkgex01.php +++ b/Examples/examples_axis/axislabelbkgex01.php @@ -1,7 +1,7 @@ SetScale('intlin'); -$graph->SetMargin(30, 15, 40, 30); -$graph->SetMarginColor('white'); -$graph->SetFrame(true, 'blue', 3); +$graph = new Graph\Graph($__width, $__height); $example_title = 'Label background'; -$example_title = $example_title; -$example_title = $example_title; -$graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); - -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->subtitle->SetColor('darkred'); $subtitle_text = 'Label without background'; -$graph->subtitle->Set($subtitle_text); - -$graph->SetAxisLabelBackground(Graph\Configs::getConfig('LABELBKG_NONE'), 'orange', 'red', 'lightblue', 'red'); - -// Use Ariel font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); -$graph->xgrid->Show(); - -// Create the plot line -$p1 = new Plot\LinePlot($ydata); -$graph->Add($p1); -// Output graph -$graph->Stroke(); +$graph->SetScale('intlin') + ->SetMargin(30, 15, 40, 30) + ->SetMarginColor('white') + ->SetFrame(true, 'blue', 3) + ->SetAxisLabelBackground( + Graph\Configs::getConfig('LABELBKG_NONE'), + 'orange', + 'red', + 'lightblue', + 'red' + ) + ->tap( + fn ($g) => $g->title + ->set($example_title) + ->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 + ) + )->tap( + fn ($g) => $g->subtitle + ->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 + ) + ->SetColor('darkred') + ->Set($subtitle_text) + ) + ->tap(fn ($g) => $g->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 + )) + ->tap(fn ($g) => $g->yaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 + )) + ->tap(fn ($g) => $g->xgrid->Show()) + ->Add(new Plot\LinePlot($ydata)) + ->Stroke(); diff --git a/Examples/examples_axis/axislabelbkgex02.php b/Examples/examples_axis/axislabelbkgex02.php index c67c998e..8370a0c6 100644 --- a/Examples/examples_axis/axislabelbkgex02.php +++ b/Examples/examples_axis/axislabelbkgex02.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/axislabelbkgex03.php b/Examples/examples_axis/axislabelbkgex03.php index 70e7e55a..50f71b0c 100644 --- a/Examples/examples_axis/axislabelbkgex03.php +++ b/Examples/examples_axis/axislabelbkgex03.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/axislabelbkgex04.php b/Examples/examples_axis/axislabelbkgex04.php index a9139637..23cfe9d0 100644 --- a/Examples/examples_axis/axislabelbkgex04.php +++ b/Examples/examples_axis/axislabelbkgex04.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/axislabelbkgex05.php b/Examples/examples_axis/axislabelbkgex05.php index fc5106be..3874a47c 100644 --- a/Examples/examples_axis/axislabelbkgex05.php +++ b/Examples/examples_axis/axislabelbkgex05.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/axislabelbkgex06.php b/Examples/examples_axis/axislabelbkgex06.php index 58c5dfaf..33b7f18e 100644 --- a/Examples/examples_axis/axislabelbkgex06.php +++ b/Examples/examples_axis/axislabelbkgex06.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/axislabelbkgex07.php b/Examples/examples_axis/axislabelbkgex07.php index 52663a3a..5c22f3aa 100644 --- a/Examples/examples_axis/axislabelbkgex07.php +++ b/Examples/examples_axis/axislabelbkgex07.php @@ -1,7 +1,7 @@ SetScale('intlin'); $graph->SetMargin(30, 15, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/dupyaxisex1.php b/Examples/examples_axis/dupyaxisex1.php index d3621790..4f69ffc6 100644 --- a/Examples/examples_axis/dupyaxisex1.php +++ b/Examples/examples_axis/dupyaxisex1.php @@ -1,7 +1,7 @@ E(-M_PI, M_PI, 25); +$f = new Util\FuncGenerator('cos($i)', '$i*$i*$i'); +[$xdata, $ydata] = $f->E(-\M_PI, \M_PI, 25); -$__width = 300; +$__width = 300; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); $graph->SetMargin(50, 50, 20, 30); $graph->SetFrame(false); diff --git a/Examples/examples_axis/inyaxisex1.php b/Examples/examples_axis/inyaxisex1.php index 3b1a12fd..94b84708 100644 --- a/Examples/examples_axis/inyaxisex1.php +++ b/Examples/examples_axis/inyaxisex1.php @@ -1,7 +1,7 @@ SetScale('linlin'); $graph->img->SetMargin(50, 50, 60, 40); $graph->SetMarginColor('darkblue'); diff --git a/Examples/examples_axis/inyaxisex2.php b/Examples/examples_axis/inyaxisex2.php index 4d460048..e15024a6 100644 --- a/Examples/examples_axis/inyaxisex2.php +++ b/Examples/examples_axis/inyaxisex2.php @@ -1,7 +1,7 @@ SetScale('linlin'); $graph->img->SetMargin(50, 50, 60, 40); $graph->SetMarginColor('darkblue'); diff --git a/Examples/examples_axis/inyaxisex3.php b/Examples/examples_axis/inyaxisex3.php index 657bad2b..4e72f693 100644 --- a/Examples/examples_axis/inyaxisex3.php +++ b/Examples/examples_axis/inyaxisex3.php @@ -1,7 +1,7 @@ SetScale('linlin'); $graph->SetY2Scale('lin'); $graph->SetMargin(50, 50, 60, 40); diff --git a/Examples/examples_axis/mulyaxisex1.php b/Examples/examples_axis/mulyaxisex1.php index baf286d4..587b4817 100644 --- a/Examples/examples_axis/mulyaxisex1.php +++ b/Examples/examples_axis/mulyaxisex1.php @@ -1,7 +1,7 @@ SetMargin(40, 150, 40, 30); $graph->SetMarginColor('white'); diff --git a/Examples/examples_axis/topxaxis.php b/Examples/examples_axis/topxaxis.php index 9d12b4fc..299a1269 100644 --- a/Examples/examples_axis/topxaxis.php +++ b/Examples/examples_axis/topxaxis.php @@ -1,7 +1,7 @@ img->SetMargin(40, 40, 40, 20); $graph->SetScale('linlin'); diff --git a/Examples/examples_background/background_type_ex0.php b/Examples/examples_background/background_type_ex0.php index 773854f7..02b140e8 100644 --- a/Examples/examples_background/background_type_ex0.php +++ b/Examples/examples_background/background_type_ex0.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(40, 40, 50, 50); @@ -26,11 +26,19 @@ $graph->SetBox(true); // Steup graph titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Using background image'; $example_title = $example_title; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = 'BGIMG_COPY'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('darkred'); diff --git a/Examples/examples_background/background_type_ex1.php b/Examples/examples_background/background_type_ex1.php index 2b53dcb5..7d4ce928 100644 --- a/Examples/examples_background/background_type_ex1.php +++ b/Examples/examples_background/background_type_ex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(40, 40, 50, 50); @@ -25,10 +25,18 @@ $graph->SetBox(true); // Steup graph titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Using background image'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = 'BGIMG_CENTER'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('darkred'); diff --git a/Examples/examples_background/background_type_ex2.php b/Examples/examples_background/background_type_ex2.php index 9cc79b8d..27ecffc2 100644 --- a/Examples/examples_background/background_type_ex2.php +++ b/Examples/examples_background/background_type_ex2.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(40, 40, 50, 50); @@ -25,10 +25,18 @@ $graph->SetBox(true); // Steup graph titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Using background image'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = 'BGIMG_FREE'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('darkred'); diff --git a/Examples/examples_background/background_type_ex3.php b/Examples/examples_background/background_type_ex3.php index 67fa04bf..fc4a9b51 100644 --- a/Examples/examples_background/background_type_ex3.php +++ b/Examples/examples_background/background_type_ex3.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(40, 40, 50, 50); @@ -25,10 +25,18 @@ $graph->SetBox(true); // Steup graph titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Using background image'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = 'BGIMG_FILLPLOT'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('darkred'); diff --git a/Examples/examples_background/background_type_ex4.php b/Examples/examples_background/background_type_ex4.php index d9c49e60..87e7ae8b 100644 --- a/Examples/examples_background/background_type_ex4.php +++ b/Examples/examples_background/background_type_ex4.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(40, 40, 50, 50); @@ -25,10 +25,18 @@ $graph->SetBox(true); // Steup graph titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Using background image'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = 'BGIMG_FILLFRAME'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('darkred'); diff --git a/Examples/examples_background/backgroundex01.php b/Examples/examples_background/backgroundex01.php index a362d7ea..99152ee6 100644 --- a/Examples/examples_background/backgroundex01.php +++ b/Examples/examples_background/backgroundex01.php @@ -1,7 +1,7 @@ img->SetMargin(40, 180, 40, 40); $graph->SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLPLOT')); @@ -27,7 +27,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Slightly adjust the legend from it's default position in the // top right corner. @@ -35,7 +38,9 @@ // Create the first line $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); @@ -45,7 +50,9 @@ // ... and the second $p2 = new Plot\LinePlot($data2y); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_STAR')); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_STAR') +); $p2->mark->SetFillColor('red'); $p2->mark->SetWidth(4); $p2->SetColor('red'); diff --git a/Examples/examples_background/backgroundex02.php b/Examples/examples_background/backgroundex02.php index acf1a68a..53b153f7 100644 --- a/Examples/examples_background/backgroundex02.php +++ b/Examples/examples_background/backgroundex02.php @@ -1,7 +1,7 @@ img->SetMargin(40, 180, 40, 40); $graph->SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLFRAME')); @@ -27,7 +27,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Slightly adjust the legend from it's default position in the // top right corner. @@ -35,7 +38,9 @@ // Create the first line $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); @@ -45,7 +50,9 @@ // ... and the second $p2 = new Plot\LinePlot($data2y); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_STAR')); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_STAR') +); $p2->mark->SetFillColor('red'); $p2->mark->SetWidth(4); $p2->SetColor('red'); diff --git a/Examples/examples_background/backgroundex03.php b/Examples/examples_background/backgroundex03.php index bd14c316..f26adc66 100644 --- a/Examples/examples_background/backgroundex03.php +++ b/Examples/examples_background/backgroundex03.php @@ -1,7 +1,7 @@ img->SetMargin(40, 180, 40, 40); $graph->SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_COPY')); @@ -27,7 +27,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Slightly adjust the legend from it's default position in the // top right corner. @@ -35,7 +38,9 @@ // Create the first line $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); @@ -45,7 +50,9 @@ // ... and the second $p2 = new Plot\LinePlot($data2y); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_STAR')); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_STAR') +); $p2->mark->SetFillColor('red'); $p2->mark->SetWidth(4); $p2->SetColor('red'); diff --git a/Examples/examples_bar/accbarex1.php b/Examples/examples_bar/accbarex1.php index c210b447..043cd865 100644 --- a/Examples/examples_bar/accbarex1.php +++ b/Examples/examples_bar/accbarex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetShadow(); @@ -39,9 +39,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/accbarframeex01.php b/Examples/examples_bar/accbarframeex01.php index 062b66a2..62e4faa2 100644 --- a/Examples/examples_bar/accbarframeex01.php +++ b/Examples/examples_bar/accbarframeex01.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMarginColor('white'); diff --git a/Examples/examples_bar/accbarframeex02.php b/Examples/examples_bar/accbarframeex02.php index 5ba3c280..fe563e2d 100644 --- a/Examples/examples_bar/accbarframeex02.php +++ b/Examples/examples_bar/accbarframeex02.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMarginColor('white'); diff --git a/Examples/examples_bar/accbarframeex03.php b/Examples/examples_bar/accbarframeex03.php index 7c8f1804..5b7280f0 100644 --- a/Examples/examples_bar/accbarframeex03.php +++ b/Examples/examples_bar/accbarframeex03.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMarginColor('white'); diff --git a/Examples/examples_bar/alphabar.php b/Examples/examples_bar/alphabar.php index fdd765f1..5854bdf1 100644 --- a/Examples/examples_bar/alphabar.php +++ b/Examples/examples_bar/alphabar.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->img->SetMargin(40, 80, 30, 40); @@ -36,13 +36,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('white'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('white'); //$graph->ygrid->Show(false); @@ -53,7 +62,11 @@ $graph->title->set($example_title); // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_bar/bar2scalesex1.php b/Examples/examples_bar/bar2scalesex1.php index 017818aa..65e106e1 100644 --- a/Examples/examples_bar/bar2scalesex1.php +++ b/Examples/examples_bar/bar2scalesex1.php @@ -1,21 +1,21 @@ title->set($example_title); diff --git a/Examples/examples_bar/barformatcallbackex1.php b/Examples/examples_bar/barformatcallbackex1.php index 838e5a5c..88c8ad34 100644 --- a/Examples/examples_bar/barformatcallbackex1.php +++ b/Examples/examples_bar/barformatcallbackex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); // Create a bar plots diff --git a/Examples/examples_bar/bargradex1.php b/Examples/examples_bar/bargradex1.php index 1eb0e4e2..c73f43d2 100644 --- a/Examples/examples_bar/bargradex1.php +++ b/Examples/examples_bar/bargradex1.php @@ -1,11 +1,12 @@ img->SetMargin(60, 20, 35, 75); $graph->SetScale('textlin'); $graph->SetMarginColor('lightblue:1.1'); @@ -24,12 +25,24 @@ // Set up the title for the graph$example_title='Bar gradient with left reflection'; $graph->title->set($example_title); $graph->title->SetMargin(8); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Show 0 label on Y-axis (default is not to show) $graph->yscale->ticks->SupressZeroLabel(false); diff --git a/Examples/examples_bar/bargradex2.php b/Examples/examples_bar/bargradex2.php index 4c099d69..1f9fe4f4 100644 --- a/Examples/examples_bar/bargradex2.php +++ b/Examples/examples_bar/bargradex2.php @@ -1,12 +1,13 @@ img->SetMargin(60, 20, 30, 50); $graph->SetScale('textlin'); $graph->SetMarginColor('silver'); $graph->SetShadow(); // Set up the title for the graph$example_title='Example negative bars'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 18 +); $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $graph->xaxis->SetColor('black', 'red'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); // Show 0 label on Y-axis (default is not to show) $graph->yscale->ticks->SupressZeroLabel(false); diff --git a/Examples/examples_bar/bargradex3.php b/Examples/examples_bar/bargradex3.php index bb85a34d..07045bf2 100644 --- a/Examples/examples_bar/bargradex3.php +++ b/Examples/examples_bar/bargradex3.php @@ -1,12 +1,13 @@ img->SetMargin(60, 20, 30, 50); $graph->SetScale('textlin'); $graph->SetMarginColor('silver'); $graph->SetShadow(); // Set up the title for the graph$example_title='Example negative bars'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Show 0 label on Y-axis (default is not to show) $graph->yscale->ticks->SupressZeroLabel(false); diff --git a/Examples/examples_bar/bargradex4.php b/Examples/examples_bar/bargradex4.php index 589008b0..8d26c3bc 100644 --- a/Examples/examples_bar/bargradex4.php +++ b/Examples/examples_bar/bargradex4.php @@ -1,12 +1,13 @@ img->SetMargin(60, 30, 30, 40); $graph->SetScale('textlin'); $graph->SetMarginColor('teal'); @@ -24,20 +25,36 @@ // Set up the title for the graph$example_title='Bargraph with small variations'; $graph->title->set($example_title); $graph->title->SetColor('white'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Setup color for axis and labels $graph->xaxis->SetColor('black', 'white'); $graph->yaxis->SetColor('black', 'white'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Setup X-axis title (color & font) $graph->xaxis->title->Set('X-axis'); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradex5.php b/Examples/examples_bar/bargradex5.php index 6d6ff85e..3d034766 100644 --- a/Examples/examples_bar/bargradex5.php +++ b/Examples/examples_bar/bargradex5.php @@ -1,12 +1,13 @@ img->SetMargin(60, 30, 30, 40); $graph->SetScale('textlin'); $graph->SetMarginColor('teal'); @@ -38,20 +39,36 @@ // Set up the title for the graph$example_title=Bargraph which doesn't start from y=0; $graph->title->set($example_title); $graph->title->SetColor('yellow'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Setup color for axis and labels $graph->xaxis->SetColor('black', 'white'); $graph->yaxis->SetColor('black', 'white'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Setup X-axis title (color & font) $graph->xaxis->title->Set('X-axis'); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Finally send the graph to the browser $graph->Stroke(); diff --git a/Examples/examples_bar/bargradex6.php b/Examples/examples_bar/bargradex6.php index 649436aa..892896d4 100644 --- a/Examples/examples_bar/bargradex6.php +++ b/Examples/examples_bar/bargradex6.php @@ -1,12 +1,13 @@ img->SetMargin(60, 150, 30, 50); $graph->SetScale('textlin'); $graph->SetMarginColor('silver'); $graph->SetShadow(); // Set up the title for the graph$example_title='Example negative bars'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Show 0 label on Y-axis (default is not to show) $graph->yscale->ticks->SupressZeroLabel(false); diff --git a/Examples/examples_bar/bargradsmallex1.php b/Examples/examples_bar/bargradsmallex1.php index 844f4b15..22241b75 100644 --- a/Examples/examples_bar/bargradsmallex1.php +++ b/Examples/examples_bar/bargradsmallex1.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_MIDVER'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex2.php b/Examples/examples_bar/bargradsmallex2.php index 6a4d6ec6..eded6f8a 100644 --- a/Examples/examples_bar/bargradsmallex2.php +++ b/Examples/examples_bar/bargradsmallex2.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_MIDHOR'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex3.php b/Examples/examples_bar/bargradsmallex3.php index 8fff07b0..2ae120c2 100644 --- a/Examples/examples_bar/bargradsmallex3.php +++ b/Examples/examples_bar/bargradsmallex3.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_HOR'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex4.php b/Examples/examples_bar/bargradsmallex4.php index cdde087a..75579916 100644 --- a/Examples/examples_bar/bargradsmallex4.php +++ b/Examples/examples_bar/bargradsmallex4.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_VER'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex5.php b/Examples/examples_bar/bargradsmallex5.php index 273d664d..0d0677ef 100644 --- a/Examples/examples_bar/bargradsmallex5.php +++ b/Examples/examples_bar/bargradsmallex5.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_WIDE_MIDVER'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex6.php b/Examples/examples_bar/bargradsmallex6.php index 017b404f..99141e66 100644 --- a/Examples/examples_bar/bargradsmallex6.php +++ b/Examples/examples_bar/bargradsmallex6.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_WIDE_MIDHOR'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex7.php b/Examples/examples_bar/bargradsmallex7.php index 67b23511..b83527f3 100644 --- a/Examples/examples_bar/bargradsmallex7.php +++ b/Examples/examples_bar/bargradsmallex7.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_CENTER'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/bargradsmallex8.php b/Examples/examples_bar/bargradsmallex8.php index 02dfb148..283ef0ad 100644 --- a/Examples/examples_bar/bargradsmallex8.php +++ b/Examples/examples_bar/bargradsmallex8.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->img->SetMargin(25, 15, 25, 25); $example_title = 'GRAD_RAISED_PANEL'; @@ -22,8 +23,12 @@ $graph->title->SetColor('darkred'); // Setup font for axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); // Create the bar pot $bplot = new Plot\BarPlot($datay); diff --git a/Examples/examples_bar/barimg1.php b/Examples/examples_bar/barimg1.php index ca276973..c9400429 100644 --- a/Examples/examples_bar/barimg1.php +++ b/Examples/examples_bar/barimg1.php @@ -1,22 +1,27 @@ SetScale('textlin'); $example_title = 'Images on top of bars'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 13); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 13 +); $graph->SetTitleBackground('lightblue:1.1', Graph\Configs::getConfig('TITLEBKG_STYLE1'), Graph\Configs::getConfig('TITLEBKG_FRAME_BEVEL')); @@ -27,7 +32,10 @@ $lplot = new Plot\LinePlot($datay); $lplot->SetColor('white@1'); $lplot->SetBarCenter(); -$lplot->mark->SetType(Graph\Configs::getConfig('MARK_IMG_LBALL'), 'red'); +$lplot->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_LBALL'), + 'red' +); $graph->Add($bplot); $graph->Add($lplot); diff --git a/Examples/examples_bar/barint1.php b/Examples/examples_bar/barint1.php index 0b84fc41..b6ec35bd 100644 --- a/Examples/examples_bar/barint1.php +++ b/Examples/examples_bar/barint1.php @@ -1,11 +1,12 @@ img->SetMargin(40, 30, 30, 40); $graph->SetScale('textint'); $graph->SetShadow(); @@ -28,12 +29,20 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT2')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT2') +); // Setup graph title ands fonts$example_title='Example of integer Y-scale'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -44,7 +53,10 @@ // Setup the values that are displayed on top of each bar $bplot->value->Show(); // Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD')); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD') +); $bplot->value->SetAngle(45); // Black color for positive values and darkred for negative values $bplot->value->SetColor('black', 'darkred'); diff --git a/Examples/examples_bar/barint2.php b/Examples/examples_bar/barint2.php index edd5abbd..def64c38 100644 --- a/Examples/examples_bar/barint2.php +++ b/Examples/examples_bar/barint2.php @@ -1,10 +1,11 @@ img->SetMargin(40, 30, 40, 40); $graph->SetScale('textint'); $graph->SetFrame(true, 'blue', 1); @@ -28,7 +29,9 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->SetColor('darkblue', 'black'); // Stup hidden y-axis by given it the same color @@ -40,9 +43,15 @@ $subtitle_text = '(With hidden y-axis)'; $graph->subtitle->Set($subtitle_text); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -54,7 +63,11 @@ // Setup the values that are displayed on top of each bar $bplot->value->Show(); // Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $bplot->value->SetFormat('$%d'); // Black color for positive values and darkred for negative values $bplot->value->SetColor('black', 'darkred'); diff --git a/Examples/examples_bar/barlinealphaex1.php b/Examples/examples_bar/barlinealphaex1.php index f2e0b23e..da474882 100644 --- a/Examples/examples_bar/barlinealphaex1.php +++ b/Examples/examples_bar/barlinealphaex1.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMarginColor('white'); @@ -34,7 +35,11 @@ // Setup the tab title $graph->tabtitle->Set('Year 2003'); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Setup the X and Y grid $graph->ygrid->SetFill(true, '#DDDDDD@0.5', '#BBBBBB@0.5'); @@ -46,7 +51,11 @@ // Setup month as labels on the X-axis $graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->xaxis->SetLabelAngle(45); // Create a bar pot @@ -69,7 +78,9 @@ $lplot->SetColor('navy@0.7'); $lplot->SetBarCenter(); -$lplot->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$lplot->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $lplot->mark->SetColor('blue@0.5'); $lplot->mark->SetFillColor('lightblue'); $lplot->mark->SetSize(6); diff --git a/Examples/examples_bar/barlinefreqex1.php b/Examples/examples_bar/barlinefreqex1.php index b6c630ee..e135b824 100644 --- a/Examples/examples_bar/barlinefreqex1.php +++ b/Examples/examples_bar/barlinefreqex1.php @@ -1,13 +1,14 @@ SetScale('textlin'); @@ -48,15 +50,30 @@ function accfreq($data) $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Turn the tickmarks -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); - -$graph->y2axis->SetTickSide(Graph\Configs::getConfig('SIDE_RIGHT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); + +$graph->y2axis->SetTickSide( + Graph\Configs::getConfig('SIDE_RIGHT') +); $graph->y2axis->SetColor('black', 'blue'); $graph->y2axis->SetLabelFormat('%3d.0%%'); @@ -78,7 +95,11 @@ function accfreq($data) $bplot->SetFillColor('orange@0.2'); $bplot->SetValuePos('center'); $bplot->value->SetFormat('%d'); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $bplot->value->Show(); // Add it to the graph diff --git a/Examples/examples_bar/barpatternex1.php b/Examples/examples_bar/barpatternex1.php index fb376f06..9ac9a803 100644 --- a/Examples/examples_bar/barpatternex1.php +++ b/Examples/examples_bar/barpatternex1.php @@ -1,19 +1,20 @@ SetScale('textlin'); @@ -21,17 +22,28 @@ $graph->SetBox(); $example_title = 'Bar Pattern'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 20); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 20 +); $graph->SetTitleBackground('lightblue:1.3', Graph\Configs::getConfig('TITLEBKG_STYLE2'), Graph\Configs::getConfig('TITLEBKG_FRAME_BEVEL')); -$graph->SetTitleBackgroundFillStyle(Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), 'lightblue', 'blue'); +$graph->SetTitleBackgroundFillStyle( + Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), + 'lightblue', + 'blue' +); // Create a bar pot $bplot = new Plot\BarPlot($datay); $bplot->SetFillColor('darkorange'); $bplot->SetWidth(0.6); -$bplot->SetPattern(Graph\Configs::getConfig('PATTERN_CROSS1'), 'navy'); +$bplot->SetPattern( + Graph\Configs::getConfig('PATTERN_CROSS1'), + 'navy' +); $graph->Add($bplot); diff --git a/Examples/examples_bar/barscalecallback1.php b/Examples/examples_bar/barscalecallback1.php index 44da5cff..c5dd200d 100644 --- a/Examples/examples_bar/barscalecallback1.php +++ b/Examples/examples_bar/barscalecallback1.php @@ -1,31 +1,32 @@ img->SetMargin(80, 30, 30, 40); $graph->SetScale('textint'); $graph->SetShadow(); @@ -42,12 +43,20 @@ function separator1000_usd($aVal) // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT2')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT2') +); // Setup graph title ands fonts$example_title='Example of Y-scale callback formatting'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -59,7 +68,10 @@ function separator1000_usd($aVal) $bplot->value->Show(); // Must use TTF fonts if we want text at an arbitrary angle -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD')); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD') +); $bplot->value->SetAngle(45); $bplot->value->SetFormatCallback('separator1000_usd'); diff --git a/Examples/examples_bar/bartut2.php b/Examples/examples_bar/bartut2.php index 33d5bc63..591dc423 100644 --- a/Examples/examples_bar/bartut2.php +++ b/Examples/examples_bar/bartut2.php @@ -1,22 +1,23 @@ SetShadow(); // Some data $databary = [12, 7, 16, 6, 7, 14, 9, 3]; -$months = $graph->gDateLocale->GetShortMonth(); +$months = $graph->gDateLocale->GetShortMonth(); // Use a text X-scale $graph->SetScale('textlin'); @@ -29,7 +30,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/bartut3.php b/Examples/examples_bar/bartut3.php index a80ab885..c91cf6b5 100644 --- a/Examples/examples_bar/bartut3.php +++ b/Examples/examples_bar/bartut3.php @@ -1,17 +1,18 @@ SetShadow(); $databary = []; @@ -19,9 +20,10 @@ // Some data $months = $graph->gDateLocale->GetShortMonth(); -srand((float) microtime() * 1000000); -for ($i = 0; $i < 25; ++$i) { - $databary[] = rand(1, 50); +\mt_srand((float) \microtime() * 1000000); + +for ($i = 0; 25 > $i; ++$i) { + $databary[] = \mt_rand(1, 50); $databarx[] = $months[$i % 12]; } @@ -36,7 +38,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/bartut4.php b/Examples/examples_bar/bartut4.php index 2e4f240a..3309d875 100644 --- a/Examples/examples_bar/bartut4.php +++ b/Examples/examples_bar/bartut4.php @@ -1,17 +1,18 @@ SetShadow(); // Some data @@ -20,9 +21,10 @@ // Some data $months = $graph->gDateLocale->GetShortMonth(); -srand((float) microtime() * 1000000); -for ($i = 0; $i < 25; ++$i) { - $databary[] = rand(1, 50); +\mt_srand((float) \microtime() * 1000000); + +for ($i = 0; 25 > $i; ++$i) { + $databary[] = \mt_rand(1, 50); $databarx[] = $months[$i % 12]; } @@ -31,7 +33,10 @@ // Specify X-labels //$databarx = array('tXi','','','xxx','','','iXii','','','OOO','','','tOO'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $graph->xaxis->SetTickLabels($databarx); $graph->xaxis->SetTextLabelInterval(3); @@ -40,7 +45,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/bartutex1.php b/Examples/examples_bar/bartutex1.php index 6e442f8d..6fd47420 100644 --- a/Examples/examples_bar/bartutex1.php +++ b/Examples/examples_bar/bartutex1.php @@ -1,10 +1,11 @@ SetShadow(); // Use a text X-scale @@ -25,7 +26,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/bartutex12.php b/Examples/examples_bar/bartutex12.php index 9959ced5..3eac3c37 100644 --- a/Examples/examples_bar/bartutex12.php +++ b/Examples/examples_bar/bartutex12.php @@ -1,7 +1,7 @@ $i) { + $databary[] = \abs(25 * \sin($i) + 5); } else { $databary[] = 0; } } // new Graph\Graph with a background image and drop shadow -$__width = 450; +$__width = 450; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLFRAME')); $graph->SetShadow(); @@ -52,7 +56,10 @@ $graph->subtitle->Set("100 data points, X-Scale: 'text'"); // Use built in font (don't need TTF support) -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Make the margin around the plot a little bit bigger then default $graph->img->SetMargin(40, 140, 40, 80); diff --git a/Examples/examples_bar/example16.2.php b/Examples/examples_bar/example16.2.php index 2f0dd9a2..3298c823 100644 --- a/Examples/examples_bar/example16.2.php +++ b/Examples/examples_bar/example16.2.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->img->SetMargin(40, 130, 20, 40); @@ -40,9 +41,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); //$graph->xaxis->SetTickLabels($datax); //$graph->xaxis->SetTextTickInterval(2); diff --git a/Examples/examples_bar/example16.3.php b/Examples/examples_bar/example16.3.php index b01935d9..f7b35dc4 100644 --- a/Examples/examples_bar/example16.3.php +++ b/Examples/examples_bar/example16.3.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->img->SetMargin(40, 130, 20, 40); @@ -40,9 +41,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTickLabels($datax); //$graph->xaxis->SetTextTickInterval(2); diff --git a/Examples/examples_bar/example16.4.php b/Examples/examples_bar/example16.4.php index 228c5a19..0760d15e 100644 --- a/Examples/examples_bar/example16.4.php +++ b/Examples/examples_bar/example16.4.php @@ -1,10 +1,11 @@ SetScale('intlin'); $graph->img->SetMargin(40, 130, 20, 40); @@ -42,9 +43,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $datax = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($datax); diff --git a/Examples/examples_bar/example16.5.php b/Examples/examples_bar/example16.5.php index 95d24c0b..b57c8116 100644 --- a/Examples/examples_bar/example16.5.php +++ b/Examples/examples_bar/example16.5.php @@ -1,22 +1,23 @@ img->SetMargin(40, 70, 20, 40); $graph->SetScale('textlin'); $graph->SetShadow(); @@ -27,7 +28,10 @@ $t1 = new Text\Text('This is a text'); $t1->SetPos(0.5, 0.5); $t1->SetOrientation('h'); -$t1->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$t1->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $t1->SetBox('white', 'black', 'gray'); $t1->SetColor('black'); $graph->AddText($t1); @@ -51,9 +55,18 @@ $graph->xaxis->title->Set('Month'); $graph->yaxis->title->Set('x10,000 US$'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTickLabels($datax); //$graph->xaxis->SetTextTickInterval(2); diff --git a/Examples/examples_bar/example18.php b/Examples/examples_bar/example18.php index 81e0629e..141ff7f4 100644 --- a/Examples/examples_bar/example18.php +++ b/Examples/examples_bar/example18.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Add a drop shadow @@ -30,9 +31,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example19.1.php b/Examples/examples_bar/example19.1.php index bdfe1e52..1abf07f3 100644 --- a/Examples/examples_bar/example19.1.php +++ b/Examples/examples_bar/example19.1.php @@ -1,19 +1,20 @@ SetScale('intlin'); // Add a drop shadow @@ -33,9 +34,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example19.php b/Examples/examples_bar/example19.php index 41147a8b..3cd3051b 100644 --- a/Examples/examples_bar/example19.php +++ b/Examples/examples_bar/example19.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Add a drop shadow @@ -33,9 +34,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.1.php b/Examples/examples_bar/example20.1.php index 5e793864..34f4f535 100644 --- a/Examples/examples_bar/example20.1.php +++ b/Examples/examples_bar/example20.1.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Add a drop shadow @@ -34,9 +35,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.2.php b/Examples/examples_bar/example20.2.php index 460d2ba7..ae71fbd0 100644 --- a/Examples/examples_bar/example20.2.php +++ b/Examples/examples_bar/example20.2.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->yaxis->scale->SetGrace(20); @@ -35,9 +36,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.3.php b/Examples/examples_bar/example20.3.php index 3fd479fc..9bb417b2 100644 --- a/Examples/examples_bar/example20.3.php +++ b/Examples/examples_bar/example20.3.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->yaxis->scale->SetGrace(20); @@ -29,7 +30,11 @@ // Adjust fill color $bplot->SetFillColor('orange'); $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $bplot->value->SetAngle(45); $bplot->value->SetFormat('%0.1f'); $graph->Add($bplot); @@ -38,9 +43,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.4.php b/Examples/examples_bar/example20.4.php index 4c2ed6c4..efd4baa3 100644 --- a/Examples/examples_bar/example20.4.php +++ b/Examples/examples_bar/example20.4.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->yaxis->scale->SetGrace(20); @@ -30,7 +31,11 @@ $bplot->SetFillColor('orange'); $bplot->SetShadow(); $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $bplot->value->SetAngle(45); $bplot->value->SetFormat('%0.1f'); $graph->Add($bplot); @@ -39,9 +44,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.5.php b/Examples/examples_bar/example20.5.php index 242b3a3e..60c51195 100644 --- a/Examples/examples_bar/example20.5.php +++ b/Examples/examples_bar/example20.5.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Add a drop shadow @@ -31,7 +32,10 @@ // Setup values $bplot->value->Show(); $bplot->value->SetFormat('%d'); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Center the values in the bar $bplot->SetValuePos('center'); @@ -45,9 +49,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example20.php b/Examples/examples_bar/example20.php index 59ae6352..bdcfce83 100644 --- a/Examples/examples_bar/example20.php +++ b/Examples/examples_bar/example20.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Add a drop shadow @@ -34,9 +35,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example21.php b/Examples/examples_bar/example21.php index f592b84a..e1cf16df 100644 --- a/Examples/examples_bar/example21.php +++ b/Examples/examples_bar/example21.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetShadow(); @@ -36,9 +37,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example22.php b/Examples/examples_bar/example22.php index 02fcf748..8581ce8c 100644 --- a/Examples/examples_bar/example22.php +++ b/Examples/examples_bar/example22.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetShadow(); @@ -37,9 +38,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example23.php b/Examples/examples_bar/example23.php index 2189f4a7..6912b1d4 100644 --- a/Examples/examples_bar/example23.php +++ b/Examples/examples_bar/example23.php @@ -1,22 +1,26 @@ SetScale('textlin'); $graph->SetShadow(); @@ -38,9 +42,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example24.php b/Examples/examples_bar/example24.php index c986035b..d709876a 100644 --- a/Examples/examples_bar/example24.php +++ b/Examples/examples_bar/example24.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetShadow(); @@ -45,9 +46,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example25.1.php b/Examples/examples_bar/example25.1.php index 261c1805..663f70c0 100644 --- a/Examples/examples_bar/example25.1.php +++ b/Examples/examples_bar/example25.1.php @@ -1,10 +1,11 @@ SetScale('textlin'); // Add a drop shadow @@ -31,7 +32,10 @@ $txt = new Text\Text('This is a text'); $txt->SetPos(10, 20); $txt->SetColor('darkred'); -$txt->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$txt->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $txt->SetBox('yellow', 'navy', 'gray@0.5'); $graph->AddText($txt); @@ -39,9 +43,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example25.2.php b/Examples/examples_bar/example25.2.php index 30d58a9b..3181f01b 100644 --- a/Examples/examples_bar/example25.2.php +++ b/Examples/examples_bar/example25.2.php @@ -1,10 +1,11 @@ SetScale('textlin'); // Add a drop shadow @@ -30,7 +31,10 @@ // Create and add a new text $txt = new Text\Text("This is a text\nwith many\nand even\nmore\nlines of text"); $txt->SetPos(0.5, 0.5, 'center', 'center'); -$txt->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$txt->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $txt->ParagraphAlign('center'); $txt->SetBox('yellow', 'navy', 'gray'); $txt->SetColor('red'); @@ -40,9 +44,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/example25.php b/Examples/examples_bar/example25.php index 3b1f0dee..51a11b45 100644 --- a/Examples/examples_bar/example25.php +++ b/Examples/examples_bar/example25.php @@ -1,10 +1,11 @@ SetScale('textlin'); // Add a drop shadow @@ -31,16 +32,28 @@ $txt = new Text\Text('This is a text'); $txt->SetPos(0, 20); $txt->SetColor('darkred'); -$txt->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$txt->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->AddText($txt); // Setup the titles$example_title='A simple bar graph'; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_bar/groupbar1.php b/Examples/examples_bar/groupbar1.php index faa1cde5..da50b92b 100644 --- a/Examples/examples_bar/groupbar1.php +++ b/Examples/examples_bar/groupbar1.php @@ -1,11 +1,12 @@ SetScale('textlin'); $graph->SetShadow(); $graph->img->SetMargin(40, 30, 40, 40); $graph->xaxis->SetTickLabels($graph->gDateLocale->GetShortMonth()); $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Group bar plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $bplot1 = new Plot\BarPlot($datay1); $bplot2 = new Plot\BarPlot($datay2); diff --git a/Examples/examples_bar/horizbarex4.php b/Examples/examples_bar/horizbarex4.php index cefad2c6..6f6b9053 100644 --- a/Examples/examples_bar/horizbarex4.php +++ b/Examples/examples_bar/horizbarex4.php @@ -1,7 +1,7 @@ SetScale('textlin'); -$top = 60; +$top = 60; $bottom = 30; -$left = 80; -$right = 30; +$left = 80; +$right = 30; $graph->Set90AndMargin($left, $right, $top, $bottom); // Nice shadow diff --git a/Examples/examples_bar/manual_textscale_ex2.php b/Examples/examples_bar/manual_textscale_ex2.php index d71589e0..9725a79c 100644 --- a/Examples/examples_bar/manual_textscale_ex2.php +++ b/Examples/examples_bar/manual_textscale_ex2.php @@ -1,23 +1,25 @@ SetShadow(); // Some data $databary = []; -for ($i = 0; $i < 12; ++$i) { - $databary[$i] = rand(1, 20); + +for ($i = 0; 12 > $i; ++$i) { + $databary[$i] = \mt_rand(1, 20); } $months = $graph->gDateLocale->GetShortMonth(); // Use a text X-scale @@ -32,7 +34,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/manual_textscale_ex3.php b/Examples/examples_bar/manual_textscale_ex3.php index d948728c..add140c1 100644 --- a/Examples/examples_bar/manual_textscale_ex3.php +++ b/Examples/examples_bar/manual_textscale_ex3.php @@ -1,23 +1,25 @@ SetShadow(); // Some data $databary = []; -for ($i = 0; $i < 12; ++$i) { - $databary[$i] = rand(1, 20); + +for ($i = 0; 12 > $i; ++$i) { + $databary[$i] = \mt_rand(1, 20); } $months = $graph->gDateLocale->GetShortMonth(); // Use a text X-scale @@ -32,7 +34,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/manual_textscale_ex4.php b/Examples/examples_bar/manual_textscale_ex4.php index 47cc3df6..9a9b3700 100644 --- a/Examples/examples_bar/manual_textscale_ex4.php +++ b/Examples/examples_bar/manual_textscale_ex4.php @@ -1,27 +1,30 @@ SetShadow(); // Some data $months = []; -$datay = []; -$m = $graph->gDateLocale->GetShortMonth(); -$k = 0; -for ($i = 0; $i < 480; ++$i) { - $datay[$i] = rand(1, 40); +$datay = []; +$m = $graph->gDateLocale->GetShortMonth(); +$k = 0; + +for ($i = 0; 480 > $i; ++$i) { + $datay[$i] = \mt_rand(1, 40); + if ($i % Graph\Configs::getConfig('DATAPERMONTH') === 0) { $months[$i] = $m[(int) ($i / Graph\Configs::getConfig('DATAPERMONTH'))]; } else { @@ -34,7 +37,10 @@ // Specify X-labels $graph->xaxis->SetTickLabels($months); -$graph->xaxis->SetTextTickInterval(Graph\Configs::getConfig('DATAPERMONTH'), 0); +$graph->xaxis->SetTextTickInterval( + Graph\Configs::getConfig('DATAPERMONTH'), + 0 +); $graph->xaxis->SetTextLabelInterval(2); // Set title and subtitle @@ -42,7 +48,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->SetBox(true, 'red'); diff --git a/Examples/examples_bar/negbarvalueex01.php b/Examples/examples_bar/negbarvalueex01.php index 084cbd91..d18c0593 100644 --- a/Examples/examples_bar/negbarvalueex01.php +++ b/Examples/examples_bar/negbarvalueex01.php @@ -1,19 +1,20 @@ img->SetMargin(60, 30, 40, 40); $graph->SetScale('textlin'); $graph->SetShadow(); @@ -37,10 +38,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $example_title = 'Example of bar plot with absolute labels'; $graph->title->set($example_title); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->Stroke(); diff --git a/Examples/examples_bar/new_bar3.php b/Examples/examples_bar/new_bar3.php index 0a29eb48..dea7d548 100644 --- a/Examples/examples_bar/new_bar3.php +++ b/Examples/examples_bar/new_bar3.php @@ -1,7 +1,7 @@ SetScale('textlin'); //$theme_class=DefaultTheme; diff --git a/Examples/examples_bar/no_dim_bartutex5.php b/Examples/examples_bar/no_dim_bartutex5.php index b1c500c9..8b467c1b 100644 --- a/Examples/examples_bar/no_dim_bartutex5.php +++ b/Examples/examples_bar/no_dim_bartutex5.php @@ -1,27 +1,29 @@ SetShadow(); // Some data $databary = []; $databarx = []; -$months = $graph->gDateLocale->GetShortMonth(); +$months = $graph->gDateLocale->GetShortMonth(); + +\mt_srand((float) \microtime() * 1000000); -srand((float) microtime() * 1000000); -for ($i = 0; $i < 25; ++$i) { - $databary[] = rand(1, 50); +for ($i = 0; 25 > $i; ++$i) { + $databary[] = \mt_rand(1, 50); $databarx[] = $months[$i % 12]; } // Use a text X-scale @@ -37,7 +39,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/no_dim_bartutex6.php b/Examples/examples_bar/no_dim_bartutex6.php index 00471ff5..5911b519 100644 --- a/Examples/examples_bar/no_dim_bartutex6.php +++ b/Examples/examples_bar/no_dim_bartutex6.php @@ -1,26 +1,28 @@ SetShadow(); // Some data $databary = []; $databarx = []; -$months = $graph->gDateLocale->GetShortMonth(); -srand((float) microtime() * 1000000); -for ($i = 0; $i < 25; ++$i) { - $databary[] = rand(1, 50); +$months = $graph->gDateLocale->GetShortMonth(); +\mt_srand((float) \microtime() * 1000000); + +for ($i = 0; 25 > $i; ++$i) { + $databary[] = \mt_rand(1, 50); $databarx[] = $months[$i % 12]; } // Use a text X-scale @@ -38,7 +40,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/no_dim_grace_ex0.php b/Examples/examples_bar/no_dim_grace_ex0.php index 5c59bbd8..ece88afa 100644 --- a/Examples/examples_bar/no_dim_grace_ex0.php +++ b/Examples/examples_bar/no_dim_grace_ex0.php @@ -1,10 +1,11 @@ img->SetMargin(40, 30, 40, 50); $graph->SetScale('textint'); $graph->SetFrame(true, 'blue', 1); @@ -24,7 +25,9 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->SetColor('darkblue', 'black'); // Setup hidden y-axis by given it the same color @@ -34,10 +37,16 @@ $graph->ygrid->SetColor('white'); // Setup graph title ands fonts$example_title='Using grace = 0'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Year 2002', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Add some grace to the top so that the scale doesn't // end exactly at the max value. @@ -53,7 +62,11 @@ // Setup the values that are displayed on top of each bar // Must use TTF fonts if we want text at an arbitrary angle $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $bplot->value->SetFormat('$%d'); $bplot->value->SetColor('darkred'); $bplot->value->SetAngle(45); diff --git a/Examples/examples_bar/no_dim_grace_ex1.php b/Examples/examples_bar/no_dim_grace_ex1.php index b5048093..5dcdbc15 100644 --- a/Examples/examples_bar/no_dim_grace_ex1.php +++ b/Examples/examples_bar/no_dim_grace_ex1.php @@ -1,10 +1,11 @@ img->SetMargin(40, 30, 40, 50); $graph->SetScale('textint'); $graph->SetFrame(true, 'blue', 1); @@ -24,7 +25,9 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->SetColor('darkblue', 'black'); // Setup hidden y-axis by given it the same color @@ -34,10 +37,16 @@ $graph->ygrid->SetColor('white'); // Setup graph title ands fonts$example_title='Using grace = 10%'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Year 2002', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Add some grace to the top so that the scale doesn't // end exactly at the max value. @@ -53,7 +62,11 @@ // Setup the values that are displayed on top of each bar // Must use TTF fonts if we want text at an arbitrary angle $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $bplot->value->SetFormat('$%d'); $bplot->value->SetColor('darkred'); $bplot->value->SetAngle(45); diff --git a/Examples/examples_bar/no_dim_grace_ex2.php b/Examples/examples_bar/no_dim_grace_ex2.php index 174d1c1b..6731bc5e 100644 --- a/Examples/examples_bar/no_dim_grace_ex2.php +++ b/Examples/examples_bar/no_dim_grace_ex2.php @@ -1,10 +1,11 @@ img->SetMargin(40, 30, 40, 50); $graph->SetScale('textint'); $graph->SetFrame(true, 'blue', 1); @@ -24,7 +25,9 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->SetColor('darkblue', 'black'); // Setup hidden y-axis by given it the same color @@ -34,10 +37,16 @@ $graph->ygrid->SetColor('white'); // Setup graph title ands fonts$example_title='Using grace = 50%'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Year 2002', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Add some grace to the top so that the scale doesn't // end exactly at the max value. @@ -53,7 +62,11 @@ // Setup the values that are displayed on top of each bar // Must use TTF fonts if we want text at an arbitrary angle $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $bplot->value->SetFormat('$%d'); $bplot->value->SetColor('darkred'); $bplot->value->SetAngle(45); diff --git a/Examples/examples_bar/no_dim_grace_ex3.php b/Examples/examples_bar/no_dim_grace_ex3.php index 83639070..6d091db5 100644 --- a/Examples/examples_bar/no_dim_grace_ex3.php +++ b/Examples/examples_bar/no_dim_grace_ex3.php @@ -1,10 +1,11 @@ img->SetMargin(40, 30, 40, 50); $graph->SetScale('textint'); $graph->SetFrame(true, 'blue', 1); @@ -24,7 +25,9 @@ // Setup X-axis labels $a = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($a); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->SetColor('darkblue', 'black'); // Setup hidden y-axis by given it the same color @@ -34,10 +37,16 @@ $graph->ygrid->SetColor('white'); // Setup graph title ands fonts$example_title='Using grace = 100%'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Year 2002', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Add some grace to the top so that the scale doesn't // end exactly at the max value. @@ -53,7 +62,11 @@ // Setup the values that are displayed on top of each bar // Must use TTF fonts if we want text at an arbitrary angle $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $bplot->value->SetFormat('$%d'); $bplot->value->SetColor('darkred'); $bplot->value->SetAngle(45); diff --git a/Examples/examples_bar/no_dim_horizbarex1.php b/Examples/examples_bar/no_dim_horizbarex1.php index 11391697..ec4912dd 100644 --- a/Examples/examples_bar/no_dim_horizbarex1.php +++ b/Examples/examples_bar/no_dim_horizbarex1.php @@ -1,10 +1,11 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Setup X-axis $graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Some extra margin looks nicer $graph->xaxis->SetLabelMargin(10); @@ -57,7 +66,11 @@ // We want to display the value of each bar at the top $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $bplot->value->SetAlign('left', 'center'); $bplot->value->SetColor('black', 'darkred'); $bplot->value->SetFormat('%.1f mkr'); diff --git a/Examples/examples_bar/no_dim_horizbarex2.php b/Examples/examples_bar/no_dim_horizbarex2.php index 21250ea5..89b1a17e 100644 --- a/Examples/examples_bar/no_dim_horizbarex2.php +++ b/Examples/examples_bar/no_dim_horizbarex2.php @@ -1,27 +1,28 @@ SetScale('textlin'); -$top = 80; +$top = 80; $bottom = 30; -$left = 50; -$right = 30; +$left = 50; +$right = 30; $graph->Set90AndMargin($left, $right, $top, $bottom); // Nice shadow @@ -30,13 +31,21 @@ // Setup title $example_title = 'Horizontal bar graph ex 2'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $subtitle_text = '(Axis at top)'; $graph->subtitle->Set($subtitle_text); // Setup X-axis $graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Some extra margin looks nicer $graph->xaxis->SetLabelMargin(5); @@ -50,7 +59,11 @@ $graph->yaxis->SetLabelAlign('center', 'bottom'); $graph->yaxis->SetLabelAngle(45); $graph->yaxis->SetLabelFormat('%d'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // We don't want to display Y-axis //$graph->yaxis->Hide(); @@ -65,7 +78,11 @@ // We want to display the value of each bar at the top $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $bplot->value->SetAlign('left', 'center'); $bplot->value->SetColor('black', 'darkred'); $bplot->value->SetFormat('%.1f mkr'); diff --git a/Examples/examples_bar/no_dim_horizbarex3.php b/Examples/examples_bar/no_dim_horizbarex3.php index 700da1ff..c432d0f2 100644 --- a/Examples/examples_bar/no_dim_horizbarex3.php +++ b/Examples/examples_bar/no_dim_horizbarex3.php @@ -1,10 +1,11 @@ SetScale('textlin'); -$top = 50; +$top = 50; $bottom = 80; -$left = 50; -$right = 20; +$left = 50; +$right = 20; $graph->Set90AndMargin($left, $right, $top, $bottom); $graph->xaxis->SetPos('min'); @@ -33,13 +34,21 @@ // Setup title $example_title = 'Horizontal bar graph ex 3'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $subtitle_text = '(Axis at bottom)'; $graph->subtitle->Set($subtitle_text); // Setup X-axis $graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Some extra margin looks nicer $graph->xaxis->SetLabelMargin(5); @@ -59,13 +68,19 @@ // First make the labels look right $graph->yaxis->SetLabelAlign('center', 'top'); $graph->yaxis->SetLabelFormat('%d'); -$graph->yaxis->SetLabelSide(Graph\Configs::getConfig('SIDE_RIGHT')); +$graph->yaxis->SetLabelSide( + Graph\Configs::getConfig('SIDE_RIGHT') +); // The fix the tick marks -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Finally setup the title -$graph->yaxis->SetTitleSide(Graph\Configs::getConfig('SIDE_RIGHT')); +$graph->yaxis->SetTitleSide( + Graph\Configs::getConfig('SIDE_RIGHT') +); $graph->yaxis->SetTitleMargin(35); // To align the title to the right use : @@ -76,10 +91,17 @@ //$graph->yaxis->SetTitle('Turnaround 2002','center'); //$graph->yaxis->title->Align('center'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->yaxis->title->SetAngle(0); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_NORMAL') +); // If you want the labels at an angle other than 0 or 90 // you need to use TTF fonts //$graph->yaxis->SetLabelAngle(0); @@ -94,7 +116,11 @@ // We want to display the value of each bar at the top $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $bplot->value->SetAlign('left', 'center'); $bplot->value->SetColor('black', 'darkred'); $bplot->value->SetFormat('%.1f mkr'); diff --git a/Examples/examples_bar/no_dim_horizbarex6.php b/Examples/examples_bar/no_dim_horizbarex6.php index 25ec9ab7..5c3eabbe 100644 --- a/Examples/examples_bar/no_dim_horizbarex6.php +++ b/Examples/examples_bar/no_dim_horizbarex6.php @@ -1,20 +1,23 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $subtitle_text = '(Non optimized)'; $graph->subtitle->Set($subtitle_text); // Setup X-axis $graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); // Some extra margin looks nicer $graph->xaxis->SetLabelMargin(10); @@ -72,7 +83,11 @@ // We want to display the value of each bar at the top $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); //$bplot->value->SetAlign('left','center'); $bplot->value->SetColor('white'); $bplot->value->SetFormat('%.1f'); @@ -84,7 +99,11 @@ // Add some explanation text $txt = new Text\Text('Note: Higher value is better.'); $txt->SetPos(190, 399, 'center', 'bottom'); -$txt->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$txt->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->Add($txt); // .. and stroke the graph diff --git a/Examples/examples_bar/no_dim_logbarex1.php b/Examples/examples_bar/no_dim_logbarex1.php index 3f847e71..af2c4543 100644 --- a/Examples/examples_bar/no_dim_logbarex1.php +++ b/Examples/examples_bar/no_dim_logbarex1.php @@ -1,11 +1,12 @@ img->SetMargin(50,30,50,50); $graph->SetScale('textlog'); //$graph->SetShadow(); // Setup titles for graph and axis$example_title='Bar with logarithmic Y-scale'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 18 +); $graph->xaxis->SetTitle('2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->yaxis->SetTitle('Y-title', 'center'); $graph->yaxis->SetTitleMargin(30); @@ -43,7 +56,8 @@ /* $bplot->SetShadow(); $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'),FS_BOLD); +$bplot->value->SetFont( +Graph\Configs::getConfig('FF_ARIAL'),FS_BOLD); $bplot->value->SetAngle(45); $bplot->value->SetColor(black,darkred); */ diff --git a/Examples/examples_bar/no_dim_manual_textscale_ex1.php b/Examples/examples_bar/no_dim_manual_textscale_ex1.php index e31e76f3..f18165ab 100644 --- a/Examples/examples_bar/no_dim_manual_textscale_ex1.php +++ b/Examples/examples_bar/no_dim_manual_textscale_ex1.php @@ -1,22 +1,23 @@ SetShadow(); // Some data $databary = [12, 7, 16, 6, 7, 14, 9, 3]; -$months = $graph->gDateLocale->GetShortMonth(); +$months = $graph->gDateLocale->GetShortMonth(); // Use a text X-scale $graph->SetScale('textlin'); @@ -28,7 +29,10 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the bar plot $b1 = new Plot\BarPlot($databary); diff --git a/Examples/examples_bar/no_test_new_bar1.php b/Examples/examples_bar/no_test_new_bar1.php index 6823710e..067533e7 100644 --- a/Examples/examples_bar/no_test_new_bar1.php +++ b/Examples/examples_bar/no_test_new_bar1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $theme_class = new UniversalTheme(); diff --git a/Examples/examples_bar/no_test_new_bar4.php b/Examples/examples_bar/no_test_new_bar4.php index 22c2d761..c0ff2744 100644 --- a/Examples/examples_bar/no_test_new_bar4.php +++ b/Examples/examples_bar/no_test_new_bar4.php @@ -1,7 +1,7 @@ SetScale('textlin'); $theme_class = new UniversalTheme(); diff --git a/Examples/examples_bar/no_test_new_bar6.php b/Examples/examples_bar/no_test_new_bar6.php index e3c5d48e..35ec01df 100644 --- a/Examples/examples_bar/no_test_new_bar6.php +++ b/Examples/examples_bar/no_test_new_bar6.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetY2Scale('lin', 0, 90); $graph->SetY2OrderBack(false); @@ -39,7 +41,7 @@ $graph->y2axis->SetTickPositions([30, 40, 50, 60, 70, 80, 90]); $months = $graph->gDateLocale->GetShortMonth(); -$months = array_merge(array_slice($months, 3, 9), array_slice($months, 0, 3)); +$months = \array_merge(\array_slice($months, 3, 9), \array_slice($months, 0, 3)); $graph->SetBox(false); $graph->ygrid->SetFill(false); @@ -61,7 +63,7 @@ // Create the grouped bar plot $gbbplot = new Plot\AccBarPlot([$b3plot, $b4plot, $b5plot]); -$gbplot = new Plot\GroupBarPlot([$b1plot, $b2plot, $gbbplot]); +$gbplot = new Plot\GroupBarPlot([$b1plot, $b2plot, $gbbplot]); // ...and add it to the graPH $graph->Add($gbplot); @@ -90,7 +92,11 @@ $lplot->SetBarCenter(); $lplot->SetColor('yellow'); $lplot->SetLegend('Houses'); -$lplot->mark->SetType(Graph\Configs::getConfig('MARK_X'), '', 1.0); +$lplot->mark->SetType( + Graph\Configs::getConfig('MARK_X'), + '', + 1.0 +); $lplot->mark->SetWeight(2); $lplot->mark->SetWidth(8); $lplot->mark->setColor('yellow'); @@ -100,9 +106,17 @@ $graph->legend->SetColumns(6); $graph->legend->SetColor('#4E4E4E', '#00A78A'); -$band = new Plot\PlotBand(Graph\Configs::getConfig('VERTICAL'), Graph\Configs::getConfig('BAND_RDIAG'), 11, 'max', 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('VERTICAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 11, + 'max', + 'khaki4' +); $band->ShowFrame(true); -$band->SetOrder(Graph\Configs::getConfig('DEPTH_BACK')); +$band->SetOrder( + Graph\Configs::getConfig('DEPTH_BACK') +); $graph->Add($band); $example_title = 'Combineed Line and Bar plots'; $graph->title->set($example_title); diff --git a/Examples/examples_bar/plotbanddensity_ex0.php b/Examples/examples_bar/plotbanddensity_ex0.php index 7d709fee..536979ff 100644 --- a/Examples/examples_bar/plotbanddensity_ex0.php +++ b/Examples/examples_bar/plotbanddensity_ex0.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 25); $graph->SetBox(true); @@ -31,13 +32,23 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 15, + 35, + 'khaki4' +); $band->SetDensity(10); $band->ShowFrame(true); $graph->AddBand($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_3DPLANE, Density=10'; $graph->title->set($example_title); diff --git a/Examples/examples_bar/plotbanddensity_ex1.php b/Examples/examples_bar/plotbanddensity_ex1.php index 7744f1db..7a1ee958 100644 --- a/Examples/examples_bar/plotbanddensity_ex1.php +++ b/Examples/examples_bar/plotbanddensity_ex1.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 25); $graph->SetBox(true); @@ -31,13 +32,23 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 15, + 35, + 'khaki4' +); $band->SetDensity(40); $band->ShowFrame(true); $graph->AddBand($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_3DPLANE, Density=40'; $graph->title->set($example_title); diff --git a/Examples/examples_bar/plotbanddensity_ex2.php b/Examples/examples_bar/plotbanddensity_ex2.php index 4b3bdcc5..9fa613ff 100644 --- a/Examples/examples_bar/plotbanddensity_ex2.php +++ b/Examples/examples_bar/plotbanddensity_ex2.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 25); $graph->SetBox(true); @@ -30,13 +31,23 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 15, + 35, + 'khaki4' +); $band->SetDensity(80); $band->ShowFrame(true); $graph->AddBand($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_3DPLANE, Density=80'; $graph->title->set($example_title); diff --git a/Examples/examples_canvas/canvasbezierex1.php b/Examples/examples_canvas/canvasbezierex1.php index 594b27f5..86de5d44 100644 --- a/Examples/examples_canvas/canvasbezierex1.php +++ b/Examples/examples_canvas/canvasbezierex1.php @@ -1,7 +1,7 @@ SetScale(); -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $example_title = 'Bezier line with control points'; $g->title->set($example_title); diff --git a/Examples/examples_canvas/canvasex05.php b/Examples/examples_canvas/canvasex05.php index 8498d46c..a1d0b2e4 100644 --- a/Examples/examples_canvas/canvasex05.php +++ b/Examples/examples_canvas/canvasex05.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); @@ -29,7 +29,7 @@ // The shape class is wrapper around the Imgae class which translates // the coordinates for us -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $shape->SetColor('black'); // Add a black line diff --git a/Examples/examples_canvas/canvasex06.php b/Examples/examples_canvas/canvasex06.php index 4d182f34..7ce73625 100644 --- a/Examples/examples_canvas/canvasex06.php +++ b/Examples/examples_canvas/canvasex06.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); @@ -29,7 +29,7 @@ // The shape class is wrapper around the Imgae class which translates // the coordinates for us -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $shape->SetColor('black'); $shape->IndentedRectangle(1, 2, 15, 15, 8, 8, Graph\Configs::getConfig('CORNER_TOPLEFT'), 'khaki'); diff --git a/Examples/examples_canvas/canvaspiralex1.php b/Examples/examples_canvas/canvaspiralex1.php index 8b7f7c53..e259ed50 100644 --- a/Examples/examples_canvas/canvaspiralex1.php +++ b/Examples/examples_canvas/canvaspiralex1.php @@ -1,7 +1,7 @@ $w) { $w = 60; } -if ($h < 60) { + +if (60 > $h) { $h = 60; } -$__width = $w; +$__width = $w; $__height = $h; -function SeaShell($img, $x, $y, $w, $h, $r, $n = 12, $color1 = 'navy', $color2 = 'red') -{ - $x += $w; - $w = (1 - $r) / $r * $w; +if (!\function_exists('SeaShell')) { + function SeaShell($img, $x, $y, $w, $h, $r, $n = 12, $color1 = 'navy', $color2 = 'red') + { + $x += $w; + $w = (1 - $r) / $r * $w; - $sa = 0; - $ea = 90; + $sa = 0; + $ea = 90; - $s1 = 1; - $s2 = -1; - $x_old = $x; - $y_old = $y; - for ($i = 1; $i < $n; ++$i) { - $sa += 90; - $ea += 90; - if ($i % 2 == 1) { - $y = $y + $s1 * $h * $r; - $h = (1 - $r) * $h; - $w = $w / (1 - $r) * $r; - $s1 *= -1; - $img->SetColor($color1); - $img->Line($x, $y, $x + $s1 * $w, $y); - } else { - $x = $x + $s2 * $w * $r; - $w = (1 - $r) * $w; - $h = $h / (1 - $r) * $r; - $s2 *= -1; - $img->SetColor($color1); - $img->Line($x, $y, $x, $y - $s2 * $h); - } - $img->SetColor($color2); - $img->FilledRectangle($x - 1, $y - 1, $x + 1, $y + 1); - $img->Arc($x, $y, 2 * $w + 1, 2 * $h + 1, $sa, $ea); - $img->Arc($x, $y, 2 * $w, 2 * $h, $sa, $ea); - $img->Arc($x, $y, 2 * $w - 1, 2 * $h - 1, $sa, $ea); - $img->Line($x_old, $y_old, $x, $y); + $s1 = 1; + $s2 = -1; $x_old = $x; $y_old = $y; + + for ($i = 1; $i < $n; ++$i) { + $sa += 90; + $ea += 90; + + if ($i % 2 === 1) { + $y = $y + $s1 * $h * $r; + $h = (1 - $r) * $h; + $w = $w / (1 - $r) * $r; + $s1 *= -1; + $img->SetColor($color1); + $img->Line($x, $y, $x + $s1 * $w, $y); + } else { + $x = $x + $s2 * $w * $r; + $w = (1 - $r) * $w; + $h = $h / (1 - $r) * $r; + $s2 *= -1; + $img->SetColor($color1); + $img->Line($x, $y, $x, $y - $s2 * $h); + } + $img->SetColor($color2); + $img->FilledRectangle($x - 1, $y - 1, $x + 1, $y + 1); + $img->Arc($x, $y, 2 * $w + 1, 2 * $h + 1, $sa, $ea); + $img->Arc($x, $y, 2 * $w, 2 * $h, $sa, $ea); + $img->Arc($x, $y, 2 * $w - 1, 2 * $h - 1, $sa, $ea); + $img->Line($x_old, $y_old, $x, $y); + $x_old = $x; + $y_old = $y; + } } } - $g = new Graph\CanvasGraph($__width, $__height); //$gr = 1.61803398874989484820; $example_title = 'Canvas Spiral'; @@ -83,7 +87,10 @@ function SeaShell($img, $x, $y, $w, $h, $r, $n = 12, $color1 = 'navy', $color2 = $p = SeaShell($g->img, 0, 20, $w - 1, $h - 21, $r, 19); $g->img->SetColor('black'); $g->img->Rectangle(0, 20, $w - 1, $h - 1); -$g->img->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$g->img->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $g->img->SetTextAlign('center', 'top'); $g->img->StrokeText($w / 2, 0, $example_title); diff --git a/Examples/examples_canvas/example_canvas_mkgrad.php b/Examples/examples_canvas/example_canvas_mkgrad.php index 6f449a8b..37ff8aeb 100644 --- a/Examples/examples_canvas/example_canvas_mkgrad.php +++ b/Examples/examples_canvas/example_canvas_mkgrad.php @@ -1,7 +1,7 @@ iColors = array_keys($rgb->rgb_table); - usort($this->iColors, '_cmp'); + $rgb = new Image\RGB(); + $this->iColors = \array_keys($rgb->rgb_table); + \usort($this->iColors, '_cmp'); $this->iGradstyles = [ 'Vertical', 2, @@ -47,7 +48,7 @@ public function __construct() public function Run($example_title) { - echo "

${example_title}

"; + echo "

{$example_title}

"; echo '
'; echo ''; echo "\n"; @@ -81,14 +82,16 @@ public function GenHTMLInput($name, $len, $maxlen = 100, $val = '') public function GenHTMLSelect($name, $option, $selected = '', $size = 0) { - $txt = " $i; ++$i) { + if ($selected === $option[$i]) { $txt = $txt . "\n"; } else { $txt = $txt . '\n"; @@ -100,14 +103,16 @@ public function GenHTMLSelect($name, $option, $selected = '', $size = 0) public function GenHTMLSelectCode($name, $option, $selected = '', $size = 0) { - $txt = " $i; $i += 2) { + if ($option[($i + 1)] === $selected) { $txt = $txt . '\n"; @@ -123,12 +128,19 @@ public function GenHTMLSelectCode($name, $option, $selected = '', $size = 0) class Driver { public $iGraph; + public $iGrad; + public $iWidth; + public $iHeight; + public $iFromColor; + public $iToColor; + public $iStyle; + public $iForm; public function __construct() @@ -138,21 +150,21 @@ public function __construct() public function GenGradImage($aWidth = null, $aHeight = null) { - $aWidth = $aWidth ? $aWidth : (int) @$_POST['w']; - $aHeight = $aHeight ? $aHeight : (int) @$_POST['h']; - $aFrom = isset($_POST['fc']) ? @$_POST['fc'] : $this->iForm->iColors[0]; - $aTo = isset($_POST['tc']) ? @$_POST['tc'] : $this->iForm->iColors[0]; - $aStyle = isset($_POST['s']) ? @$_POST['s'] : '2'; - $aFileName = isset($_POST['fn']) ? @$_POST['fn'] : ''; - - $this->iWidth = $aWidth; - $this->iHeight = $aHeight; + $aWidth = $aWidth ?: (int) $_POST['w']; + $aHeight = $aHeight ?: (int) $_POST['h']; + $aFrom = $_POST['fc'] ?? $this->iForm->iColors[0]; + $aTo = $_POST['tc'] ?? $this->iForm->iColors[0]; + $aStyle = $_POST['s'] ?? '2'; + $aFileName = $_POST['fn'] ?? ''; + + $this->iWidth = $aWidth; + $this->iHeight = $aHeight; $this->iFromColor = $aFrom; - $this->iToColor = $aTo; - $this->iStyle = $aStyle; + $this->iToColor = $aTo; + $this->iStyle = $aStyle; $this->graph = new Graph\CanvasGraph($aWidth, $aHeight); - $this->grad = new Plot\Gradient($this->graph->img); + $this->grad = new Plot\Gradient($this->graph->img); $this->grad->FilledRectangle( 0, 0, @@ -163,9 +175,9 @@ public function GenGradImage($aWidth = null, $aHeight = null) $this->iStyle ); - if ($aFileName != '') { + if ('' !== $aFileName) { $this->graph->Stroke($aFileName); - echo "Image file '${aFileName}' created."; + echo "Image file '{$aFileName}' created."; } else { $this->graph->Stroke(); } @@ -182,15 +194,15 @@ public function Run($example_title, $inmediate, $aWidth, $aHeight) // we are called to do the image. if ($inmediate) { $this->GenGradImage($aWidth, $aHeight); - } elseif (@$_POST['ok'] === ' Ok ') { + } elseif (' Ok ' === $_POST['ok']) { $this->GenGradImage($aWidth, $aHeight); } else { $this->iForm->Run($example_title); } } } -defined('TEST_INMEDIATE') || define('TEST_INMEDIATE', true); -$driver = new Driver(); -$__width = 300; +\defined('TEST_INMEDIATE') || \define('TEST_INMEDIATE', true); +$driver = new Driver(); +$__width = 300; $__height = 300; $driver->Run($example_title, TEST_INMEDIATE, $__width, $__height); diff --git a/Examples/examples_canvas/listfontsex1.php b/Examples/examples_canvas/listfontsex1.php index b63cb8c5..e99cbf80 100644 --- a/Examples/examples_canvas/listfontsex1.php +++ b/Examples/examples_canvas/listfontsex1.php @@ -1,7 +1,7 @@ SetScale('canvas', 0, 27, 0, 85); $g->SetMargin(5, 6, 5, 6); @@ -21,15 +21,19 @@ $example_title = 'Font demonstration on canvas'; $t = new Text\CanvasRectangleText(); -$t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $t->SetFillColor('lemonchiffon2'); $t->SetFontColor('black'); $t->Set("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTTF Fonts (11pt)", 0.5, 19.5, 26, 64.5); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->SetFillColor('lemonchiffon3'); $t->Set("\n\n\n\nBitmap Fonts", 0.5, 5, 26, 13.5); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t = new Text\CanvasRectangleText(); $t->SetFillColor(''); @@ -37,15 +41,19 @@ $t->SetColor(''); $t->SetShadow(''); -$t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 18); +$t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $t->Set('Normal', 1, 1, 8); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set('Italic style', 9, 1, 8); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set('Bold style', 17.5, 1, 8); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->SetFillColor('yellow'); $t->SetFontColor('black'); @@ -131,10 +139,10 @@ ['DejaVuCond sans serif', Graph\Configs::getConfig('FF_DV_SANSSERIFCOND'), Graph\Configs::getConfig('FS_BOLD')], ]; -$n = count($fonts); +$n = \count($fonts); for ($i = 0; $i < $n; ++$i) { - if ($i == 9) { + if (9 === $i) { $r += 3; } @@ -142,11 +150,12 @@ $t->SetTxt($fonts[$i][0]); $t->SetPos($c, $r, $w, $h); $t->SetFont($fonts[$i][1], $fonts[$i][2], 11); - $t->Stroke($g->img, $g->scale); + $t->Stroke($g->img, $g->getScale()); } $c += $w + 1; - if ($c > 30 - $w - 2) { + + if (30 - $w - 2 < $c) { $c = 1; $r += 4; } diff --git a/Examples/examples_canvas/no_dim_canvas_jpgarchex.php b/Examples/examples_canvas/no_dim_canvas_jpgarchex.php index 8405417d..f5f865b6 100644 --- a/Examples/examples_canvas/no_dim_canvas_jpgarchex.php +++ b/Examples/examples_canvas/no_dim_canvas_jpgarchex.php @@ -1,7 +1,7 @@ SetMargin(2, 3, 2, 3); $g->SetMarginColor('teal'); $g->InitFrame(); @@ -25,23 +25,31 @@ $g->SetScale('canvas', 0, $xmax, 0, $ymax); // ... we need shape since we want the indented rectangle -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $shape->SetColor('black'); // ... basic parameters for the overall image -$l = 2; // Left margin -$r = 18; // Row number to start the lowest line on +$l = 2; // Left margin +$r = 18; // Row number to start the lowest line on $width = 16; // Total width // Setup the two basic rectangle text object we will use $tt = new Text\CanvasRectangleText(); -$tt->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$tt->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 +); $tt->SetFillColor(''); $tt->SetColor(''); $tt->SetFontColor('navy'); $t = new Text\CanvasRectangleText(); -$t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 +); $t->SetFillColor('goldenrod1'); $t->SetFontColor('navy'); @@ -56,14 +64,14 @@ $d = $l + $width - 9; $t->SetFillColor('cadetblue3'); $t->Set('TTF', $d, $r + 2, $s, 1); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set('PNG', $d + $s, $r + 2, $s, 1); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set('JPEG', $d + 2 * $s, $r + 2, $s, 1); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $shape->IndentedRectangle($l, $r, $width, $h, $s * 3, 1, 2, 'lightgreen'); $tt->Set("GD Basic library\n(1.8.x or 2.x)", $l, $r, $width, $h - 1); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); // Area: Basic internal JpGraph architecture $t->SetFillColor('goldenrod1'); @@ -71,25 +79,25 @@ $r -= $h; $d = 8; $t->Set("Image primitives\n(RGB, Anti-aliasing,\nGD Abstraction)", $l, $r - 0.5, $width * 0.5, $h + 0.5); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Image Cache &\nStreaming", $l + 0.5 * $width, $r, $width * 0.4, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $r -= $h; $d = 8; $t->Set('2D Rot & Transformation', $l, $r, $width * 0.5, $h - 0.5); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $r -= 2; $h = 4; $shape->IndentedRectangle($l, $r, $width * 0.9, $h, $d, 2, 3, 'goldenrod1'); $tt->Set('Axis, Labelling, (Auto)-Scaling', $l, $r, $width * 0.9, $h - 2); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); --$r; $shape->IndentedRectangle($l, $r, $width, 7, $width * 0.9, 6, 3, 'goldenrod1'); $tt->Set('Error handling & Utility classes', $l, $r, $width, 1); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); // Area: Top area with graph components $t->SetFillColor('gold1'); @@ -97,66 +105,78 @@ $w = $width * 0.55 / 4; $h = 2; $t->Set("Gantt\nGraph", $l, $r, $w, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Pie\nGraph", $l + $w, $r, $w, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Radar\nGraph", $l + $w * 2, $r, $w, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $shape->IndentedRectangle($l, $r, $width, 3, 4 * $w, 2, 0, 'gold1'); $tt->Set("Base Graph\n(Orthogonal\ncoordinate system)", $l + 4 * $w, $r, $width - $w * 4, 3); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); $r -= 2; $d = 0.7; $shape->IndentedRectangle($l + 3 * $w, $r, $w, 4, $w * $d, 2, 0, 'gold1'); $t->Set("Canv\nUtil", $l + 3 * $w, $r, $w * $d, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $tt->Set("Canvas\nGraph", $l + 3 * $w, $r + 2, $w, 2); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); // Top line of plotting plugins $t->SetFillColor('cyan'); $t->Set("Gantt\nPlot", $l, $r, $w, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("2D\nPlot", $l + $w, $r, $w / 2, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("3D\nPlot", $l + $w + $w / 2, $r, $w / 2, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Radar\nPlot", $l + 2 * $w, $r, $w, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $wp = ($width - 4 * $w) / 4; $t->Set("Error\nPlot", $l + 4 * $w, $r, $wp, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Line\nPlot", $l + 4 * $w + $wp, $r, $wp, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Bar\nPlot", $l + 4 * $w + 2 * $wp, $r, $wp, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); $t->Set("Scatter\nPlot", $l + 4 * $w + 3 * $wp, $r, $wp, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); // Show application top $r -= 2.5; $h = 2; $t->SetFillColor('blue'); $t->SetFontColor('white'); -$t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 20); +$t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 20 +); $t->Set('PHP Application', $l, $r, $width, $h); -$t->Stroke($g->img, $g->scale); +$t->Stroke($g->img, $g->getScale()); // Stroke title $r = 0.5; $tt->SetFontColor('black'); -$tt->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_BOLD'), 28); +$tt->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_BOLD'), + 28 +); $tt->Set('JpGraph Architecture Overview', $l, $r, $width, 1); -$tt->Stroke($g->img, $g->scale); +$tt->Stroke($g->img, $g->getScale()); // Stroke footer -$tt->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$tt->Set('Generated: ' . date('ymd H:m', time()), 0.1, $ymax * 0.95); -$tt->Stroke($g->img, $g->scale); +$tt->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$tt->Set('Generated: ' . \date('ymd H:m', \time()), 0.1, $ymax * 0.95); +$tt->Stroke($g->img, $g->getScale()); // .. and stream it all back $g->Stroke(); diff --git a/Examples/examples_canvas/no_dim_canvasex01.php b/Examples/examples_canvas/no_dim_canvasex01.php index 9a7ce52f..4055fce1 100644 --- a/Examples/examples_canvas/no_dim_canvasex01.php +++ b/Examples/examples_canvas/no_dim_canvasex01.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); @@ -23,8 +23,12 @@ // Draw a text box in the middle $txt = "This\nis\na TEXT!!!"; -$t = new Text\Text($txt, 200, 10); -$t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 40); +$t = new Text\Text($txt, 200, 10); +$t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 40 +); // How should the text box interpret the coordinates? $t->Align('center', 'top'); diff --git a/Examples/examples_canvas/no_dim_canvasex02.php b/Examples/examples_canvas/no_dim_canvasex02.php index 4b1cfb44..3e846b3b 100644 --- a/Examples/examples_canvas/no_dim_canvasex02.php +++ b/Examples/examples_canvas/no_dim_canvasex02.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); diff --git a/Examples/examples_canvas/no_dim_canvasex03.php b/Examples/examples_canvas/no_dim_canvasex03.php index 6a0e86fa..d6a3f703 100644 --- a/Examples/examples_canvas/no_dim_canvasex03.php +++ b/Examples/examples_canvas/no_dim_canvasex03.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); @@ -29,7 +29,7 @@ // The shape class is wrapper around the Imgae class which translates // the coordinates for us -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $shape->SetColor('black'); // Add a black line diff --git a/Examples/examples_canvas/no_dim_canvasex04.php b/Examples/examples_canvas/no_dim_canvasex04.php index e096c5d1..7aa4d416 100644 --- a/Examples/examples_canvas/no_dim_canvasex04.php +++ b/Examples/examples_canvas/no_dim_canvasex04.php @@ -1,7 +1,7 @@ SetMargin(5, 11, 6, 11); $g->SetShadow(); $g->SetMarginColor('teal'); @@ -29,7 +29,7 @@ // The shape class is wrapper around the Imgae class which translates // the coordinates for us -$shape = new Graph\Shape($g, $g->scale); +$shape = new Graph\Shape($g, $g->getScale()); $shape->SetColor('black'); // Add a black line diff --git a/Examples/examples_canvas/no_test_colormaps.php b/Examples/examples_canvas/no_test_colormaps.php index 16bd06c8..78f8023b 100644 --- a/Examples/examples_canvas/no_test_colormaps.php +++ b/Examples/examples_canvas/no_test_colormaps.php @@ -1,7 +1,7 @@ img->SetColor('darkgray'); $graph->img->Rectangle(0, 0, $width - 1, $height - 1); $t = new Text($aTitle, $width / 2, 5); $t->SetAlign('center', 'top'); - $t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); + $t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 + ); $t->Stroke($graph->img); // Instantiate a colormap @@ -57,31 +61,43 @@ public function Draw($aTitle, $aStart, $aEnd, $n = 64, $aReverse = false, $addCo for ($mapidx = $aStart; $mapidx <= $aEnd; ++$mapidx, $ys += $ymarg) { $cm->SetMap($mapidx, $aReverse); - $n = $cm->SetNumColors($n); - list($mapidx, $maparray) = $cm->GetCurrMap(); - $ncols = count($maparray); - $colbuckets = $cm->GetBuckets(); + $n = $cm->SetNumColors($n); + [$mapidx, $maparray] = $cm->GetCurrMap(); + $ncols = \count($maparray); + $colbuckets = $cm->GetBuckets(); // The module width will depend on the actual number of colors - $mw = round(($width - $lmarg - $rmarg) / $n); + $mw = \round(($width - $lmarg - $rmarg) / $n); // Draw color map title (name) $t->Set('Basic colors: ' . $ncols . ', Total colors: ' . $n); $t->SetAlign('center', 'bottom'); $t->SetAngle(0); - $t->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 14); + $t->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 + ); $t->Stroke($graph->img, $width / 2, $ys - 3); // Add the name/number of the map to the left $t->SetAlign('right', 'center'); $t->Set('Map: ' . $mapidx); - $t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 14); - $t->Stroke($graph->img, $xs - 20, round($ys + $mh / 2)); + $t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 + ); + $t->Stroke($graph->img, $xs - 20, \round($ys + $mh / 2)); // Setup text properties for the color names if ($addColorNames) { $t->SetAngle(30); - $t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); + $t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 + ); $t->SetAlign('right', 'top'); } @@ -89,14 +105,16 @@ public function Draw($aTitle, $aStart, $aEnd, $n = 64, $aReverse = false, $addCo $x = $xs; $y = $ys; $k = 0; + for ($i = 0; $i < $n; ++$i) { $graph->img->SetColor($colbuckets[$i]); $graph->img->FilledRectangle($x, $y, $x + $mw, $y + $mh); // Mark all basic colors in the map with a bar and name - if ($i % (($n - $ncols) / ($ncols - 1) + 1) == 0) { + if ($i % (($n - $ncols) / ($ncols - 1) + 1) === 0) { $graph->img->SetColor('black'); $graph->img->FilledRectangle($x, $y + $mh + 4, $x + $mw - 1, $y + $mh + 6); + if ($addColorNames) { $t->Set($maparray[$k++]); $t->Stroke($graph->img, $x + $mw / 2, $y + $mh + 10); @@ -117,11 +135,11 @@ public function Draw($aTitle, $aStart, $aEnd, $n = 64, $aReverse = false, $addCo $driver = new ColorMapDriver(); -$title = 'Standard maps'; -$reverse = false; -$n = 64; -$s = 0; -$e = 9; +$title = 'Standard maps'; +$reverse = false; +$n = 64; +$s = 0; +$e = 9; $showNames = false; /* diff --git a/Examples/examples_canvas/no_test_textalignex1.php b/Examples/examples_canvas/no_test_textalignex1.php index ad1fe9fe..eb43d2bd 100644 --- a/Examples/examples_canvas/no_test_textalignex1.php +++ b/Examples/examples_canvas/no_test_textalignex1.php @@ -1,10 +1,11 @@ img; // Get the bounding box for text -$img->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$img->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $tw = $img->GetBBoxWidth($txt, $angle); $th = $img->GetBBoxHeight($txt, $angle); -$img->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$img->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); $ch = $img->GetBBoxHeight($caption); // Calculate needed height for the image -$h = 3 * $th + 2 * $ym + $ch; -$g = new CanvasGraph($w, $h); +$h = 3 * $th + 2 * $ym + $ch; +$g = new CanvasGraph($w, $h); $img = $g->img; // Alignment for anchor points to use -$anchors = ['left', 'top', +$anchors = [ + 'left', 'top', 'center', 'top', 'right', 'top', 'left', 'center', @@ -55,9 +65,10 @@ 'right', 'center', 'left', 'bottom', 'center', 'bottom', - 'right', 'bottom', ]; + 'right', 'bottom', +]; -$n = count($anchors) / 2; +$n = \count($anchors) / 2; for ($i = 0, $r = 0, $c = 0; $i < $n; ++$i) { $x = $c * ($tw + $xm) + $xm / 2; @@ -65,17 +76,25 @@ $img->SetColor('blue'); $img->SetTextAlign($anchors[$i * 2], $anchors[$i * 2 + 1]); - $img->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 16); + $img->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 + ); $img->StrokeText($x, $y, $txt, $angle, 'left', true); $img->SetColor('black'); - $img->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); + $img->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') + ); $img->SetTextAlign('center', 'top'); - $align = sprintf('("%s","%s")', $anchors[$i * 2], $anchors[$i * 2 + 1]); + $align = \sprintf('("%s","%s")', $anchors[$i * 2], $anchors[$i * 2 + 1]); $img->StrokeText($c * ($tw / 2 + $xm) + $xm / 2 + $tw / 2, $r * ($th / 2 + $ym) + $th + $ym / 2 - 4, $align); ++$c; - if ($c == 3) { + + if (3 === $c) { $c = 0; ++$r; } @@ -83,7 +102,11 @@ // Draw the caption text $img->SetTextAlign('center', 'bottom'); -$img->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_ITALIC'), 11); +$img->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_ITALIC'), + 11 +); $img->StrokeText($w / 2, $h - 10, $caption, 0, 'left'); $img->SetColor('navy'); diff --git a/Examples/examples_canvas/no_test_textpalignex1.php b/Examples/examples_canvas/no_test_textpalignex1.php index bc99a5cb..74dc6651 100644 --- a/Examples/examples_canvas/no_test_textpalignex1.php +++ b/Examples/examples_canvas/no_test_textpalignex1.php @@ -1,43 +1,52 @@ img; // Alignment for anchor points to use $palign = ['left', 'center', 'right']; -$n = count($palign); +$n = \count($palign); $t = new Text($txt); $y = $ym; + for ($i = 0; $i < $n; ++$i) { $x = $xm + $i * $tw; $t->SetColor('black'); $t->SetAlign('left', 'top'); - $t->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); + $t->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 + ); $t->SetBox(); $t->SetParagraphAlign($palign[$i]); $t->Stroke($img, $x, $y); $img->SetColor('black'); - $img->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); + $img->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') + ); $img->SetTextAlign('center', 'top'); $img->StrokeText($x + 140, $y + 160, '"' . $palign[$i] . '"' . ' pargraph align'); } diff --git a/Examples/examples_canvas/text_several_lines.php b/Examples/examples_canvas/text_several_lines.php index d2c3c842..345e8d55 100644 --- a/Examples/examples_canvas/text_several_lines.php +++ b/Examples/examples_canvas/text_several_lines.php @@ -1,21 +1,25 @@ SetPos(0.05, 100); -$t1->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$t1->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $t1->SetBox('white', 'black', true); $t1->ParagraphAlign('right'); $t1->SetColor('black'); diff --git a/Examples/examples_canvas/text_with_more_text.php b/Examples/examples_canvas/text_with_more_text.php index d5e3601b..466d65ce 100644 --- a/Examples/examples_canvas/text_with_more_text.php +++ b/Examples/examples_canvas/text_with_more_text.php @@ -1,22 +1,26 @@ SetPos(0.05, 0.5); $t1->SetOrientation('h'); -$t1->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$t1->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $t1->SetBox('white', 'black', 'gray'); $t1->SetColor('black'); $graph->AddText($t1); diff --git a/Examples/examples_contour/basic_contourex01.php b/Examples/examples_contour/basic_contourex01.php index a6b9ce27..3d8413eb 100644 --- a/Examples/examples_contour/basic_contourex01.php +++ b/Examples/examples_contour/basic_contourex01.php @@ -1,7 +1,7 @@ SetScale('intint'); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data); diff --git a/Examples/examples_contour/basic_contourex02.php b/Examples/examples_contour/basic_contourex02.php index 02e708af..b5a7a646 100644 --- a/Examples/examples_contour/basic_contourex02.php +++ b/Examples/examples_contour/basic_contourex02.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data); diff --git a/Examples/examples_contour/basic_contourex03-1.php b/Examples/examples_contour/basic_contourex03-1.php index 651e3d0d..cde9391b 100644 --- a/Examples/examples_contour/basic_contourex03-1.php +++ b/Examples/examples_contour/basic_contourex03-1.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data, 10, 1); diff --git a/Examples/examples_contour/basic_contourex03-2.php b/Examples/examples_contour/basic_contourex03-2.php index 6e185bce..b9a41bec 100644 --- a/Examples/examples_contour/basic_contourex03-2.php +++ b/Examples/examples_contour/basic_contourex03-2.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data, 10, 2); diff --git a/Examples/examples_contour/basic_contourex03-3.php b/Examples/examples_contour/basic_contourex03-3.php index 4b095226..1b7ad52e 100644 --- a/Examples/examples_contour/basic_contourex03-3.php +++ b/Examples/examples_contour/basic_contourex03-3.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data, 10, 3); diff --git a/Examples/examples_contour/basic_contourex04.php b/Examples/examples_contour/basic_contourex04.php index 5f8158f7..16c50348 100644 --- a/Examples/examples_contour/basic_contourex04.php +++ b/Examples/examples_contour/basic_contourex04.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data, 5); diff --git a/Examples/examples_contour/basic_contourex05.php b/Examples/examples_contour/basic_contourex05.php index 51f6e410..239b8a45 100644 --- a/Examples/examples_contour/basic_contourex05.php +++ b/Examples/examples_contour/basic_contourex05.php @@ -1,7 +1,7 @@ SetScale('intint'); // Show axis on all sides -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); // Adjust the margins to fit the margin $graph->SetMargin(30, 100, 40, 30); // Setup$example_title='Basic contour plot with multiple axis'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // A simple contour plot with default arguments (e.g. 10 isobar lines) $cp = new Plot\ContourPlot($data); diff --git a/Examples/examples_contour/contourex01.php b/Examples/examples_contour/contourex01.php index 991233cb..2b530dd1 100644 --- a/Examples/examples_contour/contourex01.php +++ b/Examples/examples_contour/contourex01.php @@ -1,7 +1,7 @@ SetMargin(40, 140, 60, 40); $example_title = 'Example of contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // For contour plots it is custom to use a box style ofr the axis $graph->legend->SetPos(0.05, 0.5, 'right', 'center'); $graph->SetScale('intint'); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->xgrid->Show(); $graph->ygrid->Show(); diff --git a/Examples/examples_contour/contourex02.php b/Examples/examples_contour/contourex02.php index 076e4a20..cac71998 100644 --- a/Examples/examples_contour/contourex02.php +++ b/Examples/examples_contour/contourex02.php @@ -1,7 +1,7 @@ SetMargin(40, 140, 60, 40); $example_title = 'Example of contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // For contour plots it is custom to use a box style ofr the axis $graph->legend->SetPos(0.05, 0.5, 'right', 'center'); $graph->SetScale('intint'); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->xgrid->Show(); $graph->ygrid->Show(); diff --git a/Examples/examples_contour/contourex03.php b/Examples/examples_contour/contourex03.php index 49970ecb..6b406613 100644 --- a/Examples/examples_contour/contourex03.php +++ b/Examples/examples_contour/contourex03.php @@ -1,7 +1,7 @@ SetMargin(40, 140, 60, 40); // Enable antialias. Note with antiaaliasing only line weight=1 is supported. $graph->img->SetAntiAliasing(); $example_title = 'Example of contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // For contour plots it is custom to use a box style ofr the axis $graph->legend->SetPos(0.05, 0.5, 'right', 'center'); $graph->SetScale('intint'); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->xgrid->Show(); $graph->ygrid->Show(); diff --git a/Examples/examples_contour/contourex04.php b/Examples/examples_contour/contourex04.php index 26c29cd8..1838763f 100644 --- a/Examples/examples_contour/contourex04.php +++ b/Examples/examples_contour/contourex04.php @@ -1,7 +1,7 @@ SetMargin(40, 140, 60, 40); $example_title = 'Example of interpolated contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->title->SetMargin(10); // For contour plots it is custom to use a box style ofr the axis @@ -34,7 +39,9 @@ $graph->SetScale('intint'); // Setup axis and grids -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->xgrid->SetLineStyle('dashed'); $graph->xgrid->Show(true); $graph->ygrid->SetLineStyle('dashed'); diff --git a/Examples/examples_contour/contourex05.php b/Examples/examples_contour/contourex05.php index a6fac857..9ba3d9ed 100644 --- a/Examples/examples_contour/contourex05.php +++ b/Examples/examples_contour/contourex05.php @@ -1,7 +1,7 @@ SetMargin(40, 120, 60, 50); $example_title = 'Contour plot, high contrast color'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetMargin(10); // For contour plots it is custom to use a box style ofr the axis $graph->SetScale('intint', 0, 56, 0, 56); // Setup axis and grids -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->xgrid->Show(true); $graph->ygrid->Show(true); diff --git a/Examples/examples_contour/no_test_contour2_ex1.php b/Examples/examples_contour/no_test_contour2_ex1.php index aade903a..3804901a 100644 --- a/Examples/examples_contour/no_test_contour2_ex1.php +++ b/Examples/examples_contour/no_test_contour2_ex1.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(With lines and labels)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data); @@ -45,7 +54,11 @@ // Display the labels $cp->ShowLabels(true, true); -$cp->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$cp->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $cp->SetFontColor('white'); // And add the plot to the graph diff --git a/Examples/examples_contour/no_test_contour2_ex2.php b/Examples/examples_contour/no_test_contour2_ex2.php index 33c078dc..850e661f 100644 --- a/Examples/examples_contour/no_test_contour2_ex2.php +++ b/Examples/examples_contour/no_test_contour2_ex2.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(No lines, no labels)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data); diff --git a/Examples/examples_contour/no_test_contour2_ex3.php b/Examples/examples_contour/no_test_contour2_ex3.php index acd53296..68b1dea4 100644 --- a/Examples/examples_contour/no_test_contour2_ex3.php +++ b/Examples/examples_contour/no_test_contour2_ex3.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(Manual colors)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot with only 3 isobars $cp = new FilledContourPlot($data, 3); diff --git a/Examples/examples_contour/no_test_contour2_ex4.php b/Examples/examples_contour/no_test_contour2_ex4.php index b3b3eab5..97697db4 100644 --- a/Examples/examples_contour/no_test_contour2_ex4.php +++ b/Examples/examples_contour/no_test_contour2_ex4.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(labels follows gradients)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data, 8); @@ -42,7 +51,11 @@ // Display the labels $cp->ShowLabels(true, true); -$cp->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$cp->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $cp->SetFontColor('black'); // And add the plot to the graph diff --git a/Examples/examples_contour/no_test_contour2_ex5.php b/Examples/examples_contour/no_test_contour2_ex5.php index 39f00707..a8cde590 100644 --- a/Examples/examples_contour/no_test_contour2_ex5.php +++ b/Examples/examples_contour/no_test_contour2_ex5.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(horizontal labels)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data, 8); @@ -47,7 +56,11 @@ // Display the labels $cp->ShowLabels(true, false); -$cp->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$cp->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $cp->SetFontColor('white'); // And add the plot to the graph diff --git a/Examples/examples_contour/no_test_contour2_ex6.php b/Examples/examples_contour/no_test_contour2_ex6.php index 3224fef4..c8ece509 100644 --- a/Examples/examples_contour/no_test_contour2_ex6.php +++ b/Examples/examples_contour/no_test_contour2_ex6.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(With lines and labels)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data, 7); @@ -48,7 +57,11 @@ // Display the labels $cp->ShowLabels(true, true); -$cp->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$cp->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $cp->SetFontColor('white'); // And add the plot to the graph diff --git a/Examples/examples_contour/no_test_contour2_ex7.php b/Examples/examples_contour/no_test_contour2_ex7.php index d98037ef..3e269c11 100644 --- a/Examples/examples_contour/no_test_contour2_ex7.php +++ b/Examples/examples_contour/no_test_contour2_ex7.php @@ -1,7 +1,7 @@ SetMargin(30, 30, 40, 30); $graph->SetScale('intint'); $graph->SetMarginColor('white'); // Setup title of graph$example_title='Filled contour plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(With lines and labels)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Create a new contour plot $cp = new FilledContourPlot($data, 7); @@ -48,7 +57,11 @@ // Display the labels $cp->ShowLabels(true, true); -$cp->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$cp->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $cp->SetFontColor('white'); // And add the plot to the graph diff --git a/Examples/examples_csim/bar_csimex1.php b/Examples/examples_csim/bar_csimex1.php index abfbeb05..839b03f5 100644 --- a/Examples/examples_csim/bar_csimex1.php +++ b/Examples/examples_csim/bar_csimex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->img->SetMargin(60, 30, 20, 40); $graph->yaxis->SetTitleMargin(45); diff --git a/Examples/examples_csim/bar_csimex2.php b/Examples/examples_csim/bar_csimex2.php index 65a7a651..8b9eb3aa 100644 --- a/Examples/examples_csim/bar_csimex2.php +++ b/Examples/examples_csim/bar_csimex2.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->img->SetMargin(40, 30, 20, 40); $graph->SetShadow(); diff --git a/Examples/examples_csim/bar_csimex3.php b/Examples/examples_csim/bar_csimex3.php index 8863e8f8..c1709f5e 100644 --- a/Examples/examples_csim/bar_csimex3.php +++ b/Examples/examples_csim/bar_csimex3.php @@ -1,7 +1,7 @@ SetAngle(90); $graph->SetScale('textlin'); diff --git a/Examples/examples_csim/barcsim_details_omit.php b/Examples/examples_csim/barcsim_details_omit.php index 6bdeacae..34d86099 100644 --- a/Examples/examples_csim/barcsim_details_omit.php +++ b/Examples/examples_csim/barcsim_details_omit.php @@ -1,11 +1,11 @@ ' . basename(__FILE__) . '.'; + echo 'Incorrect argument(s) to script ' . \basename(__FILE__) . '.'; } else { echo 'Some details on bar with id=' . $_GET['id']; } diff --git a/Examples/examples_csim/barcsim_popup.php b/Examples/examples_csim/barcsim_popup.php index 53b399e9..8e8fe0a9 100644 --- a/Examples/examples_csim/barcsim_popup.php +++ b/Examples/examples_csim/barcsim_popup.php @@ -1,7 +1,7 @@ SetScale('textlin'); // Create a bar pot @@ -22,11 +22,12 @@ // Create targets for the image maps so that the details are opened in a separate window $fmtStr = "javascript:window.open('barcsim_details_omit.php?id=%d','_new','width=500,height=300');void(0)"; -$n = count($datay); -$targ = []; -$alts = []; +$n = \count($datay); +$targ = []; +$alts = []; + for ($i = 0; $i < $n; ++$i) { - $targ[$i] = sprintf($fmtStr, $i + 1); + $targ[$i] = \sprintf($fmtStr, $i + 1); $alts[$i] = 'val=%d'; // Note: The format placeholder val=%d will be replaced by the actual value in the ouput Graph\Configs::getConfig('HTML') by the // library so that when the user hoovers the mouse over the bar the actual numerical value of the bar @@ -40,7 +41,7 @@ // Setup the title, also wih a Graph\Configs::getConfig('CSIM') area$example_title='CSIM with popup windows'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); // Assume we can give more details on the graph -$graph->title->SetCSIMTarget(sprintf($fmtStr, -1), 'Title for Bar'); +$graph->title->SetCSIMTarget(\sprintf($fmtStr, -1), 'Title for Bar'); // Send back the Graph\Configs::getConfig('HTML') page which will call this script again to retrieve the image. $graph->StrokeCSIM(); diff --git a/Examples/examples_csim/barline_csimex1.php b/Examples/examples_csim/barline_csimex1.php index d555506d..318185fa 100644 --- a/Examples/examples_csim/barline_csimex1.php +++ b/Examples/examples_csim/barline_csimex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->img->SetMargin(40, 20, 30, 40); $example_title = 'CSIM example with bar and line'; diff --git a/Examples/examples_csim/barlinefreq_csimex1.php b/Examples/examples_csim/barlinefreq_csimex1.php index 893ddd4c..1df9f6aa 100644 --- a/Examples/examples_csim/barlinefreq_csimex1.php +++ b/Examples/examples_csim/barlinefreq_csimex1.php @@ -1,7 +1,7 @@ ' . htmlentities($imgmap) . ''; ?> +echo '
' . \htmlentities($imgmap) . '
'; ?> tag and rebuild the @@ -45,7 +45,7 @@

The graph is then be displayed as shown in figure 1. With the following created <img> tag:


-
+
 
diff --git a/Examples/examples_csim/csim_in_html_ex2.php b/Examples/examples_csim/csim_in_html_ex2.php index b7cc865e..c08280d6 100755 --- a/Examples/examples_csim/csim_in_html_ex2.php +++ b/Examples/examples_csim/csim_in_html_ex2.php @@ -8,14 +8,15 @@ // This is the filename of this Graph\Configs::getConfig('HTML') file global $_wrapperfilename; -$_wrapperfilename = basename(__FILE__); +$_wrapperfilename = \basename(__FILE__); // Create a random mapname used to connect the image map with the image -$_mapname1 = '__mapname' . rand(0, 1000000) . '__'; -$_mapname2 = '__mapname' . rand(0, 1000000) . '__'; +$_mapname1 = '__mapname' . \mt_rand(0, 1000000) . '__'; +$_mapname2 = '__mapname' . \mt_rand(0, 1000000) . '__'; // Get the graph scripts require_once $_graphfilename1; + require_once $_graphfilename2; // This line gets the image map and inserts it on the page @@ -35,6 +36,7 @@ echo 'Clicked on bar: ' . $_GET['clickedon'] . ''; } echo '

'; + if (empty($_GET['pie_clickedon'])) { echo 'Clicked on pie slice: <none>'; } else { @@ -48,14 +50,14 @@

For these graphs the maps are:

' . htmlentities($imgmap1) . '
'; +echo '
' . \htmlentities($imgmap1) . '
'; ?>

and

' . htmlentities($imgmap2) . '
'; +echo '
' . \htmlentities($imgmap2) . '
'; ?> tags:

 
 
diff --git a/Examples/examples_csim/csim_in_html_graph_ex1.php b/Examples/examples_csim/csim_in_html_graph_ex1.php index 42eb6e18..db36f9f2 100644 --- a/Examples/examples_csim/csim_in_html_graph_ex1.php +++ b/Examples/examples_csim/csim_in_html_graph_ex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMargin(50, 80, 20, 40); // Create a bar pot $bplot = new Plot\BarPlot($datay); -$n = count($datay); // Number of bars +$n = \count($datay); // Number of bars global $_wrapperfilename; // Create targets for the image maps. One for each column -$targ = []; -$alt = []; +$targ = []; +$alt = []; $wtarg = []; + for ($i = 0; $i < $n; ++$i) { - $urlarg = 'clickedon=' . ($i + 1); - $targ[] = $_wrapperfilename . '?' . $urlarg; - $alt[] = 'val=%d'; + $urlarg = 'clickedon=' . ($i + 1); + $targ[] = $_wrapperfilename . '?' . $urlarg; + $alt[] = 'val=%d'; $wtarg[] = ''; } $bplot->SetCSIMTargets($targ, $alt, $wtarg); diff --git a/Examples/examples_csim/csim_in_html_graph_ex2.php b/Examples/examples_csim/csim_in_html_graph_ex2.php index 17e95897..d76d5c46 100644 --- a/Examples/examples_csim/csim_in_html_graph_ex2.php +++ b/Examples/examples_csim/csim_in_html_graph_ex2.php @@ -1,15 +1,16 @@ SetFrame(false); @@ -69,13 +70,14 @@ // Setup the Graph\Configs::getConfig('CSIM') targets global $_wrapperfilename; -$targ = []; -$alt = []; +$targ = []; +$alt = []; $wtarg = []; + for ($i = 0; $i <= $n; ++$i) { - $urlarg = 'pie_clickedon=' . ($i + 1); - $targ[] = $_wrapperfilename . '?' . $urlarg; - $alt[] = 'val=%d'; + $urlarg = 'pie_clickedon=' . ($i + 1); + $targ[] = $_wrapperfilename . '?' . $urlarg; + $alt[] = 'val=%d'; $wtarg[] = ''; } $p1->SetCSIMTargets($targ, $alt, $wtarg); diff --git a/Examples/examples_csim/imgmarkercsimex1.php b/Examples/examples_csim/imgmarkercsimex1.php index 04947fe4..dd2c591c 100644 --- a/Examples/examples_csim/imgmarkercsimex1.php +++ b/Examples/examples_csim/imgmarkercsimex1.php @@ -1,19 +1,20 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); @@ -38,7 +39,7 @@ // Use an image of favourite car as $p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/saab_95.jpg', 0.5); -//$p1->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +//$p1->mark->SetTyp1e(Graph\Configs::getConfig('MARK_SQUARE')); // Displayes value on top of marker image $p1->value->SetFormat('%d mil'); diff --git a/Examples/examples_csim/mulyaxiscsimex1.php b/Examples/examples_csim/mulyaxiscsimex1.php index 158a661b..48293b0b 100644 --- a/Examples/examples_csim/mulyaxiscsimex1.php +++ b/Examples/examples_csim/mulyaxiscsimex1.php @@ -1,7 +1,7 @@ SetMargin(60, 180, 50, 40); $graph->SetMarginColor('white'); $example_title = 'Multi Y-axes with Image Map'; diff --git a/Examples/examples_csim/no_test_boxstockcsimex1.php b/Examples/examples_csim/no_test_boxstockcsimex1.php index 550995ce..e0b366a1 100644 --- a/Examples/examples_csim/no_test_boxstockcsimex1.php +++ b/Examples/examples_csim/no_test_boxstockcsimex1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetMarginColor('lightblue'); $example_title = 'Box Stock chart example'; diff --git a/Examples/examples_csim/no_test_ganttcsimex01.php b/Examples/examples_csim/no_test_ganttcsimex01.php index f73fa543..fa7da050 100644 --- a/Examples/examples_csim/no_test_ganttcsimex01.php +++ b/Examples/examples_csim/no_test_ganttcsimex01.php @@ -1,10 +1,11 @@ SetCSIMTarget('#', 'Go back 2'); $bar2->title->SetCSIMTarget('#', 'Go back 2 (title)'); -$graph = new GanttGraph(500); +$graph = new GanttGraph(500); $example_title = 'Example with image map'; $graph->title->set($example_title); $graph->ShowHeaders(Graph\Configs::getConfig('GANTT_HYEAR') | Graph\Configs::getConfig('GANTT_HMONTH') | Graph\Configs::getConfig('GANTT_HDAY') | Graph\Configs::getConfig('GANTT_HWEEK')); diff --git a/Examples/examples_csim/no_test_ganttcsimex02.php b/Examples/examples_csim/no_test_ganttcsimex02.php index 21d36e0f..17378244 100644 --- a/Examples/examples_csim/no_test_ganttcsimex02.php +++ b/Examples/examples_csim/no_test_ganttcsimex02.php @@ -1,10 +1,11 @@ title->set($example_title); $graph->ShowHeaders(Graph\Configs::getConfig('GANTT_HYEAR') | Graph\Configs::getConfig('GANTT_HMONTH') | Graph\Configs::getConfig('GANTT_HDAY') | Graph\Configs::getConfig('GANTT_HWEEK')); diff --git a/Examples/examples_csim/no_test_matrix_csimex01.php b/Examples/examples_csim/no_test_matrix_csimex01.php index ccc5cf00..66f49acb 100644 --- a/Examples/examples_csim/no_test_matrix_csimex01.php +++ b/Examples/examples_csim/no_test_matrix_csimex01.php @@ -1,7 +1,7 @@ SetBackgroundGradient('lightsteelblue:0.8', 'lightsteelblue:0.3'); $example_title = 'CSIM with matrix'; diff --git a/Examples/examples_csim/no_test_piec_csimex1.php b/Examples/examples_csim/no_test_piec_csimex1.php index 6ed77e47..8f5865e7 100644 --- a/Examples/examples_csim/no_test_piec_csimex1.php +++ b/Examples/examples_csim/no_test_piec_csimex1.php @@ -1,7 +1,7 @@ SetFrame(false); diff --git a/Examples/examples_csim/no_test_polar_csimex1.php b/Examples/examples_csim/no_test_polar_csimex1.php index 1a94521f..da7f27ae 100644 --- a/Examples/examples_csim/no_test_polar_csimex1.php +++ b/Examples/examples_csim/no_test_polar_csimex1.php @@ -1,7 +1,7 @@ SetScale('log', 100); $graph->SetType(Graph\Configs::getConfig('POLAR_180')); diff --git a/Examples/examples_csim/no_test_radar_csimex1.php b/Examples/examples_csim/no_test_radar_csimex1.php index 2e3aa8cb..f5c7b81d 100644 --- a/Examples/examples_csim/no_test_radar_csimex1.php +++ b/Examples/examples_csim/no_test_radar_csimex1.php @@ -1,24 +1,25 @@ title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); diff --git a/Examples/examples_csim/no_test_tablebarex1_csim.php b/Examples/examples_csim/no_test_tablebarex1_csim.php index e9dc2c42..443c9ddc 100644 --- a/Examples/examples_csim/no_test_tablebarex1_csim.php +++ b/Examples/examples_csim/no_test_tablebarex1_csim.php @@ -1,7 +1,7 @@ SetShadow(); // Set A title for the plot$example_title='3D Pie Client side image map'; $graph->title->set($example_title); diff --git a/Examples/examples_csim/pie_csimex1.php b/Examples/examples_csim/pie_csimex1.php index b0f5779a..bf3b86c2 100644 --- a/Examples/examples_csim/pie_csimex1.php +++ b/Examples/examples_csim/pie_csimex1.php @@ -1,7 +1,7 @@ SetShadow(); // Set A title for the plot$example_title='Client side image map'; $graph->title->set($example_title); diff --git a/Examples/examples_csim/scatter_csimex1.php b/Examples/examples_csim/scatter_csimex1.php index ac40f15c..c1acaa96 100644 --- a/Examples/examples_csim/scatter_csimex1.php +++ b/Examples/examples_csim/scatter_csimex1.php @@ -1,7 +1,7 @@ SetShadow(); $graph->SetScale('linlin'); diff --git a/Examples/examples_csim/titlecsimex01.php b/Examples/examples_csim/titlecsimex01.php index 85186fb9..f389b59e 100644 --- a/Examples/examples_csim/titlecsimex01.php +++ b/Examples/examples_csim/titlecsimex01.php @@ -1,15 +1,16 @@ SetScale('textlin'); $graph->SetMargin(50, 80, 20, 40); $graph->yaxis->SetTitleMargin(30); diff --git a/Examples/examples_date/dateaxisex1.php b/Examples/examples_date/dateaxisex1.php index fae6a427..b857b095 100644 --- a/Examples/examples_date/dateaxisex1.php +++ b/Examples/examples_date/dateaxisex1.php @@ -1,7 +1,7 @@ $i; $i += 10) { $datax[] = $now + $i; } -$n = count($datax); +$n = \count($datax); $datay = []; + for ($i = 0; $i < $n; ++$i) { - $datay[] = rand(30, 150); + $datay[] = \mt_rand(30, 150); } // Setup the basic graph -$__width = 324; +$__width = 324; $__height = 250; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetMargin(40, 40, 30, 70); -$graph->title->Set('Date: ' . date('Y-m-d', $now)); +$graph->title->Set('Date: ' . \date('Y-m-d', $now)); $graph->SetAlphaBlending(); // Setup a manual x-scale (We leave the sentinels for the diff --git a/Examples/examples_date/dateaxisex2.php b/Examples/examples_date/dateaxisex2.php index 9de75ddc..518cb23b 100644 --- a/Examples/examples_date/dateaxisex2.php +++ b/Examples/examples_date/dateaxisex2.php @@ -1,7 +1,7 @@ xaxis->scale->SetDateFormat('h:i'); // Adjust the start/end to a specific alignment -$graph->xaxis->scale->SetTimeAlign(Graph\Configs::getConfig('MINADJ_15')); +$graph->xaxis->scale->SetTimeAlign( + Graph\Configs::getConfig('MINADJ_15') +); $line = new Plot\LinePlot($data, $xdata); $line->SetLegend('Year 2005'); diff --git a/Examples/examples_date/dateaxisex4.php b/Examples/examples_date/dateaxisex4.php index e6cdc44e..521b8715 100644 --- a/Examples/examples_date/dateaxisex4.php +++ b/Examples/examples_date/dateaxisex4.php @@ -1,29 +1,31 @@ xaxis->scale->SetDateFormat('H:i'); // Adjust the start/end to a specific alignment -$graph->xaxis->scale->SetTimeAlign(Graph\Configs::getConfig('MINADJ_10')); +$graph->xaxis->scale->SetTimeAlign( + Graph\Configs::getConfig('MINADJ_10') +); $line = new Plot\LinePlot($data, $xdata); $line->SetLegend('Year 2005'); diff --git a/Examples/examples_date/datescaleticksex01.php b/Examples/examples_date/datescaleticksex01.php index da30f7ad..e0dc7d80 100644 --- a/Examples/examples_date/datescaleticksex01.php +++ b/Examples/examples_date/datescaleticksex01.php @@ -1,47 +1,58 @@ SetMargin(80, 30, 50, 40); $graph->SetMarginColor('white'); $graph->SetScale('dateint'); $example_title = 'Current Bids'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $subtitle_text = '(Updated every 5 minutes)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); // Enable antialias $graph->img->SetAntiAliasing(); @@ -57,13 +68,18 @@ $graph->xaxis->scale->ticks->Set($INTERVAL); // Adjust the start time for an "even" 5 minute, i.e. 5,10,15,20,25, ... -$graph->xaxis->scale->SetTimeAlign(Graph\Configs::getConfig('MINADJ_5')); +$graph->xaxis->scale->SetTimeAlign( + Graph\Configs::getConfig('MINADJ_5') +); // Create the plots using the dummy data created at the beginning $line = []; + for ($i = 0; $i < $m; ++$i) { $line[$i] = new Plot\LinePlot($bids[$i], $times); - $line[$i]->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); + $line[$i]->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') + ); } $graph->Add($line); diff --git a/Examples/examples_date/dateutilex01.php b/Examples/examples_date/dateutilex01.php index c221a3cf..2e439a44 100644 --- a/Examples/examples_date/dateutilex01.php +++ b/Examples/examples_date/dateutilex01.php @@ -1,10 +1,11 @@ SetScale('intlin', 0, 0, min($xdata), max($xdata)); +$graph->SetScale('intlin', 0, 0, \min($xdata), \max($xdata)); $graph->SetMargin(60, 20, 40, 60); // Setup the titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Development since 1984'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); $subtitle_text = '(Example using DateScaleUtils class)'; $graph->subtitle->Set($subtitle_text); // Setup the labels to be correctly format on the X-axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->xaxis->SetLabelAngle(30); // The second paramter set to 'true' will make the library interpret the @@ -40,7 +53,7 @@ $graph->xaxis->SetLabelFormatString('M, Y', true); // Get manual tick every second year -list($tickPos, $minTickPos) = $dateUtils->getTicks($xdata, Graph\Configs::getConfig('DSUTILS_YEAR2')); +[$tickPos, $minTickPos] = $dateUtils->getTicks($xdata, Graph\Configs::getConfig('DSUTILS_YEAR2')); $graph->xaxis->SetTickPositions($tickPos, $minTickPos); // First add an area plot diff --git a/Examples/examples_date/dateutilex02.php b/Examples/examples_date/dateutilex02.php index 40eaae47..8c523056 100644 --- a/Examples/examples_date/dateutilex02.php +++ b/Examples/examples_date/dateutilex02.php @@ -1,10 +1,11 @@ SetScale('datlin'); $graph->SetMargin(60, 20, 40, 60); // Setup the titles -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'Development since 1984'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); $subtitle_text = '(Example using the builtin date scale)'; $graph->subtitle->Set($subtitle_text); // Setup the labels to be correctly format on the X-axis -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->xaxis->SetLabelAngle(30); // The second paramter set to 'true' will make the library interpret the diff --git a/Examples/examples_date/prepaccdata_example.php b/Examples/examples_date/prepaccdata_example.php index b977ad17..cd6c0143 100644 --- a/Examples/examples_date/prepaccdata_example.php +++ b/Examples/examples_date/prepaccdata_example.php @@ -1,10 +1,11 @@ title->set($example_title); $graph->SetScale('textlin'); @@ -44,8 +46,12 @@ $graph->SetMargin(40, 30, 40, 120); // Turn the tick marks out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_BOTTOM')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_BOTTOM') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); $p0 = new Plot\LinePlot($ydata[0]); $p0->SetFillColor('sandybrown'); diff --git a/Examples/examples_gantt/gantt_samerowex1.php b/Examples/examples_gantt/gantt_samerowex1.php index 280c99c0..2981f434 100644 --- a/Examples/examples_gantt/gantt_samerowex1.php +++ b/Examples/examples_gantt/gantt_samerowex1.php @@ -1,7 +1,7 @@ SetBox(); $graph->SetShadow(); diff --git a/Examples/examples_gantt/ganttcolumnfontsex01.php b/Examples/examples_gantt/ganttcolumnfontsex01.php index 7576b343..93cb344c 100644 --- a/Examples/examples_gantt/ganttcolumnfontsex01.php +++ b/Examples/examples_gantt/ganttcolumnfontsex01.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_gantt/ganttconstrainex1.php b/Examples/examples_gantt/ganttconstrainex1.php index cfb18f4b..23daf9b9 100644 --- a/Examples/examples_gantt/ganttconstrainex1.php +++ b/Examples/examples_gantt/ganttconstrainex1.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_gantt/ganttconstrainex2.php b/Examples/examples_gantt/ganttconstrainex2.php index 651897eb..f224789b 100644 --- a/Examples/examples_gantt/ganttconstrainex2.php +++ b/Examples/examples_gantt/ganttconstrainex2.php @@ -1,7 +1,7 @@ title->set($example_title); //$graph->SetFrame(false); diff --git a/Examples/examples_gantt/ganttex00.php b/Examples/examples_gantt/ganttex00.php index 3ae1a6e4..ae957823 100644 --- a/Examples/examples_gantt/ganttex00.php +++ b/Examples/examples_gantt/ganttex00.php @@ -1,7 +1,7 @@ SetShadow(); // Add title and subtitle diff --git a/Examples/examples_gantt/ganttex03.php b/Examples/examples_gantt/ganttex03.php index d177d1e5..22d77b6d 100644 --- a/Examples/examples_gantt/ganttex03.php +++ b/Examples/examples_gantt/ganttex03.php @@ -1,16 +1,16 @@ SetShadow(); // Add title and subtitle diff --git a/Examples/examples_gantt/ganttex04.php b/Examples/examples_gantt/ganttex04.php index 6f0839f9..005bb0c2 100644 --- a/Examples/examples_gantt/ganttex04.php +++ b/Examples/examples_gantt/ganttex04.php @@ -1,7 +1,7 @@ SetBox(); $graph->SetShadow(); diff --git a/Examples/examples_gantt/ganttex18.php b/Examples/examples_gantt/ganttex18.php index 666a9a92..c017cfc3 100644 --- a/Examples/examples_gantt/ganttex18.php +++ b/Examples/examples_gantt/ganttex18.php @@ -1,7 +1,7 @@ $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 0.5); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } diff --git a/Examples/examples_gantt/gantthgridex1.php b/Examples/examples_gantt/gantthgridex1.php index ff44dbc4..a49afdce 100644 --- a/Examples/examples_gantt/gantthgridex1.php +++ b/Examples/examples_gantt/gantthgridex1.php @@ -1,7 +1,7 @@ hgrid->Show(); $graph->hgrid->SetRowFillColor('darkblue@0.9'); -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[5%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/gantthourex1.php b/Examples/examples_gantt/gantthourex1.php index 0a9c4f4a..1a48d702 100644 --- a/Examples/examples_gantt/gantthourex1.php +++ b/Examples/examples_gantt/gantthourex1.php @@ -1,7 +1,7 @@ $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[5%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/gantthourminex1.php b/Examples/examples_gantt/gantthourminex1.php index 013b24c7..49dbe2ca 100644 --- a/Examples/examples_gantt/gantthourminex1.php +++ b/Examples/examples_gantt/gantthourminex1.php @@ -1,7 +1,7 @@ title->SetColor('darkgray'); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3]); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/gantticonex1.php b/Examples/examples_gantt/gantticonex1.php index baa1d30f..db707560 100644 --- a/Examples/examples_gantt/gantticonex1.php +++ b/Examples/examples_gantt/gantticonex1.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); @@ -51,9 +51,9 @@ //$graph->scale->actinfo->Show(false); // Setup the icons we want to use -$erricon = new Image\IconImage(Graph\Configs::getConfig('GICON_FOLDER'), 0.6); +$erricon = new Image\IconImage(Graph\Configs::getConfig('GICON_FOLDER'), 0.6); $startconicon = new Image\IconImage(Graph\Configs::getConfig('GICON_FOLDEROPEN'), 0.6); -$endconicon = new Image\IconImage(Graph\Configs::getConfig('GICON_TEXTIMPORTANT'), 0.5); +$endconicon = new Image\IconImage(Graph\Configs::getConfig('GICON_TEXTIMPORTANT'), 0.5); // Store the icons in the first column and use plain text in the others $data = [ @@ -65,9 +65,10 @@ ]; // Create the bars and add them to the gantt chart -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/ganttmonthyearex1.php b/Examples/examples_gantt/ganttmonthyearex1.php index 5732aad8..3a1c4e57 100644 --- a/Examples/examples_gantt/ganttmonthyearex1.php +++ b/Examples/examples_gantt/ganttmonthyearex1.php @@ -1,14 +1,14 @@ title->set($example_title); @@ -36,9 +36,10 @@ [1, ' Label 2', '2001-10-26', '2001-11-16'], ]; // Create the bars and add them to the gantt chart -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/ganttmonthyearex2.php b/Examples/examples_gantt/ganttmonthyearex2.php index b787ed2a..76b814b1 100644 --- a/Examples/examples_gantt/ganttmonthyearex2.php +++ b/Examples/examples_gantt/ganttmonthyearex2.php @@ -1,14 +1,14 @@ title->set($example_title); @@ -52,9 +52,10 @@ ]; // Create the bars and add them to the gantt chart -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/ganttmonthyearex3.php b/Examples/examples_gantt/ganttmonthyearex3.php index 7b695237..6f2d4099 100644 --- a/Examples/examples_gantt/ganttmonthyearex3.php +++ b/Examples/examples_gantt/ganttmonthyearex3.php @@ -1,14 +1,14 @@ title->set($example_title); @@ -52,9 +52,10 @@ ]; // Create the bars and add them to the gantt chart -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/ganttmonthyearex4.php b/Examples/examples_gantt/ganttmonthyearex4.php index 92b361be..722c1b31 100644 --- a/Examples/examples_gantt/ganttmonthyearex4.php +++ b/Examples/examples_gantt/ganttmonthyearex4.php @@ -1,14 +1,14 @@ title->set($example_title); @@ -55,9 +55,10 @@ ]; // Create the bars and add them to the gantt chart -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[50%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } $bar->SetPattern(Graph\Configs::getConfig('BAND_RDIAG'), 'yellow'); diff --git a/Examples/examples_gantt/ganttsimpleex1.php b/Examples/examples_gantt/ganttsimpleex1.php index 15839d73..55e406f9 100644 --- a/Examples/examples_gantt/ganttsimpleex1.php +++ b/Examples/examples_gantt/ganttsimpleex1.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_gantt/no_dim_ganttex_slice.php b/Examples/examples_gantt/no_dim_ganttex_slice.php index f62a91ec..75ce2540 100644 --- a/Examples/examples_gantt/no_dim_ganttex_slice.php +++ b/Examples/examples_gantt/no_dim_ganttex_slice.php @@ -1,7 +1,7 @@ SetShadow(); $graph->SetBox(); @@ -42,9 +42,10 @@ ]; // make up some fictionary activity bars -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $bar = new Plot\GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '[5%]', 10); - if (count($data[$i]) > 4) { + + if (\count($data[$i]) > 4) { $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); } @@ -66,7 +67,7 @@ } // The line will NOT be shown since it is outside the specified slice -$vline = new Plot\GanttVLine('2002-02-28'); +$vline = new Plot\GanttVLine('2002-02-28'); $example_title = '2002-02-28'; $vline->title->set($example_title); $vline->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD'), 10); diff --git a/Examples/examples_gantt/no_test_ganttex19.php b/Examples/examples_gantt/no_test_ganttex19.php index a47a8537..696993bb 100644 --- a/Examples/examples_gantt/no_test_ganttex19.php +++ b/Examples/examples_gantt/no_test_ganttex19.php @@ -1,7 +1,7 @@ SetScale('textlin'); // Create the linear plot diff --git a/Examples/examples_general/example1.1.php b/Examples/examples_general/example1.1.php index 2c905f90..dbb115c6 100644 --- a/Examples/examples_general/example1.1.php +++ b/Examples/examples_general/example1.1.php @@ -1,22 +1,26 @@ SetScale('textlin'); $graph->img->SetMargin(30, 90, 40, 50); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Example 1.1 same y-values'; $graph->title->set($example_title); diff --git a/Examples/examples_general/example1.2.php b/Examples/examples_general/example1.2.php index 950a455e..f36238fd 100644 --- a/Examples/examples_general/example1.2.php +++ b/Examples/examples_general/example1.2.php @@ -1,22 +1,26 @@ SetScale('textlin'); $graph->img->SetMargin(30, 90, 40, 50); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Dashed lineplot'; $graph->title->set($example_title); diff --git a/Examples/examples_general/example1.php b/Examples/examples_general/example1.php index 00ac2903..c483a800 100644 --- a/Examples/examples_general/example1.php +++ b/Examples/examples_general/example1.php @@ -1,22 +1,26 @@ SetScale('textlin'); $graph->img->SetMargin(50, 90, 40, 50); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Examples for graph'; $graph->title->set($example_title); diff --git a/Examples/examples_general/example10.php b/Examples/examples_general/example10.php index 9648a340..b72e6b49 100644 --- a/Examples/examples_general/example10.php +++ b/Examples/examples_general/example10.php @@ -1,7 +1,7 @@ img->SetMargin(40, 110, 20, 40); $graph->SetScale('textlog'); $graph->SetY2Scale('log'); @@ -26,7 +26,7 @@ $graph->xgrid->Show(true, false); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); $graph->yaxis->scale->ticks->SupressFirst(); @@ -42,9 +42,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example11.php b/Examples/examples_general/example11.php index c7d3c77e..cd068ea2 100644 --- a/Examples/examples_general/example11.php +++ b/Examples/examples_general/example11.php @@ -1,31 +1,35 @@ Push(); // Create the graph. These two calls are always required -$__width = 300; +$__width = 300; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); $graph->SetMargin(40, 20, 20, 60); $example_title = 'Timing a graph'; $graph->title->set($example_title); $graph->footer->right->Set('Timer (ms): '); -$graph->footer->right->SetFont(Graph\Configs::getConfig('FF_COURIER'), Graph\Configs::getConfig('FS_ITALIC')); +$graph->footer->right->SetFont( + Graph\Configs::getConfig('FF_COURIER'), + Graph\Configs::getConfig('FS_ITALIC') +); $graph->footer->SetTimer($timer); // Create the linear plot @@ -40,9 +44,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example13.php b/Examples/examples_general/example13.php index 8c455492..5621f284 100644 --- a/Examples/examples_general/example13.php +++ b/Examples/examples_general/example13.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->img->SetMargin(40, 30, 20, 40); @@ -31,9 +32,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $datax = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($datax); diff --git a/Examples/examples_general/example14.php b/Examples/examples_general/example14.php index ebf2fd4f..3de9d02e 100644 --- a/Examples/examples_general/example14.php +++ b/Examples/examples_general/example14.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->img->SetMargin(40, 30, 20, 40); @@ -32,9 +33,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $datax = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($datax); diff --git a/Examples/examples_general/example15.php b/Examples/examples_general/example15.php index ad4a144c..7e56ac9e 100644 --- a/Examples/examples_general/example15.php +++ b/Examples/examples_general/example15.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->img->SetMargin(40, 30, 20, 40); @@ -35,9 +36,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $datax = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($datax); diff --git a/Examples/examples_general/example16.1.php b/Examples/examples_general/example16.1.php index cb13a8fb..b3288b4b 100644 --- a/Examples/examples_general/example16.1.php +++ b/Examples/examples_general/example16.1.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->img->SetMargin(40, 130, 20, 40); @@ -40,9 +41,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); //$graph->xaxis->SetTickLabels($datax); //$graph->xaxis->SetTextTickInterval(2); diff --git a/Examples/examples_general/example16.6.php b/Examples/examples_general/example16.6.php index 075619b9..e45c4c1e 100644 --- a/Examples/examples_general/example16.6.php +++ b/Examples/examples_general/example16.6.php @@ -1,7 +1,7 @@ $x; ++$x) { $datax[$x] = $x; - $datay[$x] = $a + $b * $x + rand(-20, 20); + $datay[$x] = $a + $b * $x + \mt_rand(-20, 20); } // Create the graph -$__width = 300; +$__width = 300; $__height = 250; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); -$lr = new Util\LinearRegression($datax, $datay); -list($stderr, $corr) = $lr->GetStat(); -list($xd, $yd) = $lr->GetY(0, 19); +$lr = new Util\LinearRegression($datax, $datay); +[$stderr, $corr] = $lr->GetStat(); +[$xd, $yd] = $lr->GetY(0, 19); // Setup title $example_title = 'Linear regression'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); -$graph->subtitle->Set('(stderr=' . sprintf('%.2f', $stderr) . ', corr=' . sprintf('%.2f', $corr) . ')'); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->subtitle->Set('(stderr=' . \sprintf('%.2f', $stderr) . ', corr=' . \sprintf('%.2f', $corr) . ')'); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // make sure that the X-axis is always at the // bottom at the plot and not just at Y=0 which is @@ -44,7 +53,9 @@ // Create the scatter plot with some nice colors $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->SetColor('blue'); $sp1->SetWeight(3); diff --git a/Examples/examples_general/example16.php b/Examples/examples_general/example16.php index 8d9d53af..3fe8db74 100644 --- a/Examples/examples_general/example16.php +++ b/Examples/examples_general/example16.php @@ -1,19 +1,20 @@ SetScale('textlin'); $graph->img->SetMargin(40, 30, 20, 40); @@ -38,9 +39,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $datax = $graph->gDateLocale->GetShortMonth(); $graph->xaxis->SetTickLabels($datax); diff --git a/Examples/examples_general/example17.php b/Examples/examples_general/example17.php index 8cd7d65f..ac98cfb8 100644 --- a/Examples/examples_general/example17.php +++ b/Examples/examples_general/example17.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetShadow(); $graph->img->SetMargin(40, 30, 20, 40); @@ -41,9 +42,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_general/example2.1.php b/Examples/examples_general/example2.1.php index bed77c78..0d60f53b 100644 --- a/Examples/examples_general/example2.1.php +++ b/Examples/examples_general/example2.1.php @@ -1,19 +1,20 @@ SetScale('textlin'); // Create the linear plot @@ -21,7 +22,10 @@ $lineplot->value->Show(); $lineplot->value->SetColor('red'); -$lineplot->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$lineplot->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Add the plot to the graph $graph->Add($lineplot); diff --git a/Examples/examples_general/example2.5.php b/Examples/examples_general/example2.5.php index 55b851cb..84f5fe0e 100644 --- a/Examples/examples_general/example2.5.php +++ b/Examples/examples_general/example2.5.php @@ -1,7 +1,7 @@ SetScale('textlin'); // Create the linear plot diff --git a/Examples/examples_general/example2.6.php b/Examples/examples_general/example2.6.php index 984de79a..391b7b50 100644 --- a/Examples/examples_general/example2.6.php +++ b/Examples/examples_general/example2.6.php @@ -1,7 +1,7 @@ SetScale('textlin'); // Create the linear plot diff --git a/Examples/examples_general/example2.php b/Examples/examples_general/example2.php index 360285ad..906f5809 100644 --- a/Examples/examples_general/example2.php +++ b/Examples/examples_general/example2.php @@ -1,7 +1,7 @@ SetShadow(); $example_title = 'A simple Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->SetLegends($graph->gDateLocale->GetShortMonth()); diff --git a/Examples/examples_general/example26.php b/Examples/examples_general/example26.php index 58775e67..eb5e6b91 100644 --- a/Examples/examples_general/example26.php +++ b/Examples/examples_general/example26.php @@ -1,7 +1,7 @@ SetShadow(); $example_title = 'A simple Pie plot'; $graph->title->set($example_title); diff --git a/Examples/examples_general/example27.1.php b/Examples/examples_general/example27.1.php index f88f07cb..565148ad 100644 --- a/Examples/examples_general/example27.1.php +++ b/Examples/examples_general/example27.1.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = 'A simple Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot3D($data); $p1->SetAngle(20); diff --git a/Examples/examples_general/example27.2.php b/Examples/examples_general/example27.2.php index 080afdac..e42bf367 100644 --- a/Examples/examples_general/example27.2.php +++ b/Examples/examples_general/example27.2.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = 'A simple Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->ExplodeSlice(1); diff --git a/Examples/examples_general/example27.3.php b/Examples/examples_general/example27.3.php index 84cb6024..dbab83ef 100644 --- a/Examples/examples_general/example27.3.php +++ b/Examples/examples_general/example27.3.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = 'A simple 3D Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot3D($data); $p1->ExplodeSlice(1); diff --git a/Examples/examples_general/example27.php b/Examples/examples_general/example27.php index a3cefbff..e403e13a 100644 --- a/Examples/examples_general/example27.php +++ b/Examples/examples_general/example27.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = 'A simple Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot3D($data); $p1->SetSize(0.5); diff --git a/Examples/examples_general/example28.1.php b/Examples/examples_general/example28.1.php index e9ab1b5d..b166e98a 100644 --- a/Examples/examples_general/example28.1.php +++ b/Examples/examples_general/example28.1.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = "'earth' Theme"; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->SetTheme('earth'); diff --git a/Examples/examples_general/example28.2.php b/Examples/examples_general/example28.2.php index 6f35e308..0f57f3e8 100644 --- a/Examples/examples_general/example28.2.php +++ b/Examples/examples_general/example28.2.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = "'pastel' Theme"; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->SetTheme('pastel'); diff --git a/Examples/examples_general/example28.3.php b/Examples/examples_general/example28.3.php index 39afa984..87310036 100644 --- a/Examples/examples_general/example28.3.php +++ b/Examples/examples_general/example28.3.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = "'water' Theme"; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->SetTheme('water'); diff --git a/Examples/examples_general/example28.php b/Examples/examples_general/example28.php index e1d3409b..9489bb74 100644 --- a/Examples/examples_general/example28.php +++ b/Examples/examples_general/example28.php @@ -1,22 +1,26 @@ SetShadow(); $example_title = "'sand' Theme"; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); $p1->SetTheme('sand'); diff --git a/Examples/examples_general/example3.0.1.php b/Examples/examples_general/example3.0.1.php index ae5ac0cc..25461832 100644 --- a/Examples/examples_general/example3.0.1.php +++ b/Examples/examples_general/example3.0.1.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); diff --git a/Examples/examples_general/example3.0.2.php b/Examples/examples_general/example3.0.2.php index afeac5e0..17045292 100644 --- a/Examples/examples_general/example3.0.2.php +++ b/Examples/examples_general/example3.0.2.php @@ -1,10 +1,11 @@ xaxis->title->Set('x-title'); $graph->yaxis->title->Set('y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $graph->yaxis->SetColor('blue'); diff --git a/Examples/examples_general/example3.0.3.php b/Examples/examples_general/example3.0.3.php index 128d16d3..c94bc6bb 100644 --- a/Examples/examples_general/example3.0.3.php +++ b/Examples/examples_general/example3.0.3.php @@ -1,10 +1,11 @@ xaxis->title->Set('x-title'); $graph->yaxis->title->Set('y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 9); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 9 +); $graph->yaxis->SetColor('blue'); diff --git a/Examples/examples_general/example3.1.1.php b/Examples/examples_general/example3.1.1.php index efc6cd0f..665dd48a 100644 --- a/Examples/examples_general/example3.1.1.php +++ b/Examples/examples_general/example3.1.1.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); @@ -41,7 +48,11 @@ $lineplot->SetWeight(2); // Two pixel wide // Add an image mark scaled to 50% -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_IMG_DIAMOND'), 'red', 0.5); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_DIAMOND'), + 'red', + 0.5 +); // Add the plot to the graph $graph->Add($lineplot); diff --git a/Examples/examples_general/example3.1.php b/Examples/examples_general/example3.1.php index 0678cedd..5d952cc3 100644 --- a/Examples/examples_general/example3.1.php +++ b/Examples/examples_general/example3.1.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); @@ -39,7 +46,9 @@ $lineplot = new Plot\LinePlot($ydata); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); // Two pixel wide -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_UTRIANGLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_UTRIANGLE') +); $lineplot->mark->SetColor('blue'); $lineplot->mark->SetFillColor('red'); diff --git a/Examples/examples_general/example3.2.1.php b/Examples/examples_general/example3.2.1.php index cec3bf2f..224cc591 100644 --- a/Examples/examples_general/example3.2.1.php +++ b/Examples/examples_general/example3.2.1.php @@ -1,25 +1,28 @@ SetScale('textlin'); $graph->yaxis->scale->SetGrace(10, 10); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_CIRCLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_CIRCLE') +); // Add the plot to the graph $graph->Add($lineplot); @@ -30,9 +33,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example3.2.2.php b/Examples/examples_general/example3.2.2.php index 8d76d361..d22db11c 100644 --- a/Examples/examples_general/example3.2.2.php +++ b/Examples/examples_general/example3.2.2.php @@ -1,25 +1,28 @@ SetScale('textlin'); $graph->yaxis->scale->SetGrace(10, 10); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_CIRCLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_CIRCLE') +); // Add the plot to the graph $graph->Add($lineplot); @@ -32,9 +35,18 @@ $graph->xaxis->SetPos('min'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example3.2.php b/Examples/examples_general/example3.2.php index 00b6962e..4fa0a8f9 100644 --- a/Examples/examples_general/example3.2.php +++ b/Examples/examples_general/example3.2.php @@ -1,24 +1,27 @@ SetScale('textlin'); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_CIRCLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_CIRCLE') +); // Add the plot to the graph $graph->Add($lineplot); @@ -29,9 +32,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example3.3.php b/Examples/examples_general/example3.3.php index 92f85a94..15e41e36 100644 --- a/Examples/examples_general/example3.3.php +++ b/Examples/examples_general/example3.3.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); @@ -39,7 +46,9 @@ $lineplot = new Plot\LinePlot($ydata); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); // Two pixel wide -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_UTRIANGLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_UTRIANGLE') +); $lineplot->mark->SetColor('blue'); $lineplot->mark->SetFillColor('red'); diff --git a/Examples/examples_general/example3.4.1.php b/Examples/examples_general/example3.4.1.php index 364e0a5a..e6e53e15 100644 --- a/Examples/examples_general/example3.4.1.php +++ b/Examples/examples_general/example3.4.1.php @@ -1,10 +1,11 @@ 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, - 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, - 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1, ]; + $lookup = [ + 'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, + 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, + 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1, + ]; foreach ($lookup as $roman => $value) { // Determine the number of matches $matches = (int) ($n / $value); // Store that many characters - $result .= str_repeat($roman, $matches); + $result .= \str_repeat($roman, $matches); // Substract that from the number $n = $n % $value; @@ -44,7 +47,7 @@ function formatCallback($aVal) $ydata = [11, 3, 8, 12, 5, 1, 9, 13, 5, 7]; // Size of the overall graph -$__width = 350; +$__width = 350; $__height = 250; // Create the graph and set a scale. @@ -62,8 +65,14 @@ function formatCallback($aVal) $graph->xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); @@ -71,12 +80,18 @@ function formatCallback($aVal) $lineplot = new Plot\LinePlot($ydata); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); // Two pixel wide -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_UTRIANGLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_UTRIANGLE') +); $lineplot->mark->SetColor('blue'); $lineplot->mark->SetFillColor('red'); $lineplot->value->Show(); -$lineplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$lineplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $lineplot->value->SetColor('darkred'); $lineplot->value->SetFormatCallback('formatCallback'); diff --git a/Examples/examples_general/example3.4.php b/Examples/examples_general/example3.4.php index 10dae742..232aac5c 100644 --- a/Examples/examples_general/example3.4.php +++ b/Examples/examples_general/example3.4.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('blue'); @@ -39,12 +46,18 @@ $lineplot = new Plot\LinePlot($ydata); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); // Two pixel wide -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_UTRIANGLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_UTRIANGLE') +); $lineplot->mark->SetColor('blue'); $lineplot->mark->SetFillColor('red'); $lineplot->value->Show(); -$lineplot->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$lineplot->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $lineplot->value->SetColor('darkred'); $lineplot->value->SetFormat('(%d)'); diff --git a/Examples/examples_general/example3.php b/Examples/examples_general/example3.php index 5c152c2c..c277253e 100644 --- a/Examples/examples_general/example3.php +++ b/Examples/examples_general/example3.php @@ -1,10 +1,11 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); diff --git a/Examples/examples_general/example4.php b/Examples/examples_general/example4.php index 89c8ac1d..ebc1204d 100644 --- a/Examples/examples_general/example4.php +++ b/Examples/examples_general/example4.php @@ -1,19 +1,20 @@ xaxis->title->Set('Operator'); $graph->yaxis->title->Set('# of calls'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create the first data series $lineplot = new Plot\LinePlot($ydata); diff --git a/Examples/examples_general/example5.1.php b/Examples/examples_general/example5.1.php index d00ab130..3ef5ba67 100644 --- a/Examples/examples_general/example5.1.php +++ b/Examples/examples_general/example5.1.php @@ -1,27 +1,28 @@ img->SetMargin(40, 40, 20, 40); $graph->SetScale('textlin'); $graph->SetY2Scale('lin'); $graph->SetShadow(); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -35,9 +36,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example5.php b/Examples/examples_general/example5.php index 7ff00f07..34cd05c0 100644 --- a/Examples/examples_general/example5.php +++ b/Examples/examples_general/example5.php @@ -1,27 +1,28 @@ img->SetMargin(40, 40, 20, 40); $graph->SetScale('textlin'); $graph->SetY2Scale('lin'); $graph->SetShadow(); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -35,9 +36,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example6.1.php b/Examples/examples_general/example6.1.php index ce8919a4..c6cc4319 100644 --- a/Examples/examples_general/example6.1.php +++ b/Examples/examples_general/example6.1.php @@ -1,20 +1,21 @@ SetScale('textlin'); $graph->SetY2Scale('lin'); $graph->SetShadow(); @@ -23,7 +24,7 @@ $graph->img->SetMargin(40, 40, 20, 70); // Create the two linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -40,9 +41,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Set the colors for the plots $lineplot->SetColor('blue'); @@ -55,7 +65,9 @@ $lineplot2->SetLegend('Plot 2'); // Adjust the legend position -$graph->legend->SetLayout(Graph\Configs::getConfig('LEGEND_HOR')); +$graph->legend->SetLayout( + Graph\Configs::getConfig('LEGEND_HOR') +); $graph->legend->Pos(0.4, 0.95, 'center', 'bottom'); // Display the graph diff --git a/Examples/examples_general/example6.2.php b/Examples/examples_general/example6.2.php index 076d206e..cafd4e2f 100644 --- a/Examples/examples_general/example6.2.php +++ b/Examples/examples_general/example6.2.php @@ -1,20 +1,21 @@ SetScale('textlin'); $graph->SetShadow(); @@ -32,9 +33,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Set the colors for the plots $lineplot->SetColor('blue'); @@ -47,7 +57,9 @@ $graph->Add($lineplot); // Adjust the legend position -$graph->legend->SetLayout(Graph\Configs::getConfig('LEGEND_HOR')); +$graph->legend->SetLayout( + Graph\Configs::getConfig('LEGEND_HOR') +); $graph->legend->Pos(0.4, 0.95, 'center', 'bottom'); // Display the graph diff --git a/Examples/examples_general/example6.php b/Examples/examples_general/example6.php index f8fd58db..9c2e1800 100644 --- a/Examples/examples_general/example6.php +++ b/Examples/examples_general/example6.php @@ -1,20 +1,21 @@ SetScale('textlin'); $graph->SetY2Scale('lin'); $graph->SetShadow(); @@ -23,7 +24,7 @@ $graph->img->SetMargin(40, 140, 20, 40); // Create the two linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -40,9 +41,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Set the colors for the plots $lineplot->SetColor('blue'); diff --git a/Examples/examples_general/example7.php b/Examples/examples_general/example7.php index 05b076ce..40466881 100644 --- a/Examples/examples_general/example7.php +++ b/Examples/examples_general/example7.php @@ -1,7 +1,7 @@ SetScale('textlin'); $graph->SetY2Scale('log'); $graph->SetShadow(); $graph->img->SetMargin(40, 110, 20, 40); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -34,9 +34,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example8.1.php b/Examples/examples_general/example8.1.php index f0642905..6c01ac0f 100644 --- a/Examples/examples_general/example8.1.php +++ b/Examples/examples_general/example8.1.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->SetY2Scale('log'); @@ -42,9 +42,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example8.php b/Examples/examples_general/example8.php index 41bae1cb..53d4f743 100644 --- a/Examples/examples_general/example8.php +++ b/Examples/examples_general/example8.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->SetShadow(); $graph->img->SetMargin(40, 110, 20, 40); @@ -25,7 +25,7 @@ $graph->xgrid->Show(true, false); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -35,9 +35,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example9.1.php b/Examples/examples_general/example9.1.php index 3b0b59d9..6a98f5eb 100644 --- a/Examples/examples_general/example9.1.php +++ b/Examples/examples_general/example9.1.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->img->SetMargin(40, 110, 20, 40); @@ -39,9 +39,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example9.2.php b/Examples/examples_general/example9.2.php index c52fcda1..474e0f40 100644 --- a/Examples/examples_general/example9.2.php +++ b/Examples/examples_general/example9.2.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->img->SetMargin(40, 110, 20, 50); @@ -40,9 +40,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/example9.php b/Examples/examples_general/example9.php index de16f118..f95348fe 100644 --- a/Examples/examples_general/example9.php +++ b/Examples/examples_general/example9.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->img->SetMargin(40, 110, 20, 40); @@ -38,9 +38,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_general/exampleex9.php b/Examples/examples_general/exampleex9.php index dfd3988e..4a150855 100644 --- a/Examples/examples_general/exampleex9.php +++ b/Examples/examples_general/exampleex9.php @@ -1,7 +1,7 @@ SetScale('textlog'); $graph->img->SetMargin(40, 110, 20, 40); @@ -29,7 +29,7 @@ $graph->xgrid->Show(true, false); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); $graph->yaxis->scale->ticks->SupressFirst(); @@ -45,9 +45,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_img/antispamex01.php b/Examples/examples_img/antispamex01.php index effc3152..35f55182 100644 --- a/Examples/examples_img/antispamex01.php +++ b/Examples/examples_img/antispamex01.php @@ -1,7 +1,7 @@ Stroke() === false) { - die('Illegal or no data to plot'); + exit('Illegal or no data to plot'); } diff --git a/Examples/examples_img/bkgimgflagex1.php b/Examples/examples_img/bkgimgflagex1.php index 197b5f8d..6320d2b9 100644 --- a/Examples/examples_img/bkgimgflagex1.php +++ b/Examples/examples_img/bkgimgflagex1.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 20, 40); $graph->SetMarginColor('white:0.9'); @@ -37,13 +38,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('navy'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('navy'); //$graph->ygrid->Show(false); @@ -55,7 +65,11 @@ // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_img/bkgimgflagex2.php b/Examples/examples_img/bkgimgflagex2.php index f3eb0c30..95e4b1af 100644 --- a/Examples/examples_img/bkgimgflagex2.php +++ b/Examples/examples_img/bkgimgflagex2.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 20, 40); $graph->SetMarginColor('white:0.9'); @@ -24,7 +25,11 @@ $graph->SetShadow(); // Apply a perspective transformation at the end -$graph->Set3DPerspective(Graph\Configs::getConfig('SKEW3D_UP'), 100, 180); +$graph->Set3DPerspective( + Graph\Configs::getConfig('SKEW3D_UP'), + 100, + 150 +); // Adjust the position of the legend box $graph->legend->Pos(0.03, 0.10); @@ -41,13 +46,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('navy'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('navy'); //$graph->ygrid->Show(false); @@ -59,7 +73,11 @@ // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_img/bkgimgflagex3.php b/Examples/examples_img/bkgimgflagex3.php index 3a33d879..985c40c8 100644 --- a/Examples/examples_img/bkgimgflagex3.php +++ b/Examples/examples_img/bkgimgflagex3.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 20, 40); $graph->SetMarginColor('white:0.9'); @@ -24,7 +25,11 @@ $graph->SetShadow(); // Apply a perspective transformation at the end -$graph->Set3DPerspective(Graph\Configs::getConfig('SKEW3D_DOWN'), 100, 180); +$graph->Set3DPerspective( + Graph\Configs::getConfig('SKEW3D_DOWN'), + 100, + 180 +); // Adjust the position of the legend box $graph->legend->Pos(0.03, 0.10); @@ -41,13 +46,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('navy'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('navy'); //$graph->ygrid->Show(false); @@ -59,7 +73,11 @@ // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_img/bkgimgflagex4.php b/Examples/examples_img/bkgimgflagex4.php index 96cc1853..f97ce8aa 100644 --- a/Examples/examples_img/bkgimgflagex4.php +++ b/Examples/examples_img/bkgimgflagex4.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 20, 40); $graph->SetMarginColor('white:0.9'); @@ -24,7 +25,12 @@ $graph->SetShadow(); // Apply a perspective transformation at the end -$graph->Set3DPerspective(Graph\Configs::getConfig('SKEW3D_LEFT'), 350, 320, true); +$graph->Set3DPerspective( + Graph\Configs::getConfig('SKEW3D_LEFT'), + 300, + 320, + true +); // Adjust the position of the legend box $graph->legend->Pos(0.03, 0.10); @@ -41,13 +47,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('navy'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('navy'); //$graph->ygrid->Show(false); @@ -59,7 +74,11 @@ // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_img/bkgimgflagex5.php b/Examples/examples_img/bkgimgflagex5.php index 95b1476f..98362e3d 100644 --- a/Examples/examples_img/bkgimgflagex5.php +++ b/Examples/examples_img/bkgimgflagex5.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 20, 40); $graph->SetMarginColor('white:0.9'); @@ -24,7 +25,12 @@ $graph->SetShadow(); // Apply a perspective transformation at the end -$graph->Set3DPerspective(Graph\Configs::getConfig('SKEW3D_RIGHT'), 350, 320, true); +$graph->Set3DPerspective( + Graph\Configs::getConfig('SKEW3D_RIGHT'), + 350, + 320, + true +); // Adjust the position of the legend box $graph->legend->Pos(0.03, 0.10); @@ -41,13 +47,22 @@ // Set axis titles and fonts $graph->xaxis->title->Set('Year 2002'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->SetColor('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('navy'); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('navy'); //$graph->ygrid->Show(false); @@ -59,7 +74,11 @@ // Some extra margin (from the top) $graph->title->SetMargin(3); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Create the three var series we will combine $bplot1 = new Plot\BarPlot($datay1); diff --git a/Examples/examples_img/imgmarkerex1.php b/Examples/examples_img/imgmarkerex1.php index ebf9b133..6382361d 100644 --- a/Examples/examples_img/imgmarkerex1.php +++ b/Examples/examples_img/imgmarkerex1.php @@ -1,19 +1,20 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); @@ -21,7 +22,11 @@ // Setup the tab $graph->tabtitle->Set(' Year 2003 '); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 13); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 13 +); $graph->tabtitle->SetColor('darkred', '#E1E1FF'); // Enable X-grid as well @@ -35,13 +40,21 @@ $p1->SetColor('navy'); // Use an image of favourite car as marker -$p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/saab_95.jpg', 0.5); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/saab_95.jpg', + 0.5 +); // Displayes value on top of marker image $p1->value->SetFormat('%d mil'); $p1->value->Show(); $p1->value->SetColor('darkred'); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Increase the margin so that the value is printed avove tje // img marker $p1->value->SetMargin(14); diff --git a/Examples/examples_led/ledex1.php b/Examples/examples_led/ledex1.php index f82d5cf8..660040d2 100644 --- a/Examples/examples_led/ledex1.php +++ b/Examples/examples_led/ledex1.php @@ -1,7 +1,7 @@ SetMargin(30, 20, 60, 20); $graph->SetMarginColor('white'); $graph->SetScale('linlin'); @@ -25,12 +26,18 @@ // Setup title $example_title = 'Using Builtin PlotMarks'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Note: requires jpgraph 1.12p or higher // $graph->SetBackgroundGradient('blue','navy:0.5',GRAD_HOR,BGRAD_PLOT); $graph->tabtitle->Set('Region 1'); -$graph->tabtitle->SetWidth(Graph\Configs::getConfig('TABTITLE_WIDTHFULL')); +$graph->tabtitle->SetWidth( + Graph\Configs::getConfig('TABTITLE_WIDTHFULL') +); // Enable X and Y Grid $graph->xgrid->Show(); @@ -41,7 +48,11 @@ $graph->legend->SetColor('navy'); $graph->legend->SetFillColor('lightgreen'); $graph->legend->SetLineWeight(1); -$graph->legend->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 8); +$graph->legend->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 8 +); $graph->legend->SetShadow('gray@0.4', 3); $graph->legend->SetAbsPos(15, 120, 'right', 'bottom'); @@ -51,7 +62,11 @@ $p1->SetColor('red'); $p1->SetFillColor('yellow@0.5'); $p1->SetWeight(2); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG_DIAMOND'), 5, 0.6); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_DIAMOND'), + 5, + 0.6 +); $p1->SetLegend('2006'); $graph->Add($p1); @@ -59,11 +74,17 @@ $p2->SetColor('darkgreen'); $p2->SetWeight(2); $p2->SetLegend('2001'); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_IMG_MBALL'), 'red'); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_MBALL'), + 'red' +); $graph->Add($p2); // Add a vertical line at the end scale position '7' -$l1 = new Plot\PlotLine(Graph\Configs::getConfig('VERTICAL'), 7); +$l1 = new Plot\PlotLine( + Graph\Configs::getConfig('VERTICAL'), + 7 +); $graph->Add($l1); // Output the graph diff --git a/Examples/examples_line/centeredlineex01.php b/Examples/examples_line/centeredlineex01.php index 0d980a1b..4e2d01e9 100644 --- a/Examples/examples_line/centeredlineex01.php +++ b/Examples/examples_line/centeredlineex01.php @@ -1,32 +1,38 @@ img->SetMargin(40, 40, 40, 40); $graph->img->SetAntiAliasing(); $graph->SetScale('textlin'); $graph->SetShadow(); $example_title = 'Example of line centered plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Use 20% "grace" to get slightly larger scale then min/max of // data $graph->yscale->SetGrace(20); $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); diff --git a/Examples/examples_line/centeredlineex02.php b/Examples/examples_line/centeredlineex02.php index 88b3e422..d25a9651 100644 --- a/Examples/examples_line/centeredlineex02.php +++ b/Examples/examples_line/centeredlineex02.php @@ -1,29 +1,35 @@ img->SetMargin(40, 40, 40, 40); $graph->img->SetAntiAliasing(); $graph->SetScale('textlin'); $graph->SetShadow(); $example_title = 'Example of filled line centered plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\LinePlot($datay); $p1->SetFillColor('green'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); diff --git a/Examples/examples_line/centeredlineex03.php b/Examples/examples_line/centeredlineex03.php index dabcd427..69a8637f 100644 --- a/Examples/examples_line/centeredlineex03.php +++ b/Examples/examples_line/centeredlineex03.php @@ -1,32 +1,43 @@ img->SetMargin(40, 40, 40, 80); $graph->img->SetAntiAliasing(); $graph->SetScale('textlin'); $graph->SetShadow(); $example_title = 'Example slanted X-labels'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 +); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); $graph->xaxis->SetTickLabels($labels); $graph->xaxis->SetLabelAngle(45); $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); diff --git a/Examples/examples_line/centerlinebarex1.php b/Examples/examples_line/centerlinebarex1.php index c04f0d2c..108aae74 100644 --- a/Examples/examples_line/centerlinebarex1.php +++ b/Examples/examples_line/centerlinebarex1.php @@ -1,7 +1,7 @@ img->SetMargin(40, 80, 40, 40); $graph->SetScale('textlin'); $graph->SetShadow(); @@ -23,7 +23,7 @@ $line->SetBarCenter(); $line->SetWeight(2); -$bar = new Plot\BarPlot($ydata); +$bar = new Plot\BarPlot($ydata); $bar2 = new Plot\BarPlot($ydata); $bar2->SetFillColor('red'); diff --git a/Examples/examples_line/clipping_ex1.php b/Examples/examples_line/clipping_ex1.php index 8dbeb21c..5f212ff0 100644 --- a/Examples/examples_line/clipping_ex1.php +++ b/Examples/examples_line/clipping_ex1.php @@ -1,36 +1,48 @@ SetScale('intlin', 0, 10); $graph->SetMargin(30, 20, 70, 40); $graph->SetMarginColor([177, 191, 174]); $graph->SetClipping(false); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->ygrid->SetLineStyle('dashed'); $example_title = 'Manual scale'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->title->SetColor('white'); $subtitle_text = '(No clipping)'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('white'); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); diff --git a/Examples/examples_line/clipping_ex2.php b/Examples/examples_line/clipping_ex2.php index ec4c5e28..d7a8067f 100644 --- a/Examples/examples_line/clipping_ex2.php +++ b/Examples/examples_line/clipping_ex2.php @@ -1,36 +1,48 @@ SetScale('intlin', 0, 10); $graph->SetMargin(30, 20, 70, 40); $graph->SetMarginColor([177, 191, 174]); $graph->SetClipping(true); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->ygrid->SetLineStyle('dashed'); $example_title = 'Manual scale'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->title->SetColor('white'); $subtitle_text = '(With clipping)'; $graph->subtitle->Set($subtitle_text); $graph->subtitle->SetColor('white'); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Create the linear plot $lineplot = new Plot\LinePlot($ydata); diff --git a/Examples/examples_line/filledgridex1.php b/Examples/examples_line/filledgridex1.php index f3847058..6dcf784d 100644 --- a/Examples/examples_line/filledgridex1.php +++ b/Examples/examples_line/filledgridex1.php @@ -1,7 +1,7 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); diff --git a/Examples/examples_line/filledline01.php b/Examples/examples_line/filledline01.php index 65c14b09..b73451f6 100644 --- a/Examples/examples_line/filledline01.php +++ b/Examples/examples_line/filledline01.php @@ -1,27 +1,33 @@ img->SetMargin(40, 40, 40, 40); $graph->SetScale('textlin'); $graph->SetShadow(); $example_title = 'Example of filled line plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\LinePlot($datay); $p1->SetFillColor('orange'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $graph->Add($p1); diff --git a/Examples/examples_line/filledlineex01.1.php b/Examples/examples_line/filledlineex01.1.php index 33821f67..60087f9f 100644 --- a/Examples/examples_line/filledlineex01.1.php +++ b/Examples/examples_line/filledlineex01.1.php @@ -1,29 +1,37 @@ SetScale('textlin'); $graph->img->SetMargin(40, 40, 40, 40); $graph->SetShadow(); -$graph->SetGridDepth(Graph\Configs::getConfig('DEPTH_FRONT')); +$graph->SetGridDepth( + Graph\Configs::getConfig('DEPTH_FRONT') +); $example_title = 'Example of filled line plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\LinePlot($datay); $p1->SetFillColor('orange'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $graph->Add($p1); diff --git a/Examples/examples_line/filledlineex01.php b/Examples/examples_line/filledlineex01.php index c222418e..c7c100ef 100644 --- a/Examples/examples_line/filledlineex01.php +++ b/Examples/examples_line/filledlineex01.php @@ -1,28 +1,34 @@ SetScale('textlin'); $graph->img->SetMargin(40, 40, 40, 40); $graph->SetShadow(); $example_title = 'Example of filled line plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\LinePlot($datay); $p1->SetFillColor('orange'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $graph->Add($p1); diff --git a/Examples/examples_line/filledlineex02.php b/Examples/examples_line/filledlineex02.php index ad587be5..6dfed694 100644 --- a/Examples/examples_line/filledlineex02.php +++ b/Examples/examples_line/filledlineex02.php @@ -1,23 +1,27 @@ img->SetMargin(40, 40, 40, 40); $graph->SetScale('textlin'); $graph->SetShadow(); $example_title = 'Example of filled line plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $subtitle_text = '(Starting from Y=0)'; $graph->subtitle->Set($subtitle_text); @@ -25,7 +29,9 @@ $p1 = new Plot\LinePlot($datay); $p1->SetFillColor('orange'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $graph->Add($p1); diff --git a/Examples/examples_line/filledlineex03.php b/Examples/examples_line/filledlineex03.php index c999d59d..55320ac5 100644 --- a/Examples/examples_line/filledlineex03.php +++ b/Examples/examples_line/filledlineex03.php @@ -1,7 +1,7 @@ SetScale('intlin'); $example_title = 'Filled line with NULL values'; $graph->title->set($example_title); diff --git a/Examples/examples_line/filledstepstyleex1.php b/Examples/examples_line/filledstepstyleex1.php index 82c770f3..99056287 100644 --- a/Examples/examples_line/filledstepstyleex1.php +++ b/Examples/examples_line/filledstepstyleex1.php @@ -1,17 +1,18 @@ SetMarginColor('antiquewhite'); $graph->img->SetMargin(60, 40, 40, 50); $graph->img->setTransparent('white'); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1') +); $graph->xaxis->setTextTickInterval(1); $graph->xaxis->SetTextLabelInterval(1); $graph->legend->SetFillColor('antiquewhite'); $graph->legend->SetShadow(true); -$graph->legend->SetLayout(Graph\Configs::getConfig('LEGEND_VERT')); +$graph->legend->SetLayout( + Graph\Configs::getConfig('LEGEND_VERT') +); $graph->legend->Pos(0.02, 0.01); $example_title = 'Step Styled Example'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot = new Plot\LinePlot($ydata); $lineplot->SetColor('black'); diff --git a/Examples/examples_line/funcex1.php b/Examples/examples_line/funcex1.php index dd125f06..d61a0a0d 100644 --- a/Examples/examples_line/funcex1.php +++ b/Examples/examples_line/funcex1.php @@ -1,24 +1,25 @@ E(-1.2 * M_PI, 1.2 * M_PI); +$f = new Util\FuncGenerator('cos($x)*$x'); +[$xdata, $ydata] = $f->E(-1.2 * \M_PI, 1.2 * \M_PI); -$f = new Util\FuncGenerator('$x*$x'); -list($x2data, $y2data) = $f->E(-2, 2); +$f = new Util\FuncGenerator('$x*$x'); +[$x2data, $y2data] = $f->E(-2, 2); // Setup the basic graph -$__width = 450; +$__width = 450; $__height = 350; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); $graph->SetShadow(); $graph->img->SetMargin(50, 50, 60, 40); @@ -27,15 +28,24 @@ $graph->SetColor('lightyellow'); // ... and titles$example_title='Example of Function plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)"); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $graph->xgrid->Show(); $graph->yaxis->SetPos(0); $graph->yaxis->SetWeight(2); $graph->yaxis->HideZeroLabel(); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('black', 'darkblue'); $graph->yaxis->HideTicks(true, false); $graph->yaxis->HideFirstLastLabel(); @@ -43,15 +53,18 @@ $graph->xaxis->SetWeight(2); $graph->xaxis->HideZeroLabel(); $graph->xaxis->HideFirstLastLabel(); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('black', 'darkblue'); $lp1 = new Plot\LinePlot($ydata, $xdata); $lp1->SetColor('blue'); $lp1->SetWeight(2); -$lp2 = new Plot\LinePlot($y2data, $x2data); -list($xm, $ym) = $lp2->Max(); +$lp2 = new Plot\LinePlot($y2data, $x2data); +[$xm, $ym] = $lp2->Max(); $lp2->SetColor('red'); $lp2->SetWeight(2); diff --git a/Examples/examples_line/funcex2.php b/Examples/examples_line/funcex2.php index 6dc409a6..5e9e8648 100644 --- a/Examples/examples_line/funcex2.php +++ b/Examples/examples_line/funcex2.php @@ -1,38 +1,49 @@ E(-M_PI, M_PI, 25); +$f = new Util\FuncGenerator('cos($i)', '$i*$i*$i'); +[$xdata, $ydata] = $f->E(-\M_PI, \M_PI, 25); -$__width = 380; +$__width = 380; $__height = 450; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); $graph->SetShadow(); $graph->img->SetMargin(50, 50, 60, 40); $graph->SetBox(true, 'black', 2); $graph->SetMarginColor('white'); $graph->SetColor('lightyellow'); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_SIMPLE')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_SIMPLE') +); //$graph->xaxis->SetLabelFormat('%.1f'); $example_title = 'Function plot with marker'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $subtitle_text = 'BOXOUT Axis style)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $lp1 = new Plot\LinePlot($ydata, $xdata); -$lp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$lp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $lp1->mark->SetFillColor('red'); $lp1->SetColor('blue'); diff --git a/Examples/examples_line/funcex3.php b/Examples/examples_line/funcex3.php index c9091dcc..5fe7795f 100644 --- a/Examples/examples_line/funcex3.php +++ b/Examples/examples_line/funcex3.php @@ -1,27 +1,30 @@ E(-M_PI, M_PI, 25); +$f = new Util\FuncGenerator('cos($i)', '$i*$i*$i'); +[$xdata, $ydata] = $f->E(-\M_PI, \M_PI, 25); -$__width = 350; +$__width = 350; $__height = 430; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); $graph->SetShadow(); $graph->img->SetMargin(50, 50, 60, 40); $graph->SetBox(true, 'black', 2); $graph->SetMarginColor('white'); $graph->SetColor('lightyellow'); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXIN')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXIN') +); $graph->xgrid->Show(); //$graph->xaxis->SetLabelFormat('%.0f'); @@ -29,10 +32,16 @@ $graph->img->SetMargin(50, 50, 60, 40); $example_title = 'Function plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $subtitle_text = ' BOXIN Axis style)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $lp1 = new Plot\LinePlot($ydata, $xdata); $lp1->SetColor('blue'); diff --git a/Examples/examples_line/funcex4.php b/Examples/examples_line/funcex4.php index 048ce4fa..0a59460d 100644 --- a/Examples/examples_line/funcex4.php +++ b/Examples/examples_line/funcex4.php @@ -1,24 +1,25 @@ E(-1.2 * M_PI, 1.2 * M_PI); +$f = new Util\FuncGenerator('cos($x)*$x'); +[$xdata, $ydata] = $f->E(-1.2 * \M_PI, 1.2 * \M_PI); -$f = new Util\FuncGenerator('$x*$x'); -list($x2data, $y2data) = $f->E(-2, 2); +$f = new Util\FuncGenerator('$x*$x'); +[$x2data, $y2data] = $f->E(-2, 2); // Setup the basic graph -$__width = 450; +$__width = 450; $__height = 350; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('linlin'); //$graph->SetShadow(); $graph->img->SetMargin(5, 10, 60, 9); @@ -27,10 +28,16 @@ $graph->SetColor('black'); // ... and titles$example_title='Example of Function plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('lightgreen'); $graph->subtitle->Set("(With some more advanced axis formatting\nHiding first and last label)"); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); $graph->subtitle->SetColor('lightgreen'); $graph->xgrid->Show(); @@ -40,7 +47,10 @@ $graph->yaxis->SetPos(0); $graph->yaxis->SetWeight(2); $graph->yaxis->HideZeroLabel(); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->yaxis->SetColor('green', 'green'); $graph->yaxis->HideTicks(true, true); $graph->yaxis->HideFirstLastLabel(); @@ -48,15 +58,18 @@ $graph->xaxis->SetWeight(2); $graph->xaxis->HideZeroLabel(); $graph->xaxis->HideFirstLastLabel(); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetColor('green', 'green'); $lp1 = new Plot\LinePlot($ydata, $xdata); $lp1->SetColor('yellow'); $lp1->SetWeight(2); -$lp2 = new Plot\LinePlot($y2data, $x2data); -list($xm, $ym) = $lp2->Max(); +$lp2 = new Plot\LinePlot($y2data, $x2data); +[$xm, $ym] = $lp2->Max(); $lp2->SetColor('blue'); $lp2->SetWeight(2); diff --git a/Examples/examples_line/gradbkgex1.php b/Examples/examples_line/gradbkgex1.php index b7e2765e..82c1d066 100644 --- a/Examples/examples_line/gradbkgex1.php +++ b/Examples/examples_line/gradbkgex1.php @@ -1,10 +1,11 @@ SetMarginColor('white'); $graph->SetScale('textlin', 0, 50); $graph->SetMargin(30, 50, 30, 30); @@ -29,7 +30,11 @@ // Setup the tab title $graph->tabtitle->Set(' 3rd Division '); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 13); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 13 +); // Setup x,Y grid $graph->xgrid->Show(); @@ -42,13 +47,21 @@ $graph->yaxis->SetColor('orange', 'black'); // Ticks on the outsid -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Setup the legend box colors and font $graph->legend->SetColor('white', 'navy'); $graph->legend->SetFillColor('navy@0.25'); -$graph->legend->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 8); +$graph->legend->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 8 +); $graph->legend->SetShadow('darkgray@0.4', 3); $graph->legend->SetPos(0.05, 0.05, 'right', 'top'); diff --git a/Examples/examples_line/gradlinefillex1.php b/Examples/examples_line/gradlinefillex1.php index 3b2a81a3..e02defc8 100644 --- a/Examples/examples_line/gradlinefillex1.php +++ b/Examples/examples_line/gradlinefillex1.php @@ -1,7 +1,7 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('intlin'); $graph->SetMarginColor('darkgreen@0.8'); diff --git a/Examples/examples_line/gradlinefillex2.php b/Examples/examples_line/gradlinefillex2.php index bda0a09f..0de0c173 100644 --- a/Examples/examples_line/gradlinefillex2.php +++ b/Examples/examples_line/gradlinefillex2.php @@ -1,7 +1,7 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('intlin'); $graph->SetBox(); diff --git a/Examples/examples_line/gradlinefillex3.php b/Examples/examples_line/gradlinefillex3.php index 9a380d5e..7543024b 100644 --- a/Examples/examples_line/gradlinefillex3.php +++ b/Examples/examples_line/gradlinefillex3.php @@ -1,7 +1,7 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('intlin'); $graph->SetBox(); diff --git a/Examples/examples_line/gradlinefillex4.php b/Examples/examples_line/gradlinefillex4.php index 65ed93c4..1f4e57e5 100644 --- a/Examples/examples_line/gradlinefillex4.php +++ b/Examples/examples_line/gradlinefillex4.php @@ -1,7 +1,7 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('intlin'); $graph->SetBox(); diff --git a/Examples/examples_line/interpolation-growth-log.php b/Examples/examples_line/interpolation-growth-log.php index 65c586d1..90c45aa5 100644 --- a/Examples/examples_line/interpolation-growth-log.php +++ b/Examples/examples_line/interpolation-growth-log.php @@ -1,10 +1,11 @@ SetScale('intlog'); $graph->SetMargin(50, 50, 20, 30); $graph->SetFrame(false); @@ -32,12 +33,17 @@ $graph->SetColor('lightyellow@0.7'); $example_title = 'Interpolation growth for size 10x10'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Interpolation factor', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_YBOXIN')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_YBOXIN') +); $graph->xgrid->Show(); $lp1 = new Plot\LinePlot($ydata, $xdata); diff --git a/Examples/examples_line/interpolation-growth.php b/Examples/examples_line/interpolation-growth.php index a1993618..6b2e1e8c 100644 --- a/Examples/examples_line/interpolation-growth.php +++ b/Examples/examples_line/interpolation-growth.php @@ -1,10 +1,11 @@ SetScale('intint'); $graph->SetMargin(50, 50, 20, 30); $graph->SetFrame(false); @@ -32,12 +33,17 @@ $graph->SetColor('lightyellow@0.7'); $example_title = 'Interpolation growth for size 10x10'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->SetTitle('Interpolation factor', 'center'); $graph->xaxis->SetTitleMargin(10); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_YBOXIN')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_YBOXIN') +); $graph->xgrid->Show(); $lp1 = new Plot\LinePlot($ydata, $xdata); diff --git a/Examples/examples_line/linebarcentex1.php b/Examples/examples_line/linebarcentex1.php index e37cbd8f..965b5684 100644 --- a/Examples/examples_line/linebarcentex1.php +++ b/Examples/examples_line/linebarcentex1.php @@ -1,10 +1,11 @@ gDateLocale->GetShortMonth(); +$graph = new Graph\Graph($__width, $__height); +$datax = $graph->gDateLocale->GetShortMonth(); $graph->SetScale('textlin'); $graph->SetMargin(40, 130, 20, 40); $graph->SetShadow(); @@ -43,9 +44,18 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Display the graph $graph->Stroke(); diff --git a/Examples/examples_line/linebarex1.php b/Examples/examples_line/linebarex1.php index 3bb642ee..b11619e1 100644 --- a/Examples/examples_line/linebarex1.php +++ b/Examples/examples_line/linebarex1.php @@ -1,34 +1,37 @@ SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLFRAME')); $graph->SetShadow(); @@ -41,7 +44,10 @@ $graph->subtitle->Set("100 data points, X-Scale: 'text'"); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Make the margin around the plot a little bit bigger // then default diff --git a/Examples/examples_line/linebarex2.php b/Examples/examples_line/linebarex2.php index 81dc1ce9..8e5cd71a 100644 --- a/Examples/examples_line/linebarex2.php +++ b/Examples/examples_line/linebarex2.php @@ -1,29 +1,32 @@ SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLFRAME')); $graph->SetShadow(); @@ -37,7 +40,10 @@ $graph->subtitle->Set($subtitle_text); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Make the margin around the plot a little bit bigger // then default diff --git a/Examples/examples_line/linebarex3.php b/Examples/examples_line/linebarex3.php index 134f994e..acc55b5c 100644 --- a/Examples/examples_line/linebarex3.php +++ b/Examples/examples_line/linebarex3.php @@ -1,28 +1,32 @@ img->SetMargin(40, 180, 40, 40); $graph->SetBackgroundImage(__DIR__ . '/../assets/tiger_bkg.png', Graph\Configs::getConfig('BGIMG_FILLFRAME')); @@ -36,7 +40,10 @@ $graph->subtitle->Set($subtitle_text); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Slightly adjust the legend from it's default position in the // top right corner. diff --git a/Examples/examples_line/linegraceex.php b/Examples/examples_line/linegraceex.php index bb03ebd8..d1c6e0d9 100644 --- a/Examples/examples_line/linegraceex.php +++ b/Examples/examples_line/linegraceex.php @@ -1,18 +1,19 @@ img->SetMargin(40, 40, 40, 40); $graph->img->SetAntiAliasing(); @@ -20,13 +21,18 @@ $graph->SetShadow(); $example_title = 'Example of 10% top/bottom grace'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Add 10% grace to top and bottom of plot $graph->yscale->SetGrace(10, 10); $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); diff --git a/Examples/examples_line/lineimagefillex1.php b/Examples/examples_line/lineimagefillex1.php index 97a92904..c283a682 100644 --- a/Examples/examples_line/lineimagefillex1.php +++ b/Examples/examples_line/lineimagefillex1.php @@ -1,28 +1,35 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->SetScale('intlin'); $graph->SetMarginColor('white'); $graph->SetBox(); //$graph->img->SetAntialiasing(); -$graph->SetGridDepth(Graph\Configs::getConfig('DEPTH_FRONT')); +$graph->SetGridDepth( + Graph\Configs::getConfig('DEPTH_FRONT') +); $graph->ygrid->SetColor('gray@0.7'); $graph->SetBackgroundImage(__DIR__ . '/../assets/classroom.jpg', Graph\Configs::getConfig('BGIMG_FILLPLOT')); @@ -37,7 +44,9 @@ $p2 = new Plot\LinePlot($datay); $p2->SetColor('black@0.4'); $p2->SetWeight(3); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $p2->mark->SetColor('orange@0.5'); $p2->mark->SetFillColor('orange@0.3'); $graph->Add($p2); diff --git a/Examples/examples_line/linlogex1.php b/Examples/examples_line/linlogex1.php index 650f10d8..333941af 100644 --- a/Examples/examples_line/linlogex1.php +++ b/Examples/examples_line/linlogex1.php @@ -1,19 +1,23 @@ SetScale('linlog'); $graph->img->SetMargin(40, 20, 20, 40); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->Set('ab/2'); $graph->yaxis->title->Set('rho_s'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->ygrid->Show(true, true); $graph->xgrid->Show(true, true); diff --git a/Examples/examples_line/manscaleex1.php b/Examples/examples_line/manscaleex1.php index cbfb91ac..9a064183 100644 --- a/Examples/examples_line/manscaleex1.php +++ b/Examples/examples_line/manscaleex1.php @@ -1,23 +1,27 @@ SetScale('textlin', 3, 35); $graph->yscale->ticks->Set(8, 2); $example_title = 'Manual scale, manual ticks'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $line = new Plot\LinePlot($ydata); $graph->Add($line); diff --git a/Examples/examples_line/manscaleex2.php b/Examples/examples_line/manscaleex2.php index ce9a5645..f8ffd890 100644 --- a/Examples/examples_line/manscaleex2.php +++ b/Examples/examples_line/manscaleex2.php @@ -1,22 +1,26 @@ SetScale('textlin', 3, 35); $example_title = 'Manual scale, exact limits'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $line = new Plot\LinePlot($ydata); $graph->Add($line); diff --git a/Examples/examples_line/manscaleex3.php b/Examples/examples_line/manscaleex3.php index e9accc2b..f52f55dd 100644 --- a/Examples/examples_line/manscaleex3.php +++ b/Examples/examples_line/manscaleex3.php @@ -1,24 +1,30 @@ SetScale('textlin', 3, 35); -$graph->SetTickDensity(Graph\Configs::getConfig('TICKD_DENSE')); +$graph->SetTickDensity( + Graph\Configs::getConfig('TICKD_DENSE') +); $graph->yscale->SetAutoTicks(); $example_title = 'Manual scale, auto ticks'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $line = new Plot\LinePlot($ydata); $graph->Add($line); diff --git a/Examples/examples_line/manscaleex4.php b/Examples/examples_line/manscaleex4.php index db5f1b6b..3b725a02 100644 --- a/Examples/examples_line/manscaleex4.php +++ b/Examples/examples_line/manscaleex4.php @@ -1,23 +1,27 @@ SetScale('textlin', 3, 35); $graph->yscale->SetAutoTicks(); $example_title = 'Manual scale, allow adjustment'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $line = new Plot\LinePlot($ydata); $graph->Add($line); diff --git a/Examples/examples_line/new_line3.php b/Examples/examples_line/new_line3.php index c1fa1e04..a6df7104 100644 --- a/Examples/examples_line/new_line3.php +++ b/Examples/examples_line/new_line3.php @@ -1,10 +1,11 @@ SetScale('textlin', 0, 50); @@ -38,11 +39,19 @@ $graph->Add($p2); // Use an image of favourite car as marker -$p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/rose.gif', 1.0); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/rose.gif', + 1.0 +); $p1->SetLegend('rose'); $p1->SetColor('#CD5C5C'); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/sunflower.gif', 1.0); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/sunflower.gif', + 1.0 +); $p2->SetLegend('sunflower'); $p2->SetColor('#CD5C5C'); diff --git a/Examples/examples_line/no_dim_plotlineex1.php b/Examples/examples_line/no_dim_plotlineex1.php index c50eb10b..8ac35860 100644 --- a/Examples/examples_line/no_dim_plotlineex1.php +++ b/Examples/examples_line/no_dim_plotlineex1.php @@ -1,39 +1,57 @@ SetScale('textlin'); $graph->SetMargin(40, 20, 50, 70); $graph->legend->SetPos(0.5, 0.97, 'center', 'bottom'); $example_title = 'Plot line legend'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->SetTitleBackground('lightblue:1.3', Graph\Configs::getConfig('TITLEBKG_STYLE2'), Graph\Configs::getConfig('TITLEBKG_FRAME_BEVEL')); -$graph->SetTitleBackgroundFillStyle(Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), 'lightblue', 'navy'); +$graph->SetTitleBackgroundFillStyle( + Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), + 'lightblue', + 'navy' +); // Create a bar pot $bplot = new Plot\BarPlot($datay); $bplot->value->Show(); -$bplot->value->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 8); +$bplot->value->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 8 +); $bplot->SetValuePos('top'); $bplot->SetLegend('Bar Legend'); $graph->Add($bplot); -$pline = new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 8, 'red', 2); +$pline = new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 8, + 'red', + 2 +); $pline->SetLegend('Line Legend'); $graph->legend->SetColumns(10); $graph->Add($pline); diff --git a/Examples/examples_line/no_test_lineiconex1.php b/Examples/examples_line/no_test_lineiconex1.php index c6cf48bf..dd7672e7 100644 --- a/Examples/examples_line/no_test_lineiconex1.php +++ b/Examples/examples_line/no_test_lineiconex1.php @@ -1,29 +1,34 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('textlin'); $graph->title->Set('Adding an icon ("tux") in the background'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); //$graph->SetBackgroundGradient('red','blue'); diff --git a/Examples/examples_line/no_test_lineiconex2.php b/Examples/examples_line/no_test_lineiconex2.php index bb598fae..19018395 100644 --- a/Examples/examples_line/no_test_lineiconex2.php +++ b/Examples/examples_line/no_test_lineiconex2.php @@ -1,7 +1,7 @@ SetMargin(40, 40, 20, 30); $graph->SetScale('textlin'); $example_title = 'Adding a country flag as a an icon'; diff --git a/Examples/examples_line/no_test_new_line1.php b/Examples/examples_line/no_test_new_line1.php index 30bc5727..b44cca6d 100644 --- a/Examples/examples_line/no_test_new_line1.php +++ b/Examples/examples_line/no_test_new_line1.php @@ -1,7 +1,7 @@ SetScale('textlin'); $theme_class = new UniversalTheme(); diff --git a/Examples/examples_line/no_test_new_line2.php b/Examples/examples_line/no_test_new_line2.php index 12b0c5f7..5bd88f71 100644 --- a/Examples/examples_line/no_test_new_line2.php +++ b/Examples/examples_line/no_test_new_line2.php @@ -1,10 +1,11 @@ SetScale('textlin'); $theme_class = new UniversalTheme(); @@ -39,14 +40,22 @@ $p1->SetColor('#55bbdd'); $p1->SetLegend('Line 1'); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE'), '', 1.0); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE'), + '', + 1.0 +); $p1->mark->SetColor('#55bbdd'); $p1->mark->SetFillColor('#55bbdd'); $p1->SetCenter(); $p2->SetColor('#aaaaaa'); $p2->SetLegend('Line 2'); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_UTRIANGLE'), '', 1.0); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_UTRIANGLE'), + '', + 1.0 +); $p2->mark->SetColor('#aaaaaa'); $p2->mark->SetFillColor('#aaaaaa'); $p2->value->SetMargin(14); diff --git a/Examples/examples_line/no_test_new_line4.php b/Examples/examples_line/no_test_new_line4.php index 1b7ddc73..31152bf2 100644 --- a/Examples/examples_line/no_test_new_line4.php +++ b/Examples/examples_line/no_test_new_line4.php @@ -1,10 +1,11 @@ SetScale('textlin', 0, 50); @@ -38,13 +39,21 @@ $graph->Add($p2); // Use an image of favourite car as marker -$p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/new1.gif', 0.8); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/new1.gif', + 0.8 +); $p1->SetColor('#aadddd'); $p1->value->SetFormat('%d'); $p1->value->Show(); $p1->value->SetColor('#55bbdd'); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/new2.gif', 0.8); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/new2.gif', + 0.8 +); $p2->SetColor('#ddaa99'); $p2->value->SetFormat('%d'); $p2->value->Show(); diff --git a/Examples/examples_line/no_test_new_line5.php b/Examples/examples_line/no_test_new_line5.php index 2ca76621..a4f95863 100644 --- a/Examples/examples_line/no_test_new_line5.php +++ b/Examples/examples_line/no_test_new_line5.php @@ -1,19 +1,20 @@ SetScale('intlin', 0, $aYMax = 50); $theme_class = new UniversalTheme(); @@ -34,7 +35,9 @@ $graph->xaxis->SetLabelMargin(20); $graph->yaxis->SetLabelMargin(20); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->img->SetAngle(180); // Create the line diff --git a/Examples/examples_line/no_test_new_step1.php b/Examples/examples_line/no_test_new_step1.php index 40144daf..caec8588 100644 --- a/Examples/examples_line/no_test_new_step1.php +++ b/Examples/examples_line/no_test_new_step1.php @@ -1,7 +1,7 @@ SetScale('intlin', 0, $aYMax = 50); $theme_class = new UniversalTheme(); $graph->SetTheme($theme_class); diff --git a/Examples/examples_line/nullvalueex01.php b/Examples/examples_line/nullvalueex01.php index 1cbba960..f5205ae1 100644 --- a/Examples/examples_line/nullvalueex01.php +++ b/Examples/examples_line/nullvalueex01.php @@ -1,22 +1,23 @@ img->SetMargin(40, 150, 40, 80); $graph->SetScale('textlin'); $graph->SetShadow(); @@ -26,20 +27,33 @@ $graph->title->set($example_title); // Use built in font -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 +); // Slightly adjust the legend from it's default position $graph->legend->Pos(0.03, 0.5, 'right', 'center'); -$graph->legend->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->legend->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup X-scale $graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->xaxis->SetLabelAngle(45); // Create the first line $p1 = new Plot\LinePlot($datay); -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $p1->mark->SetFillColor('red'); $p1->mark->SetWidth(4); $p1->SetColor('blue'); @@ -49,7 +63,9 @@ // ... and the second $p2 = new Plot\LinePlot($data2y); -$p2->mark->SetType(Graph\Configs::getConfig('MARK_STAR')); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_STAR') +); $p2->mark->SetFillColor('red'); $p2->mark->SetWidth(4); $p2->SetColor('red'); diff --git a/Examples/examples_line/partiallyfilledlineex1.php b/Examples/examples_line/partiallyfilledlineex1.php index de0f1bcd..07fc1364 100644 --- a/Examples/examples_line/partiallyfilledlineex1.php +++ b/Examples/examples_line/partiallyfilledlineex1.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetShadow(true); $graph->SetMarginColor('lightblue'); @@ -26,7 +27,10 @@ // Setup title $example_title = 'Filled Area Example'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup semi-filled line plot $lineplot = new Plot\LinePlot($ydata); @@ -40,7 +44,9 @@ $lineplot->AddArea(6, 8, Graph\Configs::getConfig('LP_AREA_FILLED'), 'green'); // Display the marks on the lines -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_DIAMOND')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_DIAMOND') +); $lineplot->mark->SetSize(8); $lineplot->mark->Show(); diff --git a/Examples/examples_line/splineex1.php b/Examples/examples_line/splineex1.php index 793bdd04..cb59d592 100644 --- a/Examples/examples_line/splineex1.php +++ b/Examples/examples_line/splineex1.php @@ -1,10 +1,11 @@ Get(50); +[$newx, $newy] = $spline->Get(50); // Create the graph -$__width = 300; +$__width = 300; $__height = 200; -$g = new Graph\Graph($__width, $__height); +$g = new Graph\Graph($__width, $__height); $g->SetMargin(30, 20, 40, 30); $example_title = 'Natural cubic splines'; $g->title->set($example_title); -$g->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$g->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $subtitle_text = '(Control points shown in red)'; $g->subtitle->Set($subtitle_text); $g->subtitle->SetColor('darkred'); diff --git a/Examples/examples_line/staticlinebarex1.php b/Examples/examples_line/staticlinebarex1.php index e786d402..cb9a7198 100644 --- a/Examples/examples_line/staticlinebarex1.php +++ b/Examples/examples_line/staticlinebarex1.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -50,14 +59,32 @@ $graph->Add($bplot); // Add mark graph with static lines -$graph->AddLine(new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 0, 'black', 2)); -$graph->AddLine(new Plot\PlotLine(Graph\Configs::getConfig('VERTICAL'), 3, 'black', 2)); +$graph->AddLine(new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 0, + 'black', + 2 +)); +$graph->AddLine(new Plot\PlotLine( + Graph\Configs::getConfig('VERTICAL'), + 3, + 'black', + 2 +)); //$graph->title->Set("Test of bar gradient fill"); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_line/tabtitleex1.php b/Examples/examples_line/tabtitleex1.php index c3c9039b..3e74fda2 100644 --- a/Examples/examples_line/tabtitleex1.php +++ b/Examples/examples_line/tabtitleex1.php @@ -1,10 +1,11 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); $graph->SetMargin(30, 50, 30, 30); $graph->tabtitle->Set(' Year 2003 '); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 13); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 13 +); $graph->yaxis->HideZeroLabel(); $graph->ygrid->SetFill(true, '#EFEFEF@0.5', '#BBCCFF@0.5'); diff --git a/Examples/examples_line/timestampex01.php b/Examples/examples_line/timestampex01.php index 8c275af2..db5ebb7c 100644 --- a/Examples/examples_line/timestampex01.php +++ b/Examples/examples_line/timestampex01.php @@ -1,41 +1,43 @@ $i; ++$i) { + $data[$i] = \mt_rand(20, 100) * 0.2 + $data[$i - 1] * 0.8; $xdata[$i] = $adjstart + $i * Graph\Configs::getConfig('SAMPLERATE'); } @@ -44,9 +46,9 @@ function TimeCallback($aVal) // length to end on an even label tick. $adjend = $adjstart + (Graph\Configs::getConfig('NDATAPOINTS') + 10) * 10; -$__width = 500; +$__width = 500; $__height = 250; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetMargin(40, 20, 30, 50); // Now specify the X-scale explicit but let the Y-scale be auto-scaled diff --git a/Examples/examples_line/titleex1.php b/Examples/examples_line/titleex1.php index f683f4f8..ed3878b3 100644 --- a/Examples/examples_line/titleex1.php +++ b/Examples/examples_line/titleex1.php @@ -1,10 +1,11 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 30, 30); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $example_title = 'The Title'; $graph->title->set($example_title); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $subtitle_text = 'The Subtitle'; $graph->subtitle->Set($subtitle_text); -$graph->subsubtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_ITALIC'), 9); +$graph->subsubtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_ITALIC'), + 9 +); $graph->subsubtitle->Set('The Subsubitle'); // Create the linear plot diff --git a/Examples/examples_line/y2synch.php b/Examples/examples_line/y2synch.php index ed293386..c31e32ab 100644 --- a/Examples/examples_line/y2synch.php +++ b/Examples/examples_line/y2synch.php @@ -1,29 +1,30 @@ SetMargin(50, 60, 40, 45); @@ -36,18 +37,30 @@ function toCelcius($aVal) // Overall graph title $example_title = 'Synchronized Y & Y2 scales'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Title for X-axis $graph->xaxis->title->Set('Measurement'); $graph->xaxis->title->SetMargin(5); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); // Create Y data set $lplot = new Plot\LinePlot($datay); $graph->yaxis->title->Set('Celcius (C)'); $graph->yaxis->title->SetMargin(5); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); // ... and add the plot to the Y-axis $graph->Add($lplot); @@ -56,7 +69,11 @@ function toCelcius($aVal) $l2plot->SetWeight(0); $graph->y2axis->title->Set('Fahrenheit (F)'); $graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels -$graph->y2axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->y2axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); $graph->y2axis->SetLabelFormatCallback('toFahrenheit'); $graph->y2axis->SetColor('navy'); diff --git a/Examples/examples_line/y2synch2.php b/Examples/examples_line/y2synch2.php index 6cc5d871..c3450586 100644 --- a/Examples/examples_line/y2synch2.php +++ b/Examples/examples_line/y2synch2.php @@ -1,29 +1,30 @@ SetMargin(50, 60, 40, 45); @@ -36,18 +37,30 @@ function toCelcius($aVal) // Overall graph title $example_title = 'Synchronized Y & Y2 scales'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Title for X-axis $graph->xaxis->title->Set('Measurement'); $graph->xaxis->title->SetMargin(5); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); // Create Y data set $lplot = new Plot\BarPlot($datay); $graph->yaxis->title->Set('Celcius (C)'); $graph->yaxis->title->SetMargin(5); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); // ... and add the plot to the Y-axis $graph->Add($lplot); @@ -56,7 +69,11 @@ function toCelcius($aVal) $l2plot->SetWeight(0); $graph->y2axis->title->Set('Fahrenheit (F)'); $graph->y2axis->title->SetMargin(5); // Some extra margin to clear labels -$graph->y2axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$graph->y2axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); $graph->y2axis->SetLabelFormatCallback('toFahrenheit'); $graph->y2axis->SetColor('navy'); diff --git a/Examples/examples_matrix/no_test_matrix_edgeex01.php b/Examples/examples_matrix/no_test_matrix_edgeex01.php index 5f4397d3..81d619a0 100644 --- a/Examples/examples_matrix/no_test_matrix_edgeex01.php +++ b/Examples/examples_matrix/no_test_matrix_edgeex01.php @@ -1,10 +1,11 @@ $i; ++$i) { + $xlabels[$i] = \sprintf('xlabel: %02d', $i); } -for ($i = 0; $i < count($data); ++$i) { - $ylabels[$i] = sprintf('ylabel: %02d', $i); + +for ($i = 0; \count($data) > $i; ++$i) { + $ylabels[$i] = \sprintf('ylabel: %02d', $i); } // Setup a nasic matrix graph -$__width = 400; +$__width = 400; $__height = 250; -$graph = new Graph\MatrixGraph($__width, $__height); +$graph = new Graph\MGraph($__width, $__height); $graph->SetMarginColor('white'); $example_title = 'Adding labels on the edges'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Create one matrix plot $mp = new Plot\MatrixPlot($data, 1); @@ -44,13 +50,21 @@ // Setup column lablels $mp->collabel->Set($xlabels); $mp->collabel->SetSide('bottom'); -$mp->collabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$mp->collabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $mp->collabel->SetFontColor('darkgray'); // Setup row lablels $mp->rowlabel->Set($ylabels); $mp->rowlabel->SetSide('right'); -$mp->rowlabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$mp->rowlabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $mp->rowlabel->SetFontColor('darkgray'); // Move the legend more to the right diff --git a/Examples/examples_matrix/no_test_matrix_edgeex02.php b/Examples/examples_matrix/no_test_matrix_edgeex02.php index 6054b266..98f5c725 100644 --- a/Examples/examples_matrix/no_test_matrix_edgeex02.php +++ b/Examples/examples_matrix/no_test_matrix_edgeex02.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $mp = new MatrixPlot($data, 1); $mp->SetSize(0.55); $mp->SetCenterPos(0.45, 0.45); $rowtitles = []; + for ($i = 0; $i < $nrow; ++$i) { - $rowtitles[$i] = sprintf('Row: %02d', $i); + $rowtitles[$i] = \sprintf('Row: %02d', $i); } $coltitles = []; + for ($i = 0; $i < $ncol; ++$i) { - $coltitles[$i] = sprintf('Col: %02d', $i); + $coltitles[$i] = \sprintf('Col: %02d', $i); } $mp->rowlabel->Set($rowtitles); -$mp->rowlabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$mp->rowlabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); $mp->rowlabel->SetFontColor('blue'); $mp->rowlabel->SetSide('left'); $mp->collabel->Set($coltitles); -$mp->collabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$mp->collabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); $mp->collabel->SetFontColor('darkred'); $mp->collabel->SetAngle(70); // 90 is default for col titles $mp->collabel->SetSide('bottom'); diff --git a/Examples/examples_matrix/no_test_matrix_ex0.php b/Examples/examples_matrix/no_test_matrix_ex0.php index 16794fe8..e57a4246 100644 --- a/Examples/examples_matrix/no_test_matrix_ex0.php +++ b/Examples/examples_matrix/no_test_matrix_ex0.php @@ -1,10 +1,11 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Create a ,atrix plot using all default values $mp = new MatrixPlot($data); diff --git a/Examples/examples_matrix/no_test_matrix_ex01.php b/Examples/examples_matrix/no_test_matrix_ex01.php index 47f438b2..5c2ec323 100644 --- a/Examples/examples_matrix/no_test_matrix_ex01.php +++ b/Examples/examples_matrix/no_test_matrix_ex01.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); + +$mp = []; +$n = 4; +$pos = [ + 0.3, 0.33, 0.8, 0.68, + 0.3, 0.68, 0.8, 0.33, +]; -$mp = []; -$n = 4; -$pos = [0.3, 0.33, 0.8, 0.68, - 0.3, 0.68, 0.8, 0.33, ]; for ($i = 0; $i < $n; ++$i) { $mp[$i] = new MatrixPlot($data); $mp[$i]->colormap->SetMap($i); diff --git a/Examples/examples_matrix/no_test_matrix_ex02.php b/Examples/examples_matrix/no_test_matrix_ex02.php index d9edfb5e..34c23081 100644 --- a/Examples/examples_matrix/no_test_matrix_ex02.php +++ b/Examples/examples_matrix/no_test_matrix_ex02.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $mp = new MatrixPlot($data, 1); $mp->colormap->SetMap(0); diff --git a/Examples/examples_matrix/no_test_matrix_ex03.php b/Examples/examples_matrix/no_test_matrix_ex03.php index 76b843ad..2b6df23f 100644 --- a/Examples/examples_matrix/no_test_matrix_ex03.php +++ b/Examples/examples_matrix/no_test_matrix_ex03.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $mp = new MatrixPlot($data, 1); $mp->SetSize(0.6); diff --git a/Examples/examples_matrix/no_test_matrix_ex04.1.php b/Examples/examples_matrix/no_test_matrix_ex04.1.php index d1e5dc37..b23bd41b 100644 --- a/Examples/examples_matrix/no_test_matrix_ex04.1.php +++ b/Examples/examples_matrix/no_test_matrix_ex04.1.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $subtitle_text = 'Alphablending = 0.2'; $graph->subtitle->Set($subtitle_text); diff --git a/Examples/examples_matrix/no_test_matrix_ex04.2.php b/Examples/examples_matrix/no_test_matrix_ex04.2.php index ee998f65..bae538ee 100644 --- a/Examples/examples_matrix/no_test_matrix_ex04.2.php +++ b/Examples/examples_matrix/no_test_matrix_ex04.2.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $subtitle_text = 'Alphablending = 0.7'; $graph->subtitle->Set($subtitle_text); diff --git a/Examples/examples_matrix/no_test_matrix_ex04.php b/Examples/examples_matrix/no_test_matrix_ex04.php index 7d90f180..c1e795f1 100644 --- a/Examples/examples_matrix/no_test_matrix_ex04.php +++ b/Examples/examples_matrix/no_test_matrix_ex04.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Add a stretched background image $graph->SetBackgroundImage(__DIR__ . '/../assets/ironrod.jpg', Graph\Configs::getConfig('BGIMG_FILLFRAME')); diff --git a/Examples/examples_matrix/no_test_matrix_ex05.php b/Examples/examples_matrix/no_test_matrix_ex05.php index b15ea3b8..9540f29e 100644 --- a/Examples/examples_matrix/no_test_matrix_ex05.php +++ b/Examples/examples_matrix/no_test_matrix_ex05.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $mp = new MatrixPlot($data, 2); $mp->SetSize(0.85); diff --git a/Examples/examples_matrix/no_test_matrix_ex06.php b/Examples/examples_matrix/no_test_matrix_ex06.php index 7c72c427..11e2419d 100644 --- a/Examples/examples_matrix/no_test_matrix_ex06.php +++ b/Examples/examples_matrix/no_test_matrix_ex06.php @@ -1,13 +1,15 @@ SetBackgroundGradient('lightsteelblue:0.8', 'lightsteelblue:0.3'); $example_title = 'Matrix with lines'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('white'); // Create two lines to add as markers -$l1 = new Plot\PlotLine(Graph\Configs::getConfig('VERTICAL'), 5, 'lightgray:1.5', 4); -$l2 = new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 3, 'lightgray:1.5', 4); +$l1 = new Plot\PlotLine( + Graph\Configs::getConfig('VERTICAL'), + 5, + 'lightgray:1.5', + 4 +); +$l2 = new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 3, + 'lightgray:1.5', + 4 +); // Create one matrix plot $mp = new MatrixPlot($data, 1); @@ -61,19 +78,31 @@ // Setup column lablels $mp->collabel->Set($collabels); $mp->collabel->SetSide('top'); -$mp->collabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$mp->collabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $mp->collabel->SetFontColor('lightgray'); // Setup row lablels $mp->rowlabel->Set($rowlabels); $mp->rowlabel->SetSide('right'); -$mp->rowlabel->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$mp->rowlabel->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $mp->rowlabel->SetFontColor('lightgray'); // Move the legend more to the right $mp->legend->SetMargin(90); $mp->legend->SetColor('white'); -$mp->legend->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 10); +$mp->legend->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->Add($mp); $graph->Stroke(); diff --git a/Examples/examples_matrix/no_test_matrix_introex.php b/Examples/examples_matrix/no_test_matrix_introex.php index d1022ccc..779a6ef5 100644 --- a/Examples/examples_matrix/no_test_matrix_introex.php +++ b/Examples/examples_matrix/no_test_matrix_introex.php @@ -1,13 +1,15 @@ SetMargin(1, 2, 70, 1); $graph->SetColor('white'); $graph->SetMarginColor('#fafafa'); $example_title = 'Intro matrix graph'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); // Setup the background image $graph->SetBackgroundImage(__DIR__ . '/../assets/fireplace.jpg', Graph\Configs::getConfig('BGIMG_FILLPLOT')); @@ -53,7 +59,8 @@ // Create the 2 matrix plots //-------------------------------------------------------------- $mp = []; -$n = 2; +$n = 2; + for ($i = 0; $i < $n; ++$i) { $mp[$i] = new MatrixPlot($data); $mp[$i]->colormap->SetMap($i); @@ -77,13 +84,19 @@ $txts = [ ['Temperature gradient', $width / 2, 80], ['Heat color map', 200, 110], - ['High contrast map', 560, 110], ]; + ['High contrast map', 560, 110], +]; -$n = count($txts); +$n = \count($txts); $t = []; + for ($i = 0; $i < $n; ++$i) { $t[$i] = new Text($txts[$i][0], $txts[$i][1], $txts[$i][2]); - $t[$i]->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); + $t[$i]->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 + ); $t[$i]->SetColor('white'); $t[$i]->SetAlign('center', 'top'); } diff --git a/Examples/examples_matrix/no_test_matrix_layout_ex1.php b/Examples/examples_matrix/no_test_matrix_layout_ex1.php index 685f4f45..fc84f3a3 100644 --- a/Examples/examples_matrix/no_test_matrix_layout_ex1.php +++ b/Examples/examples_matrix/no_test_matrix_layout_ex1.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $mp = []; -$n = 5; +$n = 5; + for ($i = 0; $i < $n; ++$i) { $mp[$i] = new MatrixPlot($data); $mp[$i]->colormap->SetMap($i); - if ($i < 2) { + + if (2 > $i) { $mp[$i]->SetSize(0.35); } else { $mp[$i]->SetSize(0.21); diff --git a/Examples/examples_matrix/no_test_matrixex00.php b/Examples/examples_matrix/no_test_matrixex00.php index 571587d7..7f64306d 100644 --- a/Examples/examples_matrix/no_test_matrixex00.php +++ b/Examples/examples_matrix/no_test_matrixex00.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); //$graph->SetColor('darkgreen@0.8'); $mp = []; -$n = 5; +$n = 5; + for ($i = 0; $i < $n; ++$i) { $mp[$i] = new MatrixPlot($data); $mp[$i]->colormap->SetMap($i); - if ($i < 2) { + + if (2 > $i) { $mp[$i]->SetSize(0.35); } else { $mp[$i]->SetSize(0.21); diff --git a/Examples/examples_multigraph/example_four_piecharts.php b/Examples/examples_multigraph/example_four_piecharts.php index 9a27933c..48ec5522 100644 --- a/Examples/examples_multigraph/example_four_piecharts.php +++ b/Examples/examples_multigraph/example_four_piecharts.php @@ -1,7 +1,7 @@ SetShadow(); $example_title = ' Using Arial'; $graph->title->set($example_title); diff --git a/Examples/examples_multigraph/example_two_graphs_chinese.php b/Examples/examples_multigraph/example_two_graphs_chinese.php index 12523112..4197af4f 100644 --- a/Examples/examples_multigraph/example_two_graphs_chinese.php +++ b/Examples/examples_multigraph/example_two_graphs_chinese.php @@ -1,17 +1,18 @@ mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $sp1->SetImpuls(); $graph3->Add($sp1); diff --git a/Examples/examples_multigraph/no_test_comb90dategraphex01.php b/Examples/examples_multigraph/no_test_comb90dategraphex01.php index b1ddba1c..cdc34ca8 100644 --- a/Examples/examples_multigraph/no_test_comb90dategraphex01.php +++ b/Examples/examples_multigraph/no_test_comb90dategraphex01.php @@ -1,7 +1,7 @@ $i; ++$i) { + $data_winddirection[$i + 1] = $data_winddirection[$i] + \mt_rand(-4, 4); + if ($data_winddirection[$i + 1] < 0 || $data_winddirection[$i + 1] > 359) { $data_winddirection[$i + 1] = 0; } - $data_windspeed[$i + 1] = $data_windspeed[$i] + rand(-2, 2); + $data_windspeed[$i + 1] = $data_windspeed[$i] + \mt_rand(-2, 2); + if ($data_windspeed[$i + 1] < 0) { $data_windspeed[$i + 1] = 0; } @@ -37,9 +41,9 @@ $xdata[$i] = $start + $i * SAMPLERATE; // Setup the Wind direction graph -$__width = 300; +$__width = 300; $__height = 800; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetMarginColor('lightgray:1.7'); $graph->SetScale('datlin', 0, 360); $graph->Set90AndMargin(50, 30, 60, 30); @@ -66,9 +70,9 @@ $graph->Add($line); // Setup the wind speed graph -$__width = 300; +$__width = 300; $__height = 800; -$graph2 = new Graph\Graph($__width, $__height); +$graph2 = new Graph\Graph($__width, $__height); $graph2->SetScale('datlin'); $graph2->Set90AndMargin(50, 30, 60, 30); $graph2->SetMarginColor('lightgray:1.7'); diff --git a/Examples/examples_multigraph/no_test_comb90dategraphex02.php b/Examples/examples_multigraph/no_test_comb90dategraphex02.php index 5110341b..361e1ed1 100644 --- a/Examples/examples_multigraph/no_test_comb90dategraphex02.php +++ b/Examples/examples_multigraph/no_test_comb90dategraphex02.php @@ -1,7 +1,7 @@ $i; ++$i) { + $data_winddirection[$i + 1] = $data_winddirection[$i] + \mt_rand(-4, 4); + if ($data_winddirection[$i + 1] < 0 || $data_winddirection[$i + 1] > 359) { $data_winddirection[$i + 1] = 0; } - $data_windspeed[$i + 1] = $data_windspeed[$i] + rand(-2, 2); + $data_windspeed[$i + 1] = $data_windspeed[$i] + \mt_rand(-2, 2); + if ($data_windspeed[$i + 1] < 0) { $data_windspeed[$i + 1] = 0; } @@ -36,9 +40,9 @@ } $xdata[$i] = $start + $i * SAMPLERATE; -define('BKG_COLOR', 'lightgray:1.7'); -define('WIND_HEIGHT', 800); -define('WIND_WIDTH', 280); +\define('BKG_COLOR', 'lightgray:1.7'); +\define('WIND_HEIGHT', 800); +\define('WIND_WIDTH', 280); // Setup the Wind direction graph $graph = new Graph\Graph(WIND_WIDTH, WIND_HEIGHT); diff --git a/Examples/examples_multigraph/no_test_comb90dategraphex03.php b/Examples/examples_multigraph/no_test_comb90dategraphex03.php index 6333427d..5550c98d 100644 --- a/Examples/examples_multigraph/no_test_comb90dategraphex03.php +++ b/Examples/examples_multigraph/no_test_comb90dategraphex03.php @@ -1,7 +1,7 @@ $i; ++$i) { + $data_winddirection[$i + 1] = $data_winddirection[$i] + \mt_rand(-4, 4); -for ($i = 0; $i < NDATAPOINTS - 1; ++$i) { - $data_winddirection[$i + 1] = $data_winddirection[$i] + rand(-4, 4); if ($data_winddirection[$i + 1] < 0 || $data_winddirection[$i + 1] > 359) { $data_winddirection[$i + 1] = 0; } - $data_windspeed[$i + 1] = $data_windspeed[$i] + rand(-2, 2); + $data_windspeed[$i + 1] = $data_windspeed[$i] + \mt_rand(-2, 2); + if ($data_windspeed[$i + 1] < 0) { $data_windspeed[$i + 1] = 0; } - $data_windtemp[$i + 1] = $data_windtemp[$i] + rand(-1.5, 1.5); + $data_windtemp[$i + 1] = $data_windtemp[$i] + \mt_rand(-1.5, 1.5); $xdata[$i] = $start + $i * SAMPLERATE; } $xdata[$i] = $start + $i * SAMPLERATE; //DEFINE('BKG_COLOR','lightgray:1.7'); -define('BKG_COLOR', 'green:1.98'); -define('WIND_HEIGHT', 800); -define('WIND_WIDTH', 250); +\define('BKG_COLOR', 'green:1.98'); +\define('WIND_HEIGHT', 800); +\define('WIND_WIDTH', 250); //------------------------------------------------------------------ // Setup the Wind direction graph diff --git a/Examples/examples_multigraph/no_test_combgraphex1.php b/Examples/examples_multigraph/no_test_combgraphex1.php index fb398c7c..b0aafd67 100644 --- a/Examples/examples_multigraph/no_test_combgraphex1.php +++ b/Examples/examples_multigraph/no_test_combgraphex1.php @@ -1,7 +1,7 @@ getTicks($datax, DSUTILS_MONTH1); +$dateUtils = new DateScaleUtils(); +[$tickPositions, $minTickPositions] = $dateUtils->getTicks($datax, DSUTILS_MONTH1); // Now create the real graph // Combine a line and a bar graph @@ -36,8 +37,8 @@ // We add some grace to the end of the X-axis scale so that the first and last // data point isn't exactly at the very end or beginning of the scale $grace = 400000; -$xmin = $datax[0] - $grace; -$xmax = $datax[$n - 1] + $grace; +$xmin = $datax[0] - $grace; +$xmax = $datax[$n - 1] + $grace; // Overall width of graphs $w = 450; diff --git a/Examples/examples_multigraph/no_test_combgraphex2.php b/Examples/examples_multigraph/no_test_combgraphex2.php index 57f5b914..840eac88 100644 --- a/Examples/examples_multigraph/no_test_combgraphex2.php +++ b/Examples/examples_multigraph/no_test_combgraphex2.php @@ -1,13 +1,17 @@ SetColor('white'); $graph->SetMarginColor('white'); $graph->SetFrame(false); diff --git a/Examples/examples_odometer/no_test_odoex01.php b/Examples/examples_odometer/no_test_odoex01.php index 6320132e..82ade178 100644 --- a/Examples/examples_odometer/no_test_odoex01.php +++ b/Examples/examples_odometer/no_test_odoex01.php @@ -1,7 +1,7 @@ SetShadow(); //--------------------------------------------------------------------- diff --git a/Examples/examples_odometer/no_test_odoex012.php b/Examples/examples_odometer/no_test_odoex012.php index 06de21b1..a7effbc0 100644 --- a/Examples/examples_odometer/no_test_odoex012.php +++ b/Examples/examples_odometer/no_test_odoex012.php @@ -1,7 +1,7 @@ SetShadow(); //--------------------------------------------------------------------- diff --git a/Examples/examples_odometer/no_test_odoex02.php b/Examples/examples_odometer/no_test_odoex02.php index bf76fe71..1f4c88f4 100644 --- a/Examples/examples_odometer/no_test_odoex02.php +++ b/Examples/examples_odometer/no_test_odoex02.php @@ -1,7 +1,7 @@ SetShadow(); //--------------------------------------------------------------------- diff --git a/Examples/examples_odometer/no_test_odoex04.php b/Examples/examples_odometer/no_test_odoex04.php index 5da41bb9..a33aeea7 100644 --- a/Examples/examples_odometer/no_test_odoex04.php +++ b/Examples/examples_odometer/no_test_odoex04.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex03.php b/Examples/examples_odometer/no_test_odotutex03.php index 5856184f..12b1987f 100644 --- a/Examples/examples_odometer/no_test_odotutex03.php +++ b/Examples/examples_odometer/no_test_odotutex03.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex04.php b/Examples/examples_odometer/no_test_odotutex04.php index bf7ea762..e27aa3cb 100644 --- a/Examples/examples_odometer/no_test_odotutex04.php +++ b/Examples/examples_odometer/no_test_odotutex04.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex06.php b/Examples/examples_odometer/no_test_odotutex06.php index 7af17ea9..2ccc280f 100644 --- a/Examples/examples_odometer/no_test_odotutex06.php +++ b/Examples/examples_odometer/no_test_odotutex06.php @@ -1,7 +1,7 @@ $i; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightyellow'); $odo[$i]->needle->Set(80); diff --git a/Examples/examples_odometer/no_test_odotutex07.php b/Examples/examples_odometer/no_test_odotutex07.php index f268c4a7..2caee147 100644 --- a/Examples/examples_odometer/no_test_odotutex07.php +++ b/Examples/examples_odometer/no_test_odotutex07.php @@ -1,7 +1,7 @@ $i; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightyellow'); $odo[$i]->needle->Set(75); diff --git a/Examples/examples_odometer/no_test_odotutex08.1.php b/Examples/examples_odometer/no_test_odotutex08.1.php index 18d2de34..592fcc37 100644 --- a/Examples/examples_odometer/no_test_odotutex08.1.php +++ b/Examples/examples_odometer/no_test_odotutex08.1.php @@ -1,7 +1,7 @@ $i; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightyellow'); $odo[$i]->needle->Set(75); diff --git a/Examples/examples_odometer/no_test_odotutex10.php b/Examples/examples_odometer/no_test_odotutex10.php index 8567eff2..998b4ad0 100644 --- a/Examples/examples_odometer/no_test_odotutex10.php +++ b/Examples/examples_odometer/no_test_odotutex10.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_odometer/no_test_odotutex11.php b/Examples/examples_odometer/no_test_odotutex11.php index 9f73457f..01dc0fce 100644 --- a/Examples/examples_odometer/no_test_odotutex11.php +++ b/Examples/examples_odometer/no_test_odotutex11.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_odometer/no_test_odotutex12.php b/Examples/examples_odometer/no_test_odotutex12.php index 61bf54fd..12a408ee 100644 --- a/Examples/examples_odometer/no_test_odotutex12.php +++ b/Examples/examples_odometer/no_test_odotutex12.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_odometer/no_test_odotutex13.php b/Examples/examples_odometer/no_test_odotutex13.php index 81eb2650..d424a34d 100644 --- a/Examples/examples_odometer/no_test_odotutex13.php +++ b/Examples/examples_odometer/no_test_odotutex13.php @@ -1,7 +1,7 @@ title->set($example_title); diff --git a/Examples/examples_odometer/no_test_odotutex14.php b/Examples/examples_odometer/no_test_odotutex14.php index 6a4041a4..a904d618 100644 --- a/Examples/examples_odometer/no_test_odotutex14.php +++ b/Examples/examples_odometer/no_test_odotutex14.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex15.php b/Examples/examples_odometer/no_test_odotutex15.php index a383df95..91bcd86f 100644 --- a/Examples/examples_odometer/no_test_odotutex15.php +++ b/Examples/examples_odometer/no_test_odotutex15.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex16.1.php b/Examples/examples_odometer/no_test_odotutex16.1.php index 31d6f8f4..82729ed9 100644 --- a/Examples/examples_odometer/no_test_odotutex16.1.php +++ b/Examples/examples_odometer/no_test_odotutex16.1.php @@ -1,7 +1,7 @@ SetShadow(); diff --git a/Examples/examples_odometer/no_test_odotutex16.php b/Examples/examples_odometer/no_test_odotutex16.php index 11b04f61..18355a23 100644 --- a/Examples/examples_odometer/no_test_odotutex16.php +++ b/Examples/examples_odometer/no_test_odotutex16.php @@ -1,7 +1,7 @@ SetShadow(); diff --git a/Examples/examples_odometer/no_test_odotutex17.php b/Examples/examples_odometer/no_test_odotutex17.php index 891d9d61..af99c4df 100644 --- a/Examples/examples_odometer/no_test_odotutex17.php +++ b/Examples/examples_odometer/no_test_odotutex17.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetColor('white'); diff --git a/Examples/examples_odometer/no_test_odotutex18.php b/Examples/examples_odometer/no_test_odotutex18.php index a3f31ed2..9eac46e4 100644 --- a/Examples/examples_odometer/no_test_odotutex18.php +++ b/Examples/examples_odometer/no_test_odotutex18.php @@ -1,7 +1,7 @@ $i; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightgray:1.9'); $odo[$i]->needle->Set(10 + $i * 17); $odo[$i]->needle->SetShadow(); - if ($i < 2) { + + if (2 > $i) { $fsize = 10; } else { $fsize = 8; diff --git a/Examples/examples_odometer/no_test_odotutex19.php b/Examples/examples_odometer/no_test_odotutex19.php index 62a13ff4..6f7e97c5 100644 --- a/Examples/examples_odometer/no_test_odotutex19.php +++ b/Examples/examples_odometer/no_test_odotutex19.php @@ -1,29 +1,31 @@ $i; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightgray:1.9'); $odo[$i]->needle->Set(10 + $i * 17); $odo[$i]->needle->SetShadow(); - if ($i < 2) { + + if (2 > $i) { $fsize = 10; } else { $fsize = 8; @@ -49,7 +51,7 @@ $t = new Text('JpGraph', 250, 70); $t->SetAlign('center', 'top'); -#$t->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_BOLD,11); +//$t->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_BOLD,11); $t->SetColor('darkgray'); $graph->Add($t); diff --git a/Examples/examples_pdf/no_test_pdf417_ex0.php b/Examples/examples_pdf/no_test_pdf417_ex0.php index a178b8d0..00c33132 100755 --- a/Examples/examples_pdf/no_test_pdf417_ex0.php +++ b/Examples/examples_pdf/no_test_pdf417_ex0.php @@ -1,7 +1,7 @@ NoText(!$showtext); $backend->SetColor('black', 'yellow'); $output = $backend->Stroke($data); - echo nl2br(htmlspecialchars($output)); + echo \nl2br(\htmlspecialchars($output)); } catch (JpGraphException $e) { echo 'PDF417 Error: ' . $e->GetMessage(); } diff --git a/Examples/examples_pdf/no_test_pdf417_ex6.php b/Examples/examples_pdf/no_test_pdf417_ex6.php index 10e8447f..1d257f1e 100755 --- a/Examples/examples_pdf/no_test_pdf417_ex6.php +++ b/Examples/examples_pdf/no_test_pdf417_ex6.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->SetBox(true); $data = [40, 21, 17, 14, 23]; -$p1 = new Plot\PiePlot($data); +$p1 = new Plot\PiePlot($data); $p1->ShowBorder(); $p1->SetColor('black'); $p1->SetSliceColors(['#1E90FF', '#2E8B57', '#ADFF2F', '#DC143C', '#BA55D3']); diff --git a/Examples/examples_pie/new_pie4.php b/Examples/examples_pie/new_pie4.php index 36da5be8..8990e20d 100644 --- a/Examples/examples_pie/new_pie4.php +++ b/Examples/examples_pie/new_pie4.php @@ -1,10 +1,11 @@ SetTheme(new $theme_class()); @@ -39,6 +40,7 @@ for ($i = 0; $i < $n; ++$i) { $p[] = new Plot\PiePlot3D($data); } + for ($i = 0; $i < $n; ++$i) { $graph->Add($p[$i]); } @@ -52,7 +54,11 @@ // Set the titles for ($i = 0; $i < $n; ++$i) { $p[$i]->title->Set($titles[$i]); - $p[$i]->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); + $p[$i]->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 + ); } for ($i = 0; $i < $n; ++$i) { diff --git a/Examples/examples_pie/no_dim_piebkgex1.php b/Examples/examples_pie/no_dim_piebkgex1.php index 6fad20fe..f33bd3a4 100644 --- a/Examples/examples_pie/no_dim_piebkgex1.php +++ b/Examples/examples_pie/no_dim_piebkgex1.php @@ -1,10 +1,11 @@ SetMargin(1, 1, 40, 1); @@ -37,13 +39,17 @@ // Setup title $example_title = 'Pie plots with background image'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 20); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 20 +); $graph->title->SetColor('white'); $p = []; // Create the plots for ($i = 0; $i < $n; ++$i) { - $d = "data${i}"; + $d = "data{$i}"; $p[] = new Plot\PiePlot3D($data[$i]); } @@ -56,12 +62,19 @@ for ($i = 0; $i < $n; ++$i) { $p[$i]->title->Set($titles[$i]); $p[$i]->title->SetColor('white'); - $p[$i]->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); + $p[$i]->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 + ); } // Label font and color setup for ($i = 0; $i < $n; ++$i) { - $p[$i]->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD')); + $p[$i]->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD') + ); $p[$i]->value->SetColor('white'); } diff --git a/Examples/examples_pie/no_dim_piecex1.php b/Examples/examples_pie/no_dim_piecex1.php index 41437222..d2d7fc74 100644 --- a/Examples/examples_pie/no_dim_piecex1.php +++ b/Examples/examples_pie/no_dim_piecex1.php @@ -1,12 +1,13 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->title->SetMargin(8); // Add a little bit more margin from the top // Create the pie plot @@ -31,18 +36,28 @@ $p1->SetSize(0.32); // Label font and color setup -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $p1->value->SetColor('black'); // Setup the title on the center circle $p1->midtitle->Set("Test mid\nRow 1\nRow 2"); -$p1->midtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$p1->midtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Set color for mid circle $p1->SetMidColor('yellow'); // Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); // Add plot to pie graph $graph->Add($p1); diff --git a/Examples/examples_pie/no_dim_piecex2.php b/Examples/examples_pie/no_dim_piecex2.php index 99eb367d..5fb7f44c 100644 --- a/Examples/examples_pie/no_dim_piecex2.php +++ b/Examples/examples_pie/no_dim_piecex2.php @@ -1,12 +1,13 @@ SetFrame(false); @@ -27,7 +28,11 @@ // Setup title $example_title = 'Plot\\PiePlotC'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetMargin(8); // Add a little bit more margin from the top // Create the pie plot @@ -37,26 +42,38 @@ $p1->SetSize(0.35); // Label font and color setup -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $p1->value->SetColor('white'); $p1->value->Show(); // Setup the title on the center circle $p1->midtitle->Set("Test mid\nRow 1\nRow 2"); -$p1->midtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$p1->midtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 14 +); // Set color for mid circle $p1->SetMidColor('yellow'); // Use percentage values in the legends values (This is also the default) -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); // The label array values may have printf() formatting in them. The argument to the // form,at string will be the value of the slice (either the percetage or absolute // depending on what was specified in the SetLabelType() above. -$lbl = ["adam\n%.1f%%", "bertil\n%.1f%%", "johan\n%.1f%%", - "peter\n%.1f%%", "daniel\n%.1f%%", "erik\n%.1f%%", ]; +$lbl = [ + "adam\n%.1f%%", "bertil\n%.1f%%", "johan\n%.1f%%", + "peter\n%.1f%%", "daniel\n%.1f%%", "erik\n%.1f%%", +]; $p1->SetLabels($lbl); // Uncomment this line to remove the borders around the slices diff --git a/Examples/examples_pie/no_test_new_pie2.php b/Examples/examples_pie/no_test_new_pie2.php index 9f5e54b5..799137ab 100644 --- a/Examples/examples_pie/no_test_new_pie2.php +++ b/Examples/examples_pie/no_test_new_pie2.php @@ -1,7 +1,7 @@ SetShadow(); $theme_class = new UniversalTheme(); @@ -26,7 +26,7 @@ // Create plots $size = 0.13; -$p1 = new Plot\PiePlot($data); +$p1 = new Plot\PiePlot($data); $graph->Add($p1); $p1->SetSize($size); diff --git a/Examples/examples_pie/no_test_new_pie3.php b/Examples/examples_pie/no_test_new_pie3.php index ce85e537..832aa1f1 100644 --- a/Examples/examples_pie/no_test_new_pie3.php +++ b/Examples/examples_pie/no_test_new_pie3.php @@ -1,7 +1,7 @@ SetTheme($theme_class); diff --git a/Examples/examples_pie/pie3dex1.php b/Examples/examples_pie/pie3dex1.php index 62e4e7e2..752341b3 100644 --- a/Examples/examples_pie/pie3dex1.php +++ b/Examples/examples_pie/pie3dex1.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = '3D Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -29,7 +34,11 @@ $p1->SetTheme('sand'); $p1->SetCenter(0.4); $p1->SetAngle(30); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $p1->SetLegends(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']); $graph->Add($p1); diff --git a/Examples/examples_pie/pie3dex2.php b/Examples/examples_pie/pie3dex2.php index 1f2d4db2..aa5da567 100644 --- a/Examples/examples_pie/pie3dex2.php +++ b/Examples/examples_pie/pie3dex2.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = '3D Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -41,7 +46,11 @@ // As a shortcut you can easily explode one numbered slice with // $p1->ExplodeSlice(3); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); $p1->SetLegends(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']); $graph->Add($p1); diff --git a/Examples/examples_pie/pie3dex3.php b/Examples/examples_pie/pie3dex3.php index 2388e1b2..0510018b 100644 --- a/Examples/examples_pie/pie3dex3.php +++ b/Examples/examples_pie/pie3dex3.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = '3D Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -37,7 +42,11 @@ $p1->ExplodeSlice(3); // Setup the slice values -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $p1->value->SetColor('navy'); $p1->SetLegends(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']); diff --git a/Examples/examples_pie/pie3dex4.php b/Examples/examples_pie/pie3dex4.php index 274b738d..b897b4ef 100644 --- a/Examples/examples_pie/pie3dex4.php +++ b/Examples/examples_pie/pie3dex4.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = '3D Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -40,7 +45,11 @@ $p1->ExplodeSlice(3); // Setup slice values -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $p1->value->SetColor('navy'); $p1->SetLegends(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']); diff --git a/Examples/examples_pie/pie3dex5.php b/Examples/examples_pie/pie3dex5.php index 32a5df39..3cd01752 100644 --- a/Examples/examples_pie/pie3dex5.php +++ b/Examples/examples_pie/pie3dex5.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = '3D Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 18); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 18 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -37,7 +42,11 @@ $p1->SetStartAngle(45); // Display the slice values -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $p1->value->SetColor('navy'); // Add colored edges to the 3D pie diff --git a/Examples/examples_pie/pieex1.php b/Examples/examples_pie/pieex1.php index 69f1c9b8..ef28796a 100644 --- a/Examples/examples_pie/pieex1.php +++ b/Examples/examples_pie/pieex1.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = 'Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->title->SetColor('brown'); // Create pie plot @@ -28,7 +33,11 @@ //$p1->SetSliceColors(array("red","blue","yellow","green")); $p1->SetTheme('earth'); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Set how many pixels each slice should explode $p1->Explode([0, 15, 15, 25, 15]); diff --git a/Examples/examples_pie/pieex2.php b/Examples/examples_pie/pieex2.php index c7642376..38c0c6f7 100644 --- a/Examples/examples_pie/pieex2.php +++ b/Examples/examples_pie/pieex2.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = 'Pie plot Example '; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create $p1 = new Plot\PiePlot($data); diff --git a/Examples/examples_pie/pieex3.php b/Examples/examples_pie/pieex3.php index 70903a87..06621ec4 100644 --- a/Examples/examples_pie/pieex3.php +++ b/Examples/examples_pie/pieex3.php @@ -1,10 +1,11 @@ SetShadow(); // Set A title for the plot $example_title = 'Multiple - Pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create plots $size = 0.13; -$p1 = new Plot\PiePlot($data); +$p1 = new Plot\PiePlot($data); $p1->SetLegends(['Jan', 'Feb', 'Mar', 'Apr', 'May']); $p1->SetSize($size); $p1->SetCenter(0.25, 0.32); -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT0')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT0') +); $example_title = '2001'; $p1->title->set($example_title); $p2 = new Plot\PiePlot($data); $p2->SetSize($size); $p2->SetCenter(0.65, 0.32); -$p2->value->SetFont(Graph\Configs::getConfig('FF_FONT0')); +$p2->value->SetFont( + Graph\Configs::getConfig('FF_FONT0') +); $example_title = '2002'; $p2->title->set($example_title); $p3 = new Plot\PiePlot($data); $p3->SetSize($size); $p3->SetCenter(0.25, 0.75); -$p3->value->SetFont(Graph\Configs::getConfig('FF_FONT0')); +$p3->value->SetFont( + Graph\Configs::getConfig('FF_FONT0') +); $example_title = '2003'; $p3->title->set($example_title); $p4 = new Plot\PiePlot($data); $p4->SetSize($size); $p4->SetCenter(0.65, 0.75); -$p4->value->SetFont(Graph\Configs::getConfig('FF_FONT0')); +$p4->value->SetFont( + Graph\Configs::getConfig('FF_FONT0') +); $example_title = '2004'; $p4->title->set($example_title); diff --git a/Examples/examples_pie/pieex4.php b/Examples/examples_pie/pieex4.php index b601f8fa..49c5cd52 100644 --- a/Examples/examples_pie/pieex4.php +++ b/Examples/examples_pie/pieex4.php @@ -1,25 +1,32 @@ SetShadow(); $example_title = 'Example 4 of pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1 = new Plot\PiePlot($data); -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); $p1->SetSize(0.3); $p1->SetCenter(0.4); diff --git a/Examples/examples_pie/pieex5.php b/Examples/examples_pie/pieex5.php index 8bf73f0b..cf4ca55a 100644 --- a/Examples/examples_pie/pieex5.php +++ b/Examples/examples_pie/pieex5.php @@ -1,29 +1,36 @@ SetShadow(); // Setup graph title $example_title = 'Example 5 of pie plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Create pie plot $p1 = new Plot\PiePlot($data); -$p1->value->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); $p1->SetSize(0.3); $p1->SetCenter(0.4); diff --git a/Examples/examples_pie/pieex6.php b/Examples/examples_pie/pieex6.php index 26864976..ad79ac7c 100644 --- a/Examples/examples_pie/pieex6.php +++ b/Examples/examples_pie/pieex6.php @@ -1,10 +1,11 @@ SetShadow(); // Setup title $example_title = 'Example of pie plot with absolute labels'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // The pie plot $p1 = new Plot\PiePlot($data); @@ -33,11 +37,16 @@ $p1->ShowBorder(false); // Label font and color setup -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); // Use absolute values (type==1) -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_ABS')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_ABS') +); // Label format $p1->value->SetFormat('$%d'); diff --git a/Examples/examples_pie/pieex7.php b/Examples/examples_pie/pieex7.php index f3efd241..44ef6a30 100644 --- a/Examples/examples_pie/pieex7.php +++ b/Examples/examples_pie/pieex7.php @@ -1,11 +1,12 @@ SetShadow(); // Setup title @@ -23,7 +24,10 @@ $graph->title->set($example_title); $subtitle_text = '(With hidden 0 labels)'; $graph->subtitle->Set($subtitle_text); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // The pie plot $p1 = new Plot\PiePlot($data); @@ -36,11 +40,16 @@ $p1->ShowBorder(false); // Label font and color setup -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); // Use absolute values (type==1) -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_ABS')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_ABS') +); // Label format $p1->value->SetFormat('$%d'); diff --git a/Examples/examples_pie/pieex8.php b/Examples/examples_pie/pieex8.php index 1f8cb4ea..20080593 100644 --- a/Examples/examples_pie/pieex8.php +++ b/Examples/examples_pie/pieex8.php @@ -1,23 +1,27 @@ SetShadow(); // Title setup$example_title='Adjusting the label pos'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup the pie plot $p1 = new Plot\PiePlot($data); @@ -27,7 +31,10 @@ $p1->SetCenter(0.5, 0.52); // Setup slice labels and move them into the plot -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); $p1->SetLabelPos(0.6); diff --git a/Examples/examples_pie/pieex9.php b/Examples/examples_pie/pieex9.php index eda170a5..d7e36641 100644 --- a/Examples/examples_pie/pieex9.php +++ b/Examples/examples_pie/pieex9.php @@ -1,23 +1,27 @@ SetShadow(); // Title setup$example_title='Exploding all slices'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup the pie plot $p1 = new Plot\PiePlot($data); @@ -27,7 +31,10 @@ $p1->SetCenter(0.5, 0.52); // Setup slice labels and move them into the plot -$p1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $p1->value->SetColor('darkred'); $p1->SetLabelPos(0.65); diff --git a/Examples/examples_pie/pielabelsex1.php b/Examples/examples_pie/pielabelsex1.php index f5eaaa99..9e4be808 100644 --- a/Examples/examples_pie/pielabelsex1.php +++ b/Examples/examples_pie/pielabelsex1.php @@ -1,24 +1,29 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -32,9 +37,15 @@ $p1->SetGuideLinesAdjust(1.4); // Setup the labels -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); $p1->value->Show(); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $p1->value->SetFormat('%2.1f%%'); // Add and stroke diff --git a/Examples/examples_pie/pielabelsex2.php b/Examples/examples_pie/pielabelsex2.php index 275187ce..3062d06d 100644 --- a/Examples/examples_pie/pielabelsex2.php +++ b/Examples/examples_pie/pielabelsex2.php @@ -1,24 +1,29 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -32,9 +37,15 @@ $p1->SetGuideLinesAdjust(1.5); // Setup the labels -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); $p1->value->Show(); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $p1->value->SetFormat('%2.1f%%'); // Add and stroke diff --git a/Examples/examples_pie/pielabelsex3.php b/Examples/examples_pie/pielabelsex3.php index b5c650b2..5400a6b5 100644 --- a/Examples/examples_pie/pielabelsex3.php +++ b/Examples/examples_pie/pielabelsex3.php @@ -1,24 +1,29 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -33,9 +38,15 @@ $p1->SetGuideLinesAdjust(1.5); // Setup the labels -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); $p1->value->Show(); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $p1->value->SetFormat('%2.1f%%'); // Add and stroke diff --git a/Examples/examples_pie/pielabelsex4.php b/Examples/examples_pie/pielabelsex4.php index 6233e97f..2a15e4ad 100644 --- a/Examples/examples_pie/pielabelsex4.php +++ b/Examples/examples_pie/pielabelsex4.php @@ -1,24 +1,29 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('darkblue'); $graph->legend->Pos(0.1, 0.2); @@ -32,9 +37,15 @@ $p1->SetGuideLinesAdjust(1.1); // Setup the labels -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); $p1->value->Show(); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $p1->value->SetFormat('%2.1f%%'); // Add and stroke diff --git a/Examples/examples_pie/pielabelsex5.php b/Examples/examples_pie/pielabelsex5.php index 142b025e..eb18f162 100644 --- a/Examples/examples_pie/pielabelsex5.php +++ b/Examples/examples_pie/pielabelsex5.php @@ -1,30 +1,37 @@ SetShadow(); // Set A title for the plot $example_title = 'String labels with values'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('black'); // Create pie plot @@ -43,9 +50,15 @@ // Setup the label formats and what value we want to be shown (The absolute) // or the percentage. -$p1->SetLabelType(Graph\Configs::getConfig('PIE_VALUE_PER')); +$p1->SetLabelType( + Graph\Configs::getConfig('PIE_VALUE_PER') +); $p1->value->Show(); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); $p1->value->SetColor('darkgray'); // Add and stroke diff --git a/Examples/examples_polar/polarclockex1.php b/Examples/examples_polar/polarclockex1.php index 349d5a36..d44beb85 100755 --- a/Examples/examples_polar/polarclockex1.php +++ b/Examples/examples_polar/polarclockex1.php @@ -1,7 +1,7 @@ SetScale('lin', 150); $graph->SetMarginColor('#FFE6C0'); -$graph->SetType(Graph\Configs::getConfig('POLAR_360')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_360') +); $graph->SetMargin(40, 40, 50, 40); $graph->SetClockwise(true); @@ -39,14 +42,26 @@ $graph->axis->ShowGrid(true, false, true); $graph->axis->SetGridColor('gray', 'gray', 'gray'); -$graph->axis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->axis->SetTitle('X-Axis', 'center'); $graph->axis->SetColor('black', 'black', 'darkred'); -$graph->axis->SetAngleFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetAngleFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $example_title = 'Clockwise polar plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_COMIC'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_COMIC'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->title->SetColor('navy'); $p = new Plot\PolarPlot($data); diff --git a/Examples/examples_polar/polarclockex2.php b/Examples/examples_polar/polarclockex2.php index d44fb9ad..90829e46 100755 --- a/Examples/examples_polar/polarclockex2.php +++ b/Examples/examples_polar/polarclockex2.php @@ -1,7 +1,7 @@ SetScale('lin', 150); $graph->SetMarginColor('#FFE6C0'); -$graph->SetType(Graph\Configs::getConfig('POLAR_360')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_360') +); $graph->SetClockwise(true); $graph->Set90AndMargin(40, 40, 50, 40); @@ -37,14 +40,26 @@ $graph->axis->ShowGrid(true, false, true); $graph->axis->SetGridColor('gray', 'gray', 'gray'); -$graph->axis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->axis->SetTitle('X-Axis', 'center'); $graph->axis->SetColor('black', 'black', 'darkred'); -$graph->axis->SetAngleFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetAngleFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); $graph->title->Set('Clockwise polar plot (rotated)'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_COMIC'), Graph\Configs::getConfig('FS_NORMAL'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_COMIC'), + Graph\Configs::getConfig('FS_NORMAL'), + 16 +); $graph->title->SetColor('navy'); $p = new Plot\PolarPlot($data); diff --git a/Examples/examples_polar/polarex0-180.php b/Examples/examples_polar/polarex0-180.php index 7ca9b303..65c11260 100755 --- a/Examples/examples_polar/polarex0-180.php +++ b/Examples/examples_polar/polarex0-180.php @@ -1,28 +1,33 @@ SetScale('lin'); $graph->SetMargin(35, 35, 25, 25); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); $p = new Plot\PolarPlot($data); $p->SetFillColor('lightblue@0.5'); diff --git a/Examples/examples_polar/polarex0.php b/Examples/examples_polar/polarex0.php index c4afe6be..de6a31f8 100755 --- a/Examples/examples_polar/polarex0.php +++ b/Examples/examples_polar/polarex0.php @@ -1,7 +1,7 @@ SetScale('lin'); $graph->SetMargin(35, 35, 25, 25); diff --git a/Examples/examples_polar/polarex1.php b/Examples/examples_polar/polarex1.php index 161228fe..0ba77944 100755 --- a/Examples/examples_polar/polarex1.php +++ b/Examples/examples_polar/polarex1.php @@ -1,27 +1,32 @@ SetScale('lin'); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); //$graph->SetAngle(90); //$graph->SetMargin(30-150,30-150,30+150,30+150); $graph->Set90AndMargin(40, 40, 40, 40); diff --git a/Examples/examples_polar/polarex10.php b/Examples/examples_polar/polarex10.php index baa5dc2f..1c9d1590 100755 --- a/Examples/examples_polar/polarex10.php +++ b/Examples/examples_polar/polarex10.php @@ -1,33 +1,38 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_360')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_360') +); // Hide frame around graph (by setting width=0) $graph->SetFrame(true, 'white', 1); @@ -42,20 +47,34 @@ $graph->axis->SetColor('black', 'navy', 'darkred'); // Draw the ticks on the bottom side of the radius axis -$graph->axis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->axis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); // Increase the margin for the labels since we changed the // side of the ticks. $graph->axis->SetLabelMargin(6); // Change fonts -$graph->axis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); -$graph->axis->SetAngleFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); +$graph->axis->SetAngleFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); // Setup graph title $example_title = 'Polar plot #10'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Setup tab title @@ -64,7 +83,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $graph->Add($p); diff --git a/Examples/examples_polar/polarex2.php b/Examples/examples_polar/polarex2.php index 87d5dd6c..80c75812 100755 --- a/Examples/examples_polar/polarex2.php +++ b/Examples/examples_polar/polarex2.php @@ -1,29 +1,35 @@ SetScale('lin'); $example_title = 'Polar plot #2'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); // Hide last labels on the Radius axis diff --git a/Examples/examples_polar/polarex3-lin.php b/Examples/examples_polar/polarex3-lin.php index 5e9f31b3..9091a5c9 100755 --- a/Examples/examples_polar/polarex3-lin.php +++ b/Examples/examples_polar/polarex3-lin.php @@ -1,30 +1,38 @@ SetScale('lin', 200); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); $example_title = 'Polar plot #3'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); $graph->axis->ShowGrid(true, false); diff --git a/Examples/examples_polar/polarex3.php b/Examples/examples_polar/polarex3.php index 6a9b1df1..9aafa641 100755 --- a/Examples/examples_polar/polarex3.php +++ b/Examples/examples_polar/polarex3.php @@ -1,30 +1,38 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); $example_title = 'Polar plot #3'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); $graph->axis->ShowGrid(true, false); diff --git a/Examples/examples_polar/polarex4.php b/Examples/examples_polar/polarex4.php index 75101812..69ae3bbb 100755 --- a/Examples/examples_polar/polarex4.php +++ b/Examples/examples_polar/polarex4.php @@ -1,29 +1,35 @@ SetScale('log'); $example_title = 'Polar plot #4'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); // Hide last labels on the Radius axis diff --git a/Examples/examples_polar/polarex5.php b/Examples/examples_polar/polarex5.php index 6523b2e6..9d2d3fe5 100755 --- a/Examples/examples_polar/polarex5.php +++ b/Examples/examples_polar/polarex5.php @@ -1,32 +1,38 @@ SetScale('log'); // Show both major and minor grid lines $graph->axis->ShowGrid(true, true); $example_title = 'Polar plot #5'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); // Hide last labels on the Radius axis diff --git a/Examples/examples_polar/polarex6.php b/Examples/examples_polar/polarex6.php index 5377aacd..53d51581 100755 --- a/Examples/examples_polar/polarex6.php +++ b/Examples/examples_polar/polarex6.php @@ -1,33 +1,41 @@ SetScale('log'); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); // Show both major and minor grid lines $graph->axis->ShowGrid(true, true); $example_title = 'Polar plot #6'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT2'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT2'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->title->SetColor('navy'); $p = new Plot\PolarPlot($data); diff --git a/Examples/examples_polar/polarex7-1.php b/Examples/examples_polar/polarex7-1.php index dafb183d..ac343345 100755 --- a/Examples/examples_polar/polarex7-1.php +++ b/Examples/examples_polar/polarex7-1.php @@ -1,27 +1,32 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); $graph->SetPlotSize(220, 250); // Hide frame around graph (by setting width=0) @@ -34,10 +39,17 @@ // Setup axis title $graph->axis->SetTitle('Coverage (in meter)', 'middle'); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Polar plot #7'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Adjust legen box position and color @@ -47,7 +59,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $p->SetLegend("Mirophone #1\n(No amps)"); $graph->Add($p); diff --git a/Examples/examples_polar/polarex7-2.php b/Examples/examples_polar/polarex7-2.php index fc02bb9d..97ca685c 100755 --- a/Examples/examples_polar/polarex7-2.php +++ b/Examples/examples_polar/polarex7-2.php @@ -1,33 +1,39 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_360')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_360') +); $graph->SetPlotSize(220, 300); // Hide frame around graph (by setting width=0) @@ -39,7 +45,11 @@ $graph->axis->SetGridColor('gray', 'gray', 'gray'); $example_title = 'Polar plot #7-2'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Adjust legen box position and color @@ -49,7 +59,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('yellow@0.6'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $p->SetLegend("Mirophone #1\n(No amps)"); $graph->Add($p); diff --git a/Examples/examples_polar/polarex7.php b/Examples/examples_polar/polarex7.php index 04936825..5e6cba6b 100755 --- a/Examples/examples_polar/polarex7.php +++ b/Examples/examples_polar/polarex7.php @@ -1,27 +1,32 @@ SetScale('lin', 300); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); $graph->SetPlotSize(220, 250); // Hide frame around graph (by setting width=0) @@ -37,10 +42,17 @@ // Setup axis title $graph->axis->SetTitle('Coverage (in meter)', 'middle'); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Polar plot #7'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Adjust legen box position and color @@ -50,7 +62,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $p->SetLegend("Mirophone #1\n(No amps)"); $graph->Add($p); diff --git a/Examples/examples_polar/polarex8.php b/Examples/examples_polar/polarex8.php index a197ca14..5d83201a 100755 --- a/Examples/examples_polar/polarex8.php +++ b/Examples/examples_polar/polarex8.php @@ -1,27 +1,32 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); //$graph->SetPlotSize(250,250); // Hide frame around graph (by setting width=0) @@ -38,10 +43,17 @@ // Setup axis title $graph->axis->SetTitle('Coverage (in meter)', 'middle'); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $example_title = 'Polar plot #8'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Adjust legen box position and color @@ -51,7 +63,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('white@0.5'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $p->SetLegend("Mirophone #1\n(No amps)"); $graph->Add($p); diff --git a/Examples/examples_polar/polarex9.php b/Examples/examples_polar/polarex9.php index 72964bd2..ecda56f5 100755 --- a/Examples/examples_polar/polarex9.php +++ b/Examples/examples_polar/polarex9.php @@ -1,27 +1,32 @@ SetScale('log', 100); -$graph->SetType(Graph\Configs::getConfig('POLAR_180')); +$graph->SetType( + Graph\Configs::getConfig('POLAR_180') +); // Hide frame around graph (by setting width=0) $graph->SetFrame(true, 'white', 1); @@ -36,24 +41,41 @@ $graph->axis->SetColor('black', 'navy', 'darkred'); // Draw the ticks on the bottom side of the radius axis -$graph->axis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->axis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); // Increase the margin for the labels since we changed the // side of the ticks. $graph->axis->SetLabelMargin(6); // Change fonts -$graph->axis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); -$graph->axis->SetAngleFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 8); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); +$graph->axis->SetAngleFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 8 +); // Setup axis title $graph->axis->SetTitle('Coverage (in meter)', 'middle'); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup graph title $example_title = 'Polar plot #9'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('navy'); // Setup tab title @@ -62,7 +84,9 @@ $p = new Plot\PolarPlot($data); $p->SetFillColor('lightblue@0.5'); -$p->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$p->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $graph->Add($p); diff --git a/Examples/examples_qr/no_test_qr_template.php b/Examples/examples_qr/no_test_qr_template.php index 96ace21a..e4217137 100644 --- a/Examples/examples_qr/no_test_qr_template.php +++ b/Examples/examples_qr/no_test_qr_template.php @@ -1,7 +1,7 @@ SetQuietZone($quiet); -if ($back == Graph\Configs::getConfig('BACKEND_IMAGE')) { +if ( + Graph\Configs::getConfig('BACKEND_IMAGE') === $back +) { $backend->Stroke($data); } else { $str = $backend->Stroke($data); diff --git a/Examples/examples_qr/no_test_qrexample0.php b/Examples/examples_qr/no_test_qrexample0.php index 1b4d2f88..18438e6a 100644 --- a/Examples/examples_qr/no_test_qrexample0.php +++ b/Examples/examples_qr/no_test_qrexample0.php @@ -1,7 +1,7 @@ GetMessage(); echo 'QR Code error: ' . $e->GetMessage() . "\n"; + exit(1); } diff --git a/Examples/examples_qr/no_test_qrexample00.php b/Examples/examples_qr/no_test_qrexample00.php index deb461db..96dd7eba 100644 --- a/Examples/examples_qr/no_test_qrexample00.php +++ b/Examples/examples_qr/no_test_qrexample00.php @@ -1,7 +1,7 @@ Stroke($data); diff --git a/Examples/examples_qr/no_test_qrexample01.php b/Examples/examples_qr/no_test_qrexample01.php index fd487374..ff34ed62 100644 --- a/Examples/examples_qr/no_test_qrexample01.php +++ b/Examples/examples_qr/no_test_qrexample01.php @@ -1,7 +1,7 @@ Stroke($data, $fileName); -list($version, $errorcorrection) = $backend->GetQRInfo(); +[$version, $errorcorrection] = $backend->GetQRInfo(); -echo "QR Barcode, (Version: ${version}-${errorcorrection}), image stored in file ${fileName}"; +echo "QR Barcode, (Version: {$version}-{$errorcorrection}), image stored in file {$fileName}"; diff --git a/Examples/examples_qr/no_test_qrexample04.php b/Examples/examples_qr/no_test_qrexample04.php index 400a4044..d0edc6c5 100644 --- a/Examples/examples_qr/no_test_qrexample04.php +++ b/Examples/examples_qr/no_test_qrexample04.php @@ -1,15 +1,15 @@ SetScale('lin', 0, 50); $graph->yscale->ticks->Set(25, 5); $graph->SetColor('white'); @@ -18,7 +19,10 @@ $graph->SetCenter(0.5, 0.55); -$graph->axis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->axis->SetWeight(2); // Uncomment the following lines to also show grid lines. @@ -29,7 +33,10 @@ $graph->ShowMinorTickMarks(); $example_title = 'Quality result'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->SetTitles(['One', 'Two', 'Three', 'Four', 'Five', 'Sex', 'Seven', 'Eight', 'Nine', 'Ten']); $plot = new Plot\RadarPlot([12, 35, 20, 30, 33, 15, 37]); diff --git a/Examples/examples_radar/radarex1.php b/Examples/examples_radar/radarex1.php index 86af8f25..22c0e4f6 100644 --- a/Examples/examples_radar/radarex1.php +++ b/Examples/examples_radar/radarex1.php @@ -1,7 +1,7 @@ Add($plot); diff --git a/Examples/examples_radar/radarex2.php b/Examples/examples_radar/radarex2.php index 7b84aa3f..e8adeafb 100644 --- a/Examples/examples_radar/radarex2.php +++ b/Examples/examples_radar/radarex2.php @@ -1,7 +1,7 @@ title->set($example_title); $subtitle_text = 'Year 2003'; diff --git a/Examples/examples_radar/radarex3.php b/Examples/examples_radar/radarex3.php index a4751bbe..3e7f7954 100644 --- a/Examples/examples_radar/radarex3.php +++ b/Examples/examples_radar/radarex3.php @@ -1,7 +1,7 @@ gDateLocale->GetShortMonth(); diff --git a/Examples/examples_radar/radarex4.php b/Examples/examples_radar/radarex4.php index 10626086..48970d21 100644 --- a/Examples/examples_radar/radarex4.php +++ b/Examples/examples_radar/radarex4.php @@ -1,7 +1,7 @@ SetShadow(); diff --git a/Examples/examples_radar/radarex5.php b/Examples/examples_radar/radarex5.php index df981fc1..36f48eb3 100644 --- a/Examples/examples_radar/radarex5.php +++ b/Examples/examples_radar/radarex5.php @@ -1,7 +1,7 @@ gDateLocale->GetShortMonth(); diff --git a/Examples/examples_radar/radarex6.1.php b/Examples/examples_radar/radarex6.1.php index 81718a73..06ec13ea 100644 --- a/Examples/examples_radar/radarex6.1.php +++ b/Examples/examples_radar/radarex6.1.php @@ -1,7 +1,7 @@ SetShadow(); diff --git a/Examples/examples_radar/radarex6.php b/Examples/examples_radar/radarex6.php index a1e4d2c7..00e9a836 100644 --- a/Examples/examples_radar/radarex6.php +++ b/Examples/examples_radar/radarex6.php @@ -1,7 +1,7 @@ SetShadow(); diff --git a/Examples/examples_radar/radarex7.php b/Examples/examples_radar/radarex7.php index a126c608..8cce6d50 100644 --- a/Examples/examples_radar/radarex7.php +++ b/Examples/examples_radar/radarex7.php @@ -1,17 +1,18 @@ SetColor('white'); @@ -21,7 +22,10 @@ $graph->SetCenter(0.4, 0.55); // Setup the axis formatting -$graph->axis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->axis->SetWeight(2); // Setup the grid lines @@ -31,7 +35,10 @@ $graph->HideTickMarks(); // Setup graph titles$example_title='Quality result'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->SetTitles(['One', 'Two', 'Three', 'Four', 'Five', 'Sex', 'Seven', 'Eight', 'Nine', 'Ten']); // Create the first radar plot $plot = new Plot\RadarPlot([30, 80, 60, 40, 71, 81, 47]); diff --git a/Examples/examples_radar/radarex8.1.php b/Examples/examples_radar/radarex8.1.php index 4f797123..f2a4bb3b 100644 --- a/Examples/examples_radar/radarex8.1.php +++ b/Examples/examples_radar/radarex8.1.php @@ -1,17 +1,18 @@ img->SetAntiAliasing(); // Set background color and shadow @@ -22,7 +23,10 @@ $graph->SetCenter(0.4, 0.55); // Setup the axis formatting -$graph->axis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup the grid lines $graph->grid->SetLineStyle('solid'); @@ -31,7 +35,10 @@ $graph->HideTickMarks(); // Setup graph titles$example_title='Quality result'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->SetTitles($graph->gDateLocale->GetShortMonth()); diff --git a/Examples/examples_radar/radarex8.php b/Examples/examples_radar/radarex8.php index 74dd5121..37c72398 100644 --- a/Examples/examples_radar/radarex8.php +++ b/Examples/examples_radar/radarex8.php @@ -1,17 +1,18 @@ img->SetAntiAliasing(); // Set background color and shadow @@ -22,7 +23,10 @@ $graph->SetCenter(0.4, 0.55); // Setup the axis formatting -$graph->axis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Setup the grid lines $graph->grid->SetLineStyle('solid'); @@ -31,7 +35,10 @@ $graph->HideTickMarks(); // Setup graph titles$example_title='Quality result'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->SetTitles($graph->gDateLocale->GetShortMonth()); // Create the first radar plot diff --git a/Examples/examples_radar/radarex9.php b/Examples/examples_radar/radarex9.php index 639141f1..e693a1d0 100644 --- a/Examples/examples_radar/radarex9.php +++ b/Examples/examples_radar/radarex9.php @@ -1,26 +1,35 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $subtitle_text = '(according to direction)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_ITALIC'), 10); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_ITALIC'), + 10 +); $graph->SetTitles($titles); $graph->SetCenter(0.5, 0.55); @@ -30,7 +39,9 @@ $graph->grid->SetColor('darkgray@0.3'); $graph->grid->Show(); -$graph->SetGridDepth(Graph\Configs::getConfig('DEPTH_BACK')); +$graph->SetGridDepth( + Graph\Configs::getConfig('DEPTH_BACK') +); $plot = new Plot\RadarPlot($data); $plot->SetColor('red@0.2'); diff --git a/Examples/examples_radar/radarex_issue.php b/Examples/examples_radar/radarex_issue.php index 99540c67..ec67cb1a 100644 --- a/Examples/examples_radar/radarex_issue.php +++ b/Examples/examples_radar/radarex_issue.php @@ -1,7 +1,7 @@ SetFrame(false); $graph->legend->SetPos(0.77, 0.02, 'left', 'top'); -$graph->legend->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->legend->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->SetTitles($titles); -$graph->axis->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->axis->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->axis->SetWeight(2); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->axis->SetColor('black', [225, 100, 150, 0.8]); $graph->axis->scale->ticks->Set(1, 2, 3); $graph->grid->Show(); diff --git a/Examples/examples_radar/radarlogex1-aa.php b/Examples/examples_radar/radarlogex1-aa.php index 2f9cdc57..decc8d61 100644 --- a/Examples/examples_radar/radarlogex1-aa.php +++ b/Examples/examples_radar/radarlogex1-aa.php @@ -1,27 +1,32 @@ SetScale('log'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $example_title = 'Logarithmic scale'; $graph->title->set($example_title); $graph->title->SetMargin(10); @@ -44,7 +49,11 @@ $graph->yscale->ticks->SetMarkColor('black', 'darkgray'); // Set the axis title font -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->axis->title->SetColor('darkred:0.8'); // Use blue axis diff --git a/Examples/examples_radar/radarlogex1.php b/Examples/examples_radar/radarlogex1.php index e7cc3ffc..96c8aec2 100644 --- a/Examples/examples_radar/radarlogex1.php +++ b/Examples/examples_radar/radarlogex1.php @@ -1,27 +1,32 @@ SetScale('log'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $example_title = 'Logarithmic scale'; $graph->title->set($example_title); $graph->title->SetMargin(10); @@ -39,7 +44,11 @@ $graph->yscale->ticks->SetMarkColor('black', 'darkgray'); // Set the axis title font -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 14 +); $graph->axis->title->SetColor('darkred:0.8'); // Use blue axis diff --git a/Examples/examples_radar/radarlogex2.php b/Examples/examples_radar/radarlogex2.php index 40c18123..581e8041 100644 --- a/Examples/examples_radar/radarlogex2.php +++ b/Examples/examples_radar/radarlogex2.php @@ -1,10 +1,11 @@ yscale->ticks->SetMarkColor('black', 'darkgray'); // Set the axis title font -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); // Use blue axis $graph->axis->SetColor('blue'); diff --git a/Examples/examples_radar/radarmarkex1.php b/Examples/examples_radar/radarmarkex1.php index 7d8c1cbe..8c8f6605 100644 --- a/Examples/examples_radar/radarmarkex1.php +++ b/Examples/examples_radar/radarmarkex1.php @@ -1,7 +1,7 @@ title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_VERDANA'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $graph->SetTitles($titles); $graph->SetCenter(0.5, 0.55); @@ -27,9 +31,15 @@ $graph->grid->SetColor('darkgray'); $graph->grid->Show(); -$graph->axis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->axis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $graph->axis->title->SetMargin(5); -$graph->SetGridDepth(Graph\Configs::getConfig('DEPTH_BACK')); +$graph->SetGridDepth( + Graph\Configs::getConfig('DEPTH_BACK') +); $graph->SetSize(0.6); $plot = new Plot\RadarPlot($data); @@ -37,7 +47,10 @@ $plot->SetLineWeight(1); $plot->SetFillColor('red@0.7'); -$plot->mark->SetType(Graph\Configs::getConfig('MARK_IMG_SBALL'), 'red'); +$plot->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_SBALL'), + 'red' +); $graph->Add($plot); $graph->Stroke(); diff --git a/Examples/examples_rotate/rotateex1.php b/Examples/examples_rotate/rotateex1.php index 6e2c5411..78374e3c 100644 --- a/Examples/examples_rotate/rotateex1.php +++ b/Examples/examples_rotate/rotateex1.php @@ -1,19 +1,20 @@ SetAngle(40); $graph->img->SetMargin(80, 80, 80, 80); $graph->SetScale('textlin'); @@ -21,7 +22,7 @@ $graph->SetShadow(); // Create the linear plot -$lineplot = new Plot\LinePlot($ydata); +$lineplot = new Plot\LinePlot($ydata); $lineplot2 = new Plot\LinePlot($y2data); // Add the plot to the graph @@ -34,9 +35,18 @@ $graph->title->Set('Example 1 rotated graph (40 degree)'); $graph->legend->Pos(0.05, 0.1, 'right', 'top'); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $lineplot->SetColor('blue'); $lineplot->SetWeight(2); diff --git a/Examples/examples_rotate/rotex0.php b/Examples/examples_rotate/rotex0.php index bd42778b..a75e3d35 100644 --- a/Examples/examples_rotate/rotex0.php +++ b/Examples/examples_rotate/rotex0.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); diff --git a/Examples/examples_rotate/rotex1.php b/Examples/examples_rotate/rotex1.php index 8914c2fc..6b0f1e74 100644 --- a/Examples/examples_rotate/rotex1.php +++ b/Examples/examples_rotate/rotex1.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); diff --git a/Examples/examples_rotate/rotex2.php b/Examples/examples_rotate/rotex2.php index 5069a161..2e8c67bc 100644 --- a/Examples/examples_rotate/rotex2.php +++ b/Examples/examples_rotate/rotex2.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); diff --git a/Examples/examples_rotate/rotex3.php b/Examples/examples_rotate/rotex3.php index 92c90326..e82ea5a0 100644 --- a/Examples/examples_rotate/rotex3.php +++ b/Examples/examples_rotate/rotex3.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); $graph->img->SetAngle(45); -$graph->img->SetCenter(floor(270 / 2), floor(170 / 2)); +$graph->img->SetCenter(\floor(270 / 2), \floor(170 / 2)); $line = new Plot\LinePlot($ydata); $line->SetLegend('2002'); diff --git a/Examples/examples_rotate/rotex4.php b/Examples/examples_rotate/rotex4.php index 7cf58edd..79b1dbc6 100644 --- a/Examples/examples_rotate/rotex4.php +++ b/Examples/examples_rotate/rotex4.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); $graph->img->SetAngle(90); -$graph->img->SetCenter(floor(270 / 2), floor(170 / 2)); +$graph->img->SetCenter(\floor(270 / 2), \floor(170 / 2)); $line = new Plot\LinePlot($ydata); $line->SetLegend('2002'); diff --git a/Examples/examples_rotate/rotex5.php b/Examples/examples_rotate/rotex5.php index c8992d04..c9a5e0b7 100644 --- a/Examples/examples_rotate/rotex5.php +++ b/Examples/examples_rotate/rotex5.php @@ -1,7 +1,7 @@ SetMargin(30, 90, 30, 30); $graph->SetScale('textlin'); diff --git a/Examples/examples_scatter/bezierex1.php b/Examples/examples_scatter/bezierex1.php index 6fb73f61..6535f70e 100644 --- a/Examples/examples_scatter/bezierex1.php +++ b/Examples/examples_scatter/bezierex1.php @@ -1,10 +1,11 @@ Get(50); +[$newx, $newy] = $bez->Get(50); // Create the graph -$__width = 300; +$__width = 300; $__height = 200; -$g = new Graph\Graph($__width, $__height); +$g = new Graph\Graph($__width, $__height); $g->SetMargin(30, 20, 40, 30); $example_title = 'Bezier interpolation'; $g->title->set($example_title); -$g->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$g->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $subtitle_text = '(Control points shown in red)'; $g->subtitle->Set($subtitle_text); $g->subtitle->SetColor('darkred'); diff --git a/Examples/examples_scatter/ccbp_ex1.php b/Examples/examples_scatter/ccbp_ex1.php index 10d6455e..4c714973 100644 --- a/Examples/examples_scatter/ccbp_ex1.php +++ b/Examples/examples_scatter/ccbp_ex1.php @@ -1,33 +1,36 @@ SetTitle('Buffer penetration', '(history added)'); $graph->SetColorMap(0); // Two "fake tasks with hostory -$datax = [75, 83]; -$datay = [110, 64]; +$datax = [75, 83]; +$datay = [110, 64]; $datax1 = [33, 50, 67, 83]; $datay1 = [86, 76, 80, 64]; $datax2 = [18, 47, 58, 75]; $datay2 = [80, 97, 105, 110]; $sp = new Plot\ScatterPlot($datay, $datax); -$sp->mark->SetType(Graph\Configs::getConfig('MARK_DIAMOND')); +$sp->mark->SetType( + Graph\Configs::getConfig('MARK_DIAMOND') +); $sp->mark->SetFillColor('white'); $sp->mark->SetSize(12); -$sp_hist = []; +$sp_hist = []; $sp_hist[0] = new Plot\LinePlot($datay1, $datax1); $sp_hist[0]->SetWeight(1); $sp_hist[0]->SetColor('white'); diff --git a/Examples/examples_scatter/ccbp_ex2.php b/Examples/examples_scatter/ccbp_ex2.php index b44d1aa4..0529ccc2 100644 --- a/Examples/examples_scatter/ccbp_ex2.php +++ b/Examples/examples_scatter/ccbp_ex2.php @@ -1,33 +1,36 @@ SetTitle('Buffer penetration', '(history added)'); $graph->SetColorMap(1); // Two "fake tasks with hostory -$datax = [75, 83]; -$datay = [110, 64]; +$datax = [75, 83]; +$datay = [110, 64]; $datax1 = [33, 50, 67, 83]; $datay1 = [86, 76, 80, 64]; $datax2 = [18, 47, 58, 75]; $datay2 = [80, 97, 105, 110]; $sp = new Plot\ScatterPlot($datay, $datax); -$sp->mark->SetType(Graph\Configs::getConfig('MARK_DIAMOND')); +$sp->mark->SetType( + Graph\Configs::getConfig('MARK_DIAMOND') +); $sp->mark->SetFillColor('white'); $sp->mark->SetSize(12); -$sp_hist = []; +$sp_hist = []; $sp_hist[0] = new Plot\LinePlot($datay1, $datax1); $sp_hist[0]->SetWeight(1); $sp_hist[0]->SetColor('white'); diff --git a/Examples/examples_scatter/fieldscatterex1.php b/Examples/examples_scatter/fieldscatterex1.php index 112712ca..4e2c88e7 100644 --- a/Examples/examples_scatter/fieldscatterex1.php +++ b/Examples/examples_scatter/fieldscatterex1.php @@ -1,7 +1,7 @@ 1) { + + if (1 < $f) { $f = 1; } - $red = floor((1 - $f) * 255); - $blue = floor($f * 255); + $red = \floor((1 - $f) * 255); + $blue = \floor($f * 255); $color = [$red, 0, $blue]; //echo "x=$x, y=$y, blue=$blue, red=$red
"; return [$color, $size, $arrowsize]; @@ -43,42 +44,48 @@ function FldCallback($x, $y, $a) $datax = []; $datay = []; $angle = []; -for ($x = 1; $x < 10; ++$x) { - for ($y = 10; $y < 100; $y += 10) { + +for ($x = 1; 10 > $x; ++$x) { + for ($y = 10; 100 > $y; $y += 10) { $a = -1; - if ($x == $polex && $y == $poley) { + + if ($x === $polex && $y === $poley) { continue; } - if ($x == $polex) { + if ($x === $polex) { if ($y > $poley) { $a = 90; } else { $a = 270; } } - if ($y == $poley) { + + if ($y === $poley) { if ($x > $polex) { $a = 0; } else { $a = 180; } } - if ($a == -1) { + + if (-1 === $a) { $d1 = $y - $poley; $d2 = ($polex - $x) * 20; + if ($y < $poley) { $d2 *= -1; } - $h = sqrt($d1 * $d1 + $d2 * $d2); - $t = -$d2 / $h; - $ac = acos($t); + $h = \sqrt($d1 * $d1 + $d2 * $d2); + $t = -$d2 / $h; + $ac = \acos($t); + if ($y < $poley) { - $ac += M_PI; + $ac += \M_PI; } - $a = $ac * 180 / M_PI; + $a = $ac * 180 / \M_PI; } $datax[] = $x; $datay[] = $y; @@ -87,9 +94,9 @@ function FldCallback($x, $y, $a) } // Setup the graph -$__width = 300; +$__width = 300; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('intlin', 0, 100, 0, 10); $graph->SetMarginColor('lightblue'); diff --git a/Examples/examples_scatter/footerex1.php b/Examples/examples_scatter/footerex1.php index 19d939d0..f81b10c4 100644 --- a/Examples/examples_scatter/footerex1.php +++ b/Examples/examples_scatter/footerex1.php @@ -1,19 +1,20 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); @@ -21,7 +22,11 @@ // Setup the tab $graph->tabtitle->Set(' Year 2003 '); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 13); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 13 +); $graph->tabtitle->SetColor('darkred', '#E1E1FF'); // Enable X-grid as well @@ -31,13 +36,25 @@ $graph->xaxis->SetTickLabels($graph->gDateLocale->GetShortMonth()); $graph->footer->left->Set('L. footer'); -$graph->footer->left->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->footer->left->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $graph->footer->left->SetColor('darkred'); $graph->footer->center->Set('C. footer'); -$graph->footer->center->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->footer->center->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->footer->center->SetColor('darkred'); $graph->footer->right->Set('R. footer'); -$graph->footer->right->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->footer->right->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); $graph->footer->right->SetColor('darkred'); // Create the plot @@ -45,13 +62,21 @@ $p1->SetColor('navy'); // Use an image of favourite car as marker -$p1->mark->SetType(Graph\Configs::getConfig('MARK_IMG'), __DIR__ . '/../assets/saab_95.jpg', 0.5); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_IMG'), + __DIR__ . '/../assets/saab_95.jpg', + 0.5 +); // Displayes value on top of marker image $p1->value->SetFormat('%d mil'); $p1->value->Show(); $p1->value->SetColor('darkred'); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Increase the margin so that the value is printed avove tje // img marker $p1->value->SetMargin(14); diff --git a/Examples/examples_scatter/impulsex1.php b/Examples/examples_scatter/impulsex1.php index c69bff91..5813854a 100644 --- a/Examples/examples_scatter/impulsex1.php +++ b/Examples/examples_scatter/impulsex1.php @@ -1,28 +1,34 @@ SetScale('textlin'); $graph3->SetShadow(); $graph3->img->SetMargin(40, 40, 40, 40); $example_title = 'Simple impulse plot'; $graph3->title->set($example_title); -$graph3->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph3->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $sp1 = new Plot\ScatterPlot($datay); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $sp1->SetImpuls(); $graph3->Add($sp1); diff --git a/Examples/examples_scatter/impulsex2.php b/Examples/examples_scatter/impulsex2.php index b07a720a..139c6dae 100644 --- a/Examples/examples_scatter/impulsex2.php +++ b/Examples/examples_scatter/impulsex2.php @@ -1,30 +1,39 @@ SetScale('textlin'); $graph->SetShadow(); $graph->img->SetMargin(40, 40, 40, 40); $example_title = 'Impuls plot, variant 2'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xaxis->title->Set('Impuls respons'); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $sp1 = new Plot\ScatterPlot($datay); //,$datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->mark->SetWidth(4); $sp1->SetImpuls(); diff --git a/Examples/examples_scatter/impulsex3.php b/Examples/examples_scatter/impulsex3.php index 6b189d7f..3b758e7e 100644 --- a/Examples/examples_scatter/impulsex3.php +++ b/Examples/examples_scatter/impulsex3.php @@ -1,37 +1,41 @@ SetScale('intlin'); $graph->SetShadow(); $graph->SetBox(); $example_title = 'Impuls Example 3'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Set format callback for labels $graph->yaxis->SetLabelFormatCallback('mycallback'); @@ -43,12 +47,18 @@ function mycallback($l) // of the ticks on the Y-axis $graph->yaxis->SetLabelMargin(12); $graph->xaxis->SetLabelMargin(6); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); // Create a new impulse type scatter plot $sp1 = new Plot\ScatterPlot($datay); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $sp1->mark->SetFillColor('red'); $sp1->SetImpuls(); $sp1->SetColor('blue'); diff --git a/Examples/examples_scatter/impulsex4.php b/Examples/examples_scatter/impulsex4.php index 4617288c..1baea0d5 100644 --- a/Examples/examples_scatter/impulsex4.php +++ b/Examples/examples_scatter/impulsex4.php @@ -1,41 +1,45 @@ $i; ++$i) { + $datay[$i + $numpoints - 1] = \exp($k * $i) * \cos(2 * \M_PI / 10 * $i) * 14; + $datayenv[$i + $numpoints - 1] = \exp($k * $i) * 14; + $datax[$i + $numpoints - 1] = $i; } for ($i = 0; $i < $numpoints; ++$i) { - $datay[$i + $numpoints - 1] = exp(-$k * $i) * cos(2 * M_PI / 10 * $i) * 14; - $datayenv[$i + $numpoints - 1] = exp(-$k * $i) * 14; - $datax[$i + $numpoints - 1] = $i; + $datay[$i + $numpoints - 1] = \exp(-$k * $i) * \cos(2 * \M_PI / 10 * $i) * 14; + $datayenv[$i + $numpoints - 1] = \exp(-$k * $i) * 14; + $datax[$i + $numpoints - 1] = $i; } // Setup the basic parameters for the graph -$__width = 500; +$__width = 500; $__height = 250; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('intlin'); $graph->SetShadow(); $graph->SetBox(); $example_title = 'Impuls Example 4'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Set some other color then the boring default $graph->SetColor('lightyellow'); @@ -52,16 +56,27 @@ // of the ticks on the Y-axis $graph->yaxis->SetLabelMargin(12); $graph->xaxis->SetLabelMargin(6); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); // Add mark graph with static lines -$line = new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 0, 'black', 2); +$line = new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 0, + 'black', + 2 +); $graph->AddLine($line); // Create a new impulse type scatter plot $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_SQUARE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_SQUARE') +); $sp1->mark->SetFillColor('red'); $sp1->mark->SetWidth(3); diff --git a/Examples/examples_scatter/loglogex1.php b/Examples/examples_scatter/loglogex1.php index eb2be7f0..e6e036c6 100644 --- a/Examples/examples_scatter/loglogex1.php +++ b/Examples/examples_scatter/loglogex1.php @@ -1,27 +1,34 @@ SetScale('loglog'); $graph->SetY2Scale('lin'); $graph->y2axis->SetColor('blue', 'blue'); @@ -34,9 +41,18 @@ $graph->y2axis->title->Set('mn/2 [m]'); $graph->y2axis->title->SetColor('blue'); $graph->y2axis->SetTitleMargin(35); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $graph->xgrid->Show(true, true); $graph->ygrid->Show(true, true); @@ -44,13 +60,17 @@ $lineplot = new Plot\LinePlot($rhos, $ab2); $lineplot->SetWeight(1); -$lineplot->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$lineplot->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $lineplot->mark->SetWidth(2); // Create scatter plot $scplot = new Plot\ScatterPlot($mn2, $ab2); -$scplot->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$scplot->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $scplot->mark->SetColor('blue'); $scplot->mark->SetWidth(2); diff --git a/Examples/examples_scatter/markflagex1.php b/Examples/examples_scatter/markflagex1.php index 6e220a3e..d71bcacf 100644 --- a/Examples/examples_scatter/markflagex1.php +++ b/Examples/examples_scatter/markflagex1.php @@ -1,21 +1,23 @@ SetMarginColor('white'); $graph->SetScale('textlin'); $graph->SetFrame(false); @@ -34,13 +36,20 @@ $p1->SetColor('navy'); // Use a flag -$p1->mark->SetType(Graph\Configs::getConfig('MARK_FLAG1'), 197); +$p1->mark->SetType( + Graph\Configs::getConfig('MARK_FLAG1'), + 197 +); // Displayes value on top of marker image $p1->value->SetFormat('%d mil'); $p1->value->Show(); $p1->value->SetColor('darkred'); -$p1->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$p1->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Increase the margin so that the value is printed avove tje // img marker $p1->value->SetMargin(14); @@ -58,13 +67,20 @@ $p2->SetColor('navy'); // Use a flag -$p2->mark->SetType(Graph\Configs::getConfig('MARK_FLAG1'), 'united states'); +$p2->mark->SetType( + Graph\Configs::getConfig('MARK_FLAG1'), + 'united states' +); // Displayes value on top of marker image $p2->value->SetFormat('%d mil'); $p2->value->Show(); $p2->value->SetColor('darkred'); -$p2->value->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$p2->value->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); // Increase the margin so that the value is printed avove tje // img marker $p2->value->SetMargin(14); diff --git a/Examples/examples_scatter/no_dim_balloonex1.php b/Examples/examples_scatter/no_dim_balloonex1.php index 91a4c165..89628b31 100644 --- a/Examples/examples_scatter/no_dim_balloonex1.php +++ b/Examples/examples_scatter/no_dim_balloonex1.php @@ -1,11 +1,12 @@ $aVal) { $c = 'blue'; - } elseif ($aVal < 70) { + } elseif (70 > $aVal) { $c = 'green'; } else { $c = 'red'; } - return [floor($aVal / 3), '', $c]; + return [\floor($aVal / 3), '', $c]; }; // Setup a basic graph -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height, 'auto'); +$graph = new Graph\Graph($__width, $__height, 'auto'); $graph->SetScale('linlin'); $graph->img->SetMargin(40, 100, 40, 40); $graph->SetShadow(); @@ -47,11 +48,16 @@ // Create the scatter plot $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); // Uncomment the following two lines to display the values $sp1->value->Show(); -$sp1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$sp1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Specify the callback $sp1->mark->SetCallback($FCallback); diff --git a/Examples/examples_scatter/no_dim_balloonex2.php b/Examples/examples_scatter/no_dim_balloonex2.php index 1e323e15..6d3bc516 100644 --- a/Examples/examples_scatter/no_dim_balloonex2.php +++ b/Examples/examples_scatter/no_dim_balloonex2.php @@ -1,10 +1,11 @@ SetScale('intlin'); $graph->SetMargin(40, 40, 40, 40); $graph->SetMarginColor('wheat'); $example_title = 'Example of ballon scatter plot with X,Y callback'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetMargin(10); // Use a lot of grace to get large scales since the ballon have @@ -65,11 +73,16 @@ // Create the scatter plot $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); // Uncomment the following two lines to display the values $sp1->value->Show(); -$sp1->value->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$sp1->value->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Specify the callback $sp1->mark->SetCallbackYX($FCallback); diff --git a/Examples/examples_scatter/pushpinex1.php b/Examples/examples_scatter/pushpinex1.php index 19a2429a..493bd416 100644 --- a/Examples/examples_scatter/pushpinex1.php +++ b/Examples/examples_scatter/pushpinex1.php @@ -1,14 +1,15 @@ yaxis->Hide(); // Use a worldmap as the background and let it fill the plot area -$graph->SetBackgroundImage(Graph\Configs::getConfig('WORLDMAP'), Graph\Configs::getConfig('BGIMG_FILLPLOT')); +$graph->SetBackgroundImage( + Graph\Configs::getConfig('WORLDMAP'), + Graph\Configs::getConfig('BGIMG_FILLPLOT') +); // Setup a nice title with a striped bevel background$example_title='Pushpin graph'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('white'); $graph->SetTitleBackground('darkgreen', Graph\Configs::getConfig('TITLEBKG_STYLE1'), Graph\Configs::getConfig('TITLEBKG_FRAME_BEVEL')); -$graph->SetTitleBackgroundFillStyle(Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), 'blue', 'darkgreen'); +$graph->SetTitleBackgroundFillStyle( + Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), + 'blue', + 'darkgreen' +); // Finally create the scatterplot $sp = new Plot\ScatterPlot($datay, $datax); // We want the markers to be an image -$sp->mark->SetType(Graph\Configs::getConfig('MARK_IMG_PUSHPIN'), 'blue', 0.6); +$sp->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_PUSHPIN'), + 'blue', + 0.6 +); // Install the Y-X callback for the markers $sp->mark->SetCallbackYX($markCallback); diff --git a/Examples/examples_scatter/pushpinex2.php b/Examples/examples_scatter/pushpinex2.php index 95d2944d..43334692 100644 --- a/Examples/examples_scatter/pushpinex2.php +++ b/Examples/examples_scatter/pushpinex2.php @@ -1,14 +1,15 @@ yaxis->Hide(); // Use a worldmap as the background and let it fill the plot area -$graph->SetBackgroundImage(Graph\Configs::getConfig('WORLDMAP'), Graph\Configs::getConfig('BGIMG_FILLPLOT')); +$graph->SetBackgroundImage( + Graph\Configs::getConfig('WORLDMAP'), + Graph\Configs::getConfig('BGIMG_FILLPLOT') +); // Setup a nice title with a striped bevel background$example_title='Pushpin graph'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 16 +); $graph->title->SetColor('white'); $graph->SetTitleBackground('darkgreen', Graph\Configs::getConfig('TITLEBKG_STYLE1'), Graph\Configs::getConfig('TITLEBKG_FRAME_BEVEL')); -$graph->SetTitleBackgroundFillStyle(Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), 'blue', 'darkgreen'); +$graph->SetTitleBackgroundFillStyle( + Graph\Configs::getConfig('TITLEBKG_FILLSTYLE_HSTRIPED'), + 'blue', + 'darkgreen' +); // Finally create the lineplot $lp = new Plot\LinePlot($datay, $datax); $lp->SetColor('lightgray'); // We want the markers to be an image -$lp->mark->SetType(Graph\Configs::getConfig('MARK_IMG_PUSHPIN'), 'blue', 0.6); +$lp->mark->SetType( + Graph\Configs::getConfig('MARK_IMG_PUSHPIN'), + 'blue', + 0.6 +); // Install the Y-X callback for the markers $lp->mark->SetCallbackYX($markCallback); diff --git a/Examples/examples_scatter/scatterex1.php b/Examples/examples_scatter/scatterex1.php index 4626d647..9b361e27 100644 --- a/Examples/examples_scatter/scatterex1.php +++ b/Examples/examples_scatter/scatterex1.php @@ -1,26 +1,30 @@ SetScale('linlin'); $graph->img->SetMargin(40, 40, 40, 40); $graph->SetShadow(); $example_title = 'A simple scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $sp1 = new Plot\ScatterPlot($datay, $datax); diff --git a/Examples/examples_scatter/scatterex2.php b/Examples/examples_scatter/scatterex2.php index 347050f7..c735f3d3 100644 --- a/Examples/examples_scatter/scatterex2.php +++ b/Examples/examples_scatter/scatterex2.php @@ -1,29 +1,35 @@ SetScale('linlin'); $graph->img->SetMargin(40, 40, 40, 40); $graph->SetShadow(); $example_title = 'A simple scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->mark->SetWidth(8); diff --git a/Examples/examples_scatter/scatterlinkex1.php b/Examples/examples_scatter/scatterlinkex1.php index 24fa56ba..b897ec21 100644 --- a/Examples/examples_scatter/scatterlinkex1.php +++ b/Examples/examples_scatter/scatterlinkex1.php @@ -1,29 +1,35 @@ img->SetMargin(40, 40, 40, 40); $graph->img->SetAntiAliasing(); $graph->SetScale('linlin'); $graph->SetShadow(); $example_title = 'Linked Scatter plot ex1'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $sp1 = new Plot\ScatterPlot($datay, $datax); $sp1->SetLinkPoints(true, 'red', 2); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('navy'); $sp1->mark->SetWidth(3); diff --git a/Examples/examples_scatter/scatterlinkex2.php b/Examples/examples_scatter/scatterlinkex2.php index 0dc2d274..71649787 100644 --- a/Examples/examples_scatter/scatterlinkex2.php +++ b/Examples/examples_scatter/scatterlinkex2.php @@ -1,24 +1,26 @@ SetScale('linlin'); $graph->img->SetMargin(40, 40, 40, 40); @@ -26,14 +28,19 @@ $graph->SetShadow(); $example_title = 'Linked scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // 10% top and bottom grace $graph->yscale->SetGrace(5, 5); $graph->xscale->SetGrace(1, 1); $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->SetColor('blue'); diff --git a/Examples/examples_scatter/scatterlinkex3.php b/Examples/examples_scatter/scatterlinkex3.php index 89e36b06..c01fe5fa 100644 --- a/Examples/examples_scatter/scatterlinkex3.php +++ b/Examples/examples_scatter/scatterlinkex3.php @@ -1,42 +1,54 @@ SetScale('linlin'); $graph->SetShadow(); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXOUT')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXOUT') +); $graph->img->SetMargin(50, 50, 60, 40); $example_title = 'Linked scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $subtitle_text = 'BOXOUT Axis style)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); // 10% top and bottom grace $graph->yscale->SetGrace(5, 5); $graph->xscale->SetGrace(1, 1); $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->SetColor('blue'); diff --git a/Examples/examples_scatter/scatterlinkex4.php b/Examples/examples_scatter/scatterlinkex4.php index 94eb5fe2..1318aa50 100644 --- a/Examples/examples_scatter/scatterlinkex4.php +++ b/Examples/examples_scatter/scatterlinkex4.php @@ -1,42 +1,54 @@ SetScale('linlin'); $graph->SetShadow(); -$graph->SetAxisStyle(Graph\Configs::getConfig('AXSTYLE_BOXIN')); +$graph->SetAxisStyle( + Graph\Configs::getConfig('AXSTYLE_BOXIN') +); $graph->img->SetMargin(50, 50, 60, 40); $example_title = 'Linked scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); $subtitle_text = 'BOXIN Axis style)'; $graph->subtitle->Set($subtitle_text); -$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_NORMAL')); +$graph->subtitle->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_NORMAL') +); // 10% top and bottom grace $graph->yscale->SetGrace(5, 5); $graph->xscale->SetGrace(1, 1); $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->SetColor('blue'); diff --git a/Examples/examples_scatter/scatterrotex1.php b/Examples/examples_scatter/scatterrotex1.php index 000362f4..4e58c320 100644 --- a/Examples/examples_scatter/scatterrotex1.php +++ b/Examples/examples_scatter/scatterrotex1.php @@ -1,26 +1,30 @@ SetScale('linlin'); $graph->Set90AndMargin(40, 40, 40, 40); $graph->SetShadow(); $example_title = 'A 90 degrees rotated scatter plot'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_FONT1'), + Graph\Configs::getConfig('FS_BOLD') +); // Adjust the label align for X-axis so they look good rotated $graph->xaxis->SetLabelAlign('right', 'center', 'right'); @@ -33,7 +37,9 @@ $graph->xaxis->title->SetMargin(15); $sp1 = new Plot\ScatterPlot($datay, $datax); -$sp1->mark->SetType(Graph\Configs::getConfig('MARK_FILLEDCIRCLE')); +$sp1->mark->SetType( + Graph\Configs::getConfig('MARK_FILLEDCIRCLE') +); $sp1->mark->SetFillColor('red'); $sp1->mark->SetWidth(5); diff --git a/Examples/examples_staticband/smallstaticbandsex1.php b/Examples/examples_staticband/smallstaticbandsex1.php index 43a18a60..2fc96d42 100644 --- a/Examples/examples_staticband/smallstaticbandsex1.php +++ b/Examples/examples_staticband/smallstaticbandsex1.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_RDIAG'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex10.php b/Examples/examples_staticband/smallstaticbandsex10.php index 66a53d36..dcaff779 100644 --- a/Examples/examples_staticband/smallstaticbandsex10.php +++ b/Examples/examples_staticband/smallstaticbandsex10.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_DIAGCROSS'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_DIAGCROSS'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_DIAGCROSS'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex11.php b/Examples/examples_staticband/smallstaticbandsex11.php index 66a53d36..dcaff779 100644 --- a/Examples/examples_staticband/smallstaticbandsex11.php +++ b/Examples/examples_staticband/smallstaticbandsex11.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_DIAGCROSS'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_DIAGCROSS'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_DIAGCROSS'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex2.php b/Examples/examples_staticband/smallstaticbandsex2.php index f2684a63..f10d0f68 100644 --- a/Examples/examples_staticband/smallstaticbandsex2.php +++ b/Examples/examples_staticband/smallstaticbandsex2.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_LDIAG'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex3.php b/Examples/examples_staticband/smallstaticbandsex3.php index 7b9c6736..1e86347c 100644 --- a/Examples/examples_staticband/smallstaticbandsex3.php +++ b/Examples/examples_staticband/smallstaticbandsex3.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_SOLID'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_SOLID'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_SOLID'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex4.php b/Examples/examples_staticband/smallstaticbandsex4.php index f6ba8209..55e4df23 100644 --- a/Examples/examples_staticband/smallstaticbandsex4.php +++ b/Examples/examples_staticband/smallstaticbandsex4.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,13 +36,23 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 15, + 35, + 'khaki4' +); $band->SetDensity(80); $band->ShowFrame(true); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_3DPLANE, Density=60'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex5.php b/Examples/examples_staticband/smallstaticbandsex5.php index cb839d2f..987c7d97 100644 --- a/Examples/examples_staticband/smallstaticbandsex5.php +++ b/Examples/examples_staticband/smallstaticbandsex5.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,13 +36,25 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_HVCROSS'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_HVCROSS'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(true); -$band->SetOrder(Graph\Configs::getConfig('DEPTH_FRONT')); +$band->SetOrder( + Graph\Configs::getConfig('DEPTH_FRONT') +); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_HVCROSS, In front'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex6.php b/Examples/examples_staticband/smallstaticbandsex6.php index 3625adc7..5877a1de 100644 --- a/Examples/examples_staticband/smallstaticbandsex6.php +++ b/Examples/examples_staticband/smallstaticbandsex6.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_VLINE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_VLINE'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_VLINE'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex7.php b/Examples/examples_staticband/smallstaticbandsex7.php index fb39dd78..2a8071a3 100644 --- a/Examples/examples_staticband/smallstaticbandsex7.php +++ b/Examples/examples_staticband/smallstaticbandsex7.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_HLINE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_HLINE'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_HLINE'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex8.php b/Examples/examples_staticband/smallstaticbandsex8.php index d0294f4d..7fb68183 100644 --- a/Examples/examples_staticband/smallstaticbandsex8.php +++ b/Examples/examples_staticband/smallstaticbandsex8.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_3DPLANE'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/smallstaticbandsex9.php b/Examples/examples_staticband/smallstaticbandsex9.php index 7079cf69..015f9ced 100644 --- a/Examples/examples_staticband/smallstaticbandsex9.php +++ b/Examples/examples_staticband/smallstaticbandsex9.php @@ -1,21 +1,22 @@ SetScale('textlin'); $graph->SetMargin(25, 10, 20, 20); @@ -35,12 +36,22 @@ $graph->Add($bplot); // Add band -$band = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_HVCROSS'), 15, 35, 'khaki4'); +$band = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_HVCROSS'), + 15, + 35, + 'khaki4' +); $band->ShowFrame(false); $graph->Add($band); // Set title -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 10 +); $graph->title->SetColor('darkred'); $example_title = 'BAND_HVCROSS'; $graph->title->set($example_title); diff --git a/Examples/examples_staticband/staticbandbarex1.php b/Examples/examples_staticband/staticbandbarex1.php index 20728da3..721ca79d 100644 --- a/Examples/examples_staticband/staticbandbarex1.php +++ b/Examples/examples_staticband/staticbandbarex1.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -49,13 +58,26 @@ $graph->Add($bplot); // Add band -$graph->Add(new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_HLINE'), 0, 10)); +$graph->Add(new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_HLINE'), + 0, + 10 +)); //$graph->title->Set("Test of bar gradient fill"); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex2.php b/Examples/examples_staticband/staticbandbarex2.php index 8f51f5d7..04a31a36 100644 --- a/Examples/examples_staticband/staticbandbarex2.php +++ b/Examples/examples_staticband/staticbandbarex2.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -49,13 +58,28 @@ $graph->Add($bplot); // Add band -$graph->Add(new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 0, 'max', 'red', 2)); +$graph->Add(new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 0, + 'max', + 'red', + 2 +)); //$graph->title->Set("Test of bar gradient fill"); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex3.php b/Examples/examples_staticband/staticbandbarex3.php index 36c55ebf..d57f802f 100644 --- a/Examples/examples_staticband/staticbandbarex3.php +++ b/Examples/examples_staticband/staticbandbarex3.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -49,9 +58,21 @@ $graph->Add($bplot); // Add upper and lower band and use no frames -$uband = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 0, 'max', 'green'); +$uband = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 0, + 'max', + 'green' +); $uband->ShowFrame(false); -$lband = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), 'min', 0, 'red'); +$lband = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + 'min', + 0, + 'red' +); $lband->ShowFrame(false); $graph->Add($uband); @@ -61,7 +82,15 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex4.php b/Examples/examples_staticband/staticbandbarex4.php index 139acc69..e93069a6 100644 --- a/Examples/examples_staticband/staticbandbarex4.php +++ b/Examples/examples_staticband/staticbandbarex4.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -49,10 +58,22 @@ $graph->Add($bplot); // Add upper and lower band and use no frames -$uband = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 0, 'max', 'green'); +$uband = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 0, + 'max', + 'green' +); $uband->ShowFrame(false); $uband->SetDensity(50); // 50% line density -$lband = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), 'min', 0, 'red'); +$lband = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + 'min', + 0, + 'red' +); $lband->ShowFrame(false); $lband->SetDensity(20); // 20% line density @@ -63,7 +84,15 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex5.php b/Examples/examples_staticband/staticbandbarex5.php index 8a23c0bf..af5b353c 100644 --- a/Examples/examples_staticband/staticbandbarex5.php +++ b/Examples/examples_staticband/staticbandbarex5.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = '(Department X)'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -49,13 +58,31 @@ $graph->Add($bplot); // Add upper and lower band and use no frames -$band[0] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 10, 20, 'green'); +$band[0] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 10, + 20, + 'green' +); $band[0]->ShowFrame(false); $band[0]->SetDensity(30); -$band[1] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), -20, -10, 'red'); +$band[1] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + -20, + -10, + 'red' +); $band[1]->ShowFrame(false); $band[1]->SetDensity(40); -$band[2] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), 'min', -20, 'red'); +$band[2] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + 'min', + -20, + 'red' +); $band[2]->ShowFrame(false); $band[2]->SetDensity(80); @@ -66,7 +93,15 @@ $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex6.php b/Examples/examples_staticband/staticbandbarex6.php index 2e23f7e7..17ac0b79 100644 --- a/Examples/examples_staticband/staticbandbarex6.php +++ b/Examples/examples_staticband/staticbandbarex6.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = 'Shows some possible patterns for bands'; @@ -31,8 +36,12 @@ $graph->yscale->SetGrace(10, 10); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -50,32 +59,91 @@ $graph->Add($bplot); // Add upper and lower band and use no frames -$band[0] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_RDIAG'), 10, 20, 'green'); +$band[0] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_RDIAG'), + 10, + 20, + 'green' +); $band[0]->ShowFrame(false); -$band[1] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_LDIAG'), -20, -10, 'red'); +$band[1] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_LDIAG'), + -20, + -10, + 'red' +); $band[1]->ShowFrame(false); $band[1]->SetDensity(20); -$band[2] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_DIAGCROSS'), 'min', -20, 'red'); +$band[2] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_DIAGCROSS'), + 'min', + -20, + 'red' +); $band[2]->ShowFrame(false); $band[2]->SetDensity(40); -$band[3] = new Plot\PlotBand(Graph\Configs::getConfig('VERTICAL'), Graph\Configs::getConfig('BAND_HLINE'), 0, 1, 'darkgray'); +$band[3] = new Plot\PlotBand( + Graph\Configs::getConfig('VERTICAL'), + Graph\Configs::getConfig('BAND_HLINE'), + 0, + 1, + 'darkgray' +); $band[3]->ShowFrame(false); -$band[3]->SetOrder(Graph\Configs::getConfig('DEPTH_FRONT')); -$band[4] = new Plot\PlotBand(Graph\Configs::getConfig('VERTICAL'), Graph\Configs::getConfig('BAND_HVCROSS'), 5, 'max', 'darkgray'); +$band[3]->SetOrder( + Graph\Configs::getConfig('DEPTH_FRONT') +); +$band[4] = new Plot\PlotBand( + Graph\Configs::getConfig('VERTICAL'), + Graph\Configs::getConfig('BAND_HVCROSS'), + 5, + 'max', + 'darkgray' +); $band[4]->ShowFrame(false); -$band[4]->SetOrder(Graph\Configs::getConfig('DEPTH_FRONT')); -$band[5] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_SOLID'), 20, 'max', 'lightgreen'); -$band[6] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), -10, 0, 'blue'); +$band[4]->SetOrder( + Graph\Configs::getConfig('DEPTH_FRONT') +); +$band[5] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_SOLID'), + 20, + 'max', + 'lightgreen' +); +$band[6] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + -10, + 0, + 'blue' +); $band[6]->SetDensity(70); $graph->Add($band); -$graph->AddLine(new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 0, 'black', 2)); +$graph->AddLine(new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 0, + 'black', + 2 +)); //$graph->title->Set("Test of bar gradient fill"); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_staticband/staticbandbarex7.php b/Examples/examples_staticband/staticbandbarex7.php index e368edef..bf783a73 100644 --- a/Examples/examples_staticband/staticbandbarex7.php +++ b/Examples/examples_staticband/staticbandbarex7.php @@ -1,24 +1,29 @@ img->SetMargin(60, 30, 50, 40); $graph->SetScale('textlin'); $graph->SetShadow(); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 15); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 15 +); $example_title = 'Cash flow '; $graph->title->set($example_title); $subtitle_text = 'Use of static line, 3D and solid band'; @@ -32,8 +37,12 @@ $graph->yscale->SetAutoMin(-20); // Turn the tick mark out from the plot area -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Create a bar pot $bplot = new Plot\BarPlot($datay); @@ -51,20 +60,45 @@ $graph->Add($bplot); // Add upper and lower band and use no frames -$band[0] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_3DPLANE'), 'min', 0, 'blue'); +$band[0] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_3DPLANE'), + 'min', + 0, + 'blue' +); $band[0]->ShowFrame(false); $band[0]->SetDensity(20); -$band[1] = new Plot\PlotBand(Graph\Configs::getConfig('HORIZONTAL'), Graph\Configs::getConfig('BAND_SOLID'), 0, 'max', 'steelblue'); +$band[1] = new Plot\PlotBand( + Graph\Configs::getConfig('HORIZONTAL'), + Graph\Configs::getConfig('BAND_SOLID'), + 0, + 'max', + 'steelblue' +); $band[1]->ShowFrame(false); $graph->Add($band); -$graph->Add(new Plot\PlotLine(Graph\Configs::getConfig('HORIZONTAL'), 0, 'black', 2)); +$graph->Add(new Plot\PlotLine( + Graph\Configs::getConfig('HORIZONTAL'), + 0, + 'black', + 2 +)); //$graph->title->Set("Test of bar gradient fill"); $graph->xaxis->title->Set('X-title'); $graph->yaxis->title->Set('Y-title'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$graph->xaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$graph->yaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); +$graph->xaxis->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 11 +); $graph->Stroke(); diff --git a/Examples/examples_stock/no_test_boxstockex1.php b/Examples/examples_stock/example_boxstockex1.php similarity index 85% rename from Examples/examples_stock/no_test_boxstockex1.php rename to Examples/examples_stock/example_boxstockex1.php index 9b269c69..e6b05683 100644 --- a/Examples/examples_stock/no_test_boxstockex1.php +++ b/Examples/examples_stock/example_boxstockex1.php @@ -1,15 +1,15 @@ SetScale('textlin'); $graph->SetMarginColor('lightblue'); $example_title = 'Box Stock chart example'; diff --git a/Examples/examples_stock/no_test_boxstockex2.php b/Examples/examples_stock/example_boxstockex2.php similarity index 87% rename from Examples/examples_stock/no_test_boxstockex2.php rename to Examples/examples_stock/example_boxstockex2.php index e6da661d..701f429b 100644 --- a/Examples/examples_stock/no_test_boxstockex2.php +++ b/Examples/examples_stock/example_boxstockex2.php @@ -1,15 +1,14 @@ SetScale('textlin'); $graph->SetMarginColor('lightblue'); $example_title = 'Box Stock chart example'; diff --git a/Examples/examples_stock/no_test_stockex1.php b/Examples/examples_stock/example_stockex1.php similarity index 84% rename from Examples/examples_stock/no_test_stockex1.php rename to Examples/examples_stock/example_stockex1.php index 4ced2d83..ed858d52 100644 --- a/Examples/examples_stock/no_test_stockex1.php +++ b/Examples/examples_stock/example_stockex1.php @@ -1,15 +1,14 @@ SetScale('textlin'); $graph->SetMarginColor('lightblue'); $example_title = 'Stockchart example'; diff --git a/Examples/examples_stock/no_test_stockex2.php b/Examples/examples_stock/example_stockex2.php similarity index 71% rename from Examples/examples_stock/no_test_stockex2.php rename to Examples/examples_stock/example_stockex2.php index 43151bca..5688032f 100644 --- a/Examples/examples_stock/no_test_stockex2.php +++ b/Examples/examples_stock/example_stockex2.php @@ -1,26 +1,28 @@ SetScale('textlin'); $graph->SetMarginColor('white'); $graph->SetFrame(false); @@ -28,11 +30,15 @@ $graph->SetBox(); $graph->tabtitle->Set(' Week 34 '); -$graph->tabtitle->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->tabtitle->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // Get week days in curent locale $days = $graph->gDateLocale->GetShortDay(); -array_shift($days); // Start on monday +\array_shift($days); // Start on monday $graph->xaxis->SetTickLabels($days); // Create stock plot diff --git a/Examples/examples_sunspot/no_test_sunspotsex1.php b/Examples/examples_sunspot/example_sunspotsex1.php similarity index 55% rename from Examples/examples_sunspot/no_test_sunspotsex1.php rename to Examples/examples_sunspot/example_sunspotsex1.php index 19cba8d8..a2c57c7e 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex1.php +++ b/Examples/examples_sunspot/example_sunspotsex1.php @@ -1,34 +1,20 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; +use Amenadiel\JpGraph\Util\JpGraphException; +require_once __DIR__.'/read_sunspot_data.php'; +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/no_test_sunspotsex2.php b/Examples/examples_sunspot/example_sunspotsex2.php similarity index 57% rename from Examples/examples_sunspot/no_test_sunspotsex2.php rename to Examples/examples_sunspot/example_sunspotsex2.php index 8b1ecdfa..e20bd27d 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex2.php +++ b/Examples/examples_sunspot/example_sunspotsex2.php @@ -1,34 +1,22 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; + +require_once __DIR__.'/read_sunspot_data.php'; + +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/no_test_sunspotsex3.php b/Examples/examples_sunspot/example_sunspotsex3.php similarity index 58% rename from Examples/examples_sunspot/no_test_sunspotsex3.php rename to Examples/examples_sunspot/example_sunspotsex3.php index 6023288c..9aadb127 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex3.php +++ b/Examples/examples_sunspot/example_sunspotsex3.php @@ -1,34 +1,21 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; + +require_once __DIR__.'/read_sunspot_data.php'; +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/no_test_sunspotsex4.php b/Examples/examples_sunspot/example_sunspotsex4.php similarity index 55% rename from Examples/examples_sunspot/no_test_sunspotsex4.php rename to Examples/examples_sunspot/example_sunspotsex4.php index 311c1b84..919abfc8 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex4.php +++ b/Examples/examples_sunspot/example_sunspotsex4.php @@ -1,34 +1,22 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; + +require_once __DIR__.'/read_sunspot_data.php'; + +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance @@ -37,7 +25,7 @@ function readsunspotdata($aFile, &$aYears, &$aSunspots) // Specify what scale we want to use, // int = integer scale for the X-axis // int = integer scale for the Y-axis -$graph->SetScale('intint', 0, 0, 0, max($year) - min($year) + 1); +$graph->SetScale('intint', 0, 0, 0, \max($year) - \min($year) + 1); // Setup a title for the graph$example_title='Sunspot example'; $graph->title->set($example_title); diff --git a/Examples/examples_sunspot/no_test_sunspotsex5.php b/Examples/examples_sunspot/example_sunspotsex5.php similarity index 60% rename from Examples/examples_sunspot/no_test_sunspotsex5.php rename to Examples/examples_sunspot/example_sunspotsex5.php index d5244078..ce31cab7 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex5.php +++ b/Examples/examples_sunspot/example_sunspotsex5.php @@ -1,31 +1,19 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} +require_once __DIR__.'/read_sunspot_data.php'; -$year = []; +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); function year_callback($aLabel) { @@ -33,7 +21,7 @@ function year_callback($aLabel) } // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/no_test_sunspotsex6.php b/Examples/examples_sunspot/example_sunspotsex6.php similarity index 55% rename from Examples/examples_sunspot/no_test_sunspotsex6.php rename to Examples/examples_sunspot/example_sunspotsex6.php index 56266123..8d7e9744 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex6.php +++ b/Examples/examples_sunspot/example_sunspotsex6.php @@ -1,34 +1,21 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; +require_once __DIR__.'/read_sunspot_data.php'; + +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/no_test_sunspotsex7.php b/Examples/examples_sunspot/example_sunspotsex7.php similarity index 55% rename from Examples/examples_sunspot/no_test_sunspotsex7.php rename to Examples/examples_sunspot/example_sunspotsex7.php index 586c3848..adf02fdb 100644 --- a/Examples/examples_sunspot/no_test_sunspotsex7.php +++ b/Examples/examples_sunspot/example_sunspotsex7.php @@ -1,38 +1,25 @@ $datarow) { - $split = preg_split('/[\s]+/', $datarow); - $aYears[] = substr(trim($split[0]), 0, 4); - $aSunspots[] = trim($split[1]); - } -} - -$year = []; +require_once __DIR__.'/read_sunspot_data.php'; + +$year = []; $ydata = []; -readsunspotdata('yearssn.txt', $year, $ydata); +readsunspotdata(__DIR__.'/yearssn.txt', $year, $ydata); // Just keep the last 20 values in the arrays -$year = array_slice($year, -20); -$ydata = array_slice($ydata, -20); +$year = \array_slice($year, -20); +$ydata = \array_slice($ydata, -20); // Width and height of the graph -$width = 600; +$width = 600; $height = 200; // Create a graph instance diff --git a/Examples/examples_sunspot/read_sunspot_data.php b/Examples/examples_sunspot/read_sunspot_data.php new file mode 100644 index 00000000..9f910090 --- /dev/null +++ b/Examples/examples_sunspot/read_sunspot_data.php @@ -0,0 +1,23 @@ + $datarow) { + $split = \preg_split('/[\s]+/', $datarow); + $aYears[] = \mb_substr(\trim($split[0]), 0, 4); + $aSunspots[] = \trim($split[1]); + } +} \ No newline at end of file diff --git a/Examples/yearssn.txt b/Examples/examples_sunspot/yearssn.txt similarity index 100% rename from Examples/yearssn.txt rename to Examples/examples_sunspot/yearssn.txt diff --git a/Examples/examples_tables/no_test_table_howto1.php b/Examples/examples_tables/example_table_howto1.php similarity index 54% rename from Examples/examples_tables/no_test_table_howto1.php rename to Examples/examples_tables/example_table_howto1.php index d2ecbc78..5ee6900e 100644 --- a/Examples/examples_tables/no_test_table_howto1.php +++ b/Examples/examples_tables/example_table_howto1.php @@ -1,20 +1,23 @@ Set($data); diff --git a/Examples/examples_tables/no_test_table_howto2.php b/Examples/examples_tables/example_table_howto2.php similarity index 62% rename from Examples/examples_tables/no_test_table_howto2.php rename to Examples/examples_tables/example_table_howto2.php index 97ad8862..7f832aef 100644 --- a/Examples/examples_tables/no_test_table_howto2.php +++ b/Examples/examples_tables/example_table_howto2.php @@ -1,20 +1,22 @@ Set($data); diff --git a/Examples/examples_tables/no_test_table_howto3.php b/Examples/examples_tables/example_table_howto3.php similarity index 57% rename from Examples/examples_tables/no_test_table_howto3.php rename to Examples/examples_tables/example_table_howto3.php index 59fcf4e3..a0402c3e 100644 --- a/Examples/examples_tables/no_test_table_howto3.php +++ b/Examples/examples_tables/example_table_howto3.php @@ -1,20 +1,22 @@ Set($data); diff --git a/Examples/examples_tables/no_test_table_howto4.php b/Examples/examples_tables/example_table_howto4.php similarity index 63% rename from Examples/examples_tables/no_test_table_howto4.php rename to Examples/examples_tables/example_table_howto4.php index 657f9e67..e1def90f 100644 --- a/Examples/examples_tables/no_test_table_howto4.php +++ b/Examples/examples_tables/example_table_howto4.php @@ -1,20 +1,22 @@ Set($data); diff --git a/Examples/examples_tables/no_test_table_howto5.php b/Examples/examples_tables/example_table_howto5.php similarity index 56% rename from Examples/examples_tables/no_test_table_howto5.php rename to Examples/examples_tables/example_table_howto5.php index ac3f74ed..d101f459 100644 --- a/Examples/examples_tables/no_test_table_howto5.php +++ b/Examples/examples_tables/example_table_howto5.php @@ -1,20 +1,22 @@ Set($data); @@ -22,7 +24,7 @@ $table->MergeRow(0); // Adjust font in cell (0,0) -$table->SetCellFont(0, 0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$table->SetCellFont(0, 0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 14); // Set left align for all cells in rectangle (0,0) - (0,3) $table->SetAlign(0, 0, 0, 3, 'Left'); diff --git a/Examples/examples_tables/no_test_table_howto6.php b/Examples/examples_tables/example_table_howto6.php similarity index 58% rename from Examples/examples_tables/no_test_table_howto6.php rename to Examples/examples_tables/example_table_howto6.php index 51c51cdf..dc6b9f6f 100644 --- a/Examples/examples_tables/no_test_table_howto6.php +++ b/Examples/examples_tables/example_table_howto6.php @@ -1,20 +1,22 @@ Set($data); @@ -22,7 +24,7 @@ $table->MergeRow(0); // Setup font and color -$table->SetCellFont(0, 0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); +$table->SetCellFont(0, 0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 14); $table->SetRowFillColor(0, 'orange@0.5'); $table->SetRowColor(0, 'darkred'); diff --git a/Examples/examples_tables/example_table_howto7.1.php b/Examples/examples_tables/example_table_howto7.1.php new file mode 100644 index 00000000..f258504b --- /dev/null +++ b/Examples/examples_tables/example_table_howto7.1.php @@ -0,0 +1,45 @@ +Set($data); + +// Set default font in entire table +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); + +// Setup font and color for row = 2 +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFillColor(2, 'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2, 1, 'black', Configs::getConfig('TGRID_DOUBLE')); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); diff --git a/Examples/examples_tables/example_table_howto7.2.php b/Examples/examples_tables/example_table_howto7.2.php new file mode 100644 index 00000000..ad6d0eeb --- /dev/null +++ b/Examples/examples_tables/example_table_howto7.2.php @@ -0,0 +1,45 @@ +Set($data); + +// Set default font in entire table +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); + +// Setup font and color for row = 2 +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFillColor(2, 'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); diff --git a/Examples/examples_tables/example_table_howto7.php b/Examples/examples_tables/example_table_howto7.php new file mode 100644 index 00000000..ad6d0eeb --- /dev/null +++ b/Examples/examples_tables/example_table_howto7.php @@ -0,0 +1,45 @@ +Set($data); + +// Set default font in entire table +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); + +// Setup font and color for row = 2 +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFillColor(2, 'orange@0.5'); + +// Setup minimum color width +$table->SetMinColWidth(35); + +// Setup grid on row 2 +$table->SetRowGrid(2, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); + +// Add table to the graph +$graph->Add($table); + +// and send it back to the client +$graph->Stroke(); diff --git a/Examples/examples_tables/no_test_table_howto8.php b/Examples/examples_tables/example_table_howto8.php similarity index 56% rename from Examples/examples_tables/no_test_table_howto8.php rename to Examples/examples_tables/example_table_howto8.php index e10cc057..e874d941 100644 --- a/Examples/examples_tables/no_test_table_howto8.php +++ b/Examples/examples_tables/example_table_howto8.php @@ -1,28 +1,35 @@ Set($data); // Setup overall table font -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Setup font and color for row = 2 -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); $table->SetRowFillColor(2, 'orange@0.5'); // Setup minimum color width @@ -38,7 +45,7 @@ $table->setGrid(0, 'black'); // Set specific frid for row = 2 -$table->SetRowGrid(2, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); +$table->SetRowGrid(2, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); // Add the table to the graph $graph->Add($table); diff --git a/Examples/examples_tables/no_test_table_howto9.php b/Examples/examples_tables/example_table_howto9.php similarity index 57% rename from Examples/examples_tables/no_test_table_howto9.php rename to Examples/examples_tables/example_table_howto9.php index 66fc28b5..07aa999d 100644 --- a/Examples/examples_tables/no_test_table_howto9.php +++ b/Examples/examples_tables/example_table_howto9.php @@ -1,28 +1,35 @@ Set($data); // Setup overall table font -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Setup font and color for row = 2 -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); $table->SetRowFillColor(2, 'orange@0.5'); // Setup minimum color width @@ -38,7 +45,7 @@ $table->setGrid(0, 'black'); // Set specific frid for row = 2 -$table->SetRowGrid(2, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); +$table->SetRowGrid(2, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); // Setup overall number format in all cells $table->SetNumberFormat('%0.1f'); diff --git a/Examples/examples_tables/no_test_table_howto7.1.php b/Examples/examples_tables/no_test_table_howto7.1.php deleted file mode 100644 index 46730029..00000000 --- a/Examples/examples_tables/no_test_table_howto7.1.php +++ /dev/null @@ -1,38 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); - -// Setup font and color for row = 2 -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFillColor(2, 'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE')); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); diff --git a/Examples/examples_tables/no_test_table_howto7.2.php b/Examples/examples_tables/no_test_table_howto7.2.php deleted file mode 100644 index 404081ad..00000000 --- a/Examples/examples_tables/no_test_table_howto7.2.php +++ /dev/null @@ -1,38 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); - -// Setup font and color for row = 2 -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFillColor(2, 'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); diff --git a/Examples/examples_tables/no_test_table_howto7.php b/Examples/examples_tables/no_test_table_howto7.php deleted file mode 100644 index 404081ad..00000000 --- a/Examples/examples_tables/no_test_table_howto7.php +++ /dev/null @@ -1,38 +0,0 @@ -Set($data); - -// Set default font in entire table -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); - -// Setup font and color for row = 2 -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFillColor(2, 'orange@0.5'); - -// Setup minimum color width -$table->SetMinColWidth(35); - -// Setup grid on row 2 -$table->SetRowGrid(2, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); - -// Add table to the graph -$graph->Add($table); - -// and send it back to the client -$graph->Stroke(); diff --git a/Examples/examples_tables/no_test_tableex03.php b/Examples/examples_tables/no_test_tableex03.php index 783e2a36..5ac77a64 100644 --- a/Examples/examples_tables/no_test_tableex03.php +++ b/Examples/examples_tables/no_test_tableex03.php @@ -1,12 +1,14 @@ Init(); @@ -29,7 +31,7 @@ // Setup top row with the year title $table->MergeCells(0, 0, 0, 6); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 16); $table->SetRowColor(0, 'navy'); $table->SetRowAlign(0, 'center'); @@ -37,17 +39,17 @@ $table->MergeCells(1, 1, 1, 3); $table->MergeCells(1, 4, 1, 6); $table->SetRowAlign(1, 'center'); -$table->SetRowFont(1, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 10); +$table->SetRowFont(1, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 10); $table->SetRowColor(1, 'navy'); $table->SetRowFillColor(1, 'lightgray'); $table->SetRowGrid(2, '', 0); // Turn off the gridline just under the top row // Setup row and column headers -$table->SetRowFont(2, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetRowFont(2, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 11); $table->SetRowColor(2, 'navy'); $table->SetRowFillColor(2, 'lightgray'); -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 11); $table->SetColColor(0, 'navy'); $table->SetColFillColor(0, 'lightgray'); diff --git a/Examples/examples_tables/no_test_table_flagex1.php b/Examples/examples_tables/table_flagex1.php similarity index 59% rename from Examples/examples_tables/no_test_table_flagex1.php rename to Examples/examples_tables/table_flagex1.php index 900d051f..0d071d5e 100644 --- a/Examples/examples_tables/no_test_table_flagex1.php +++ b/Examples/examples_tables/table_flagex1.php @@ -1,19 +1,22 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_TIMES'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Adjust the font for row 0 and 6 -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFont(6, Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_BOLD'), 12); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(6, Configs::getConfig('FF_TIMES'), Configs::getConfig('FS_BOLD'), 12); // Set the minimum heigth/width $table->SetMinRowHeight(2, 10); @@ -42,11 +50,11 @@ // Add some padding (in pixels) $table->SetRowPadding(2, 0); -$table->SetRowGrid(6, 1, 'darkgray', Graph\Configs::getConfig('TGRID_DOUBLE2')); +$table->SetRowGrid(6, 1, 'darkgray', Configs::getConfig('TGRID_DOUBLE2')); // Setup the grid $table->SetGrid(0); -$table->SetRowGrid(6, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); +$table->SetRowGrid(6, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); // Merge all cells in row 0 $table->MergeRow(0); @@ -61,10 +69,11 @@ $table->SetColFillColor(0, 'lightgray@0.5'); // Add the country flags in row 1 -$n = count($countries); +$n = \count($countries); + for ($i = 0; $i < $n; ++$i) { $table->SetCellCountryFlag(1, $i + 1, $countries[$i], 0.5); - $table->SetCellImageConstrain(1, $i + 1, Graph\Configs::getConfig('TIMG_HEIGHT'), 20); + $table->SetCellImageConstrain(1, $i + 1, Configs::getConfig('TIMG_HEIGHT'), 20); } // Add the table to the graph diff --git a/Examples/examples_tables/no_test_table_mex0.php b/Examples/examples_tables/table_mex0.php similarity index 60% rename from Examples/examples_tables/no_test_table_mex0.php rename to Examples/examples_tables/table_mex0.php index cc4c69b1..b0d163a8 100644 --- a/Examples/examples_tables/no_test_table_mex0.php +++ b/Examples/examples_tables/table_mex0.php @@ -1,17 +1,20 @@ Set($data); // Setup fonts -$table->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); -$table->SetRowFont(4, Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_BOLD'), 14); +$table->SetFont( + Configs::getConfig('FF_TIMES'), + Configs::getConfig('FS_NORMAL'), + 11 +); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 11); +$table->SetRowFont(4, Configs::getConfig('FF_TIMES'), Configs::getConfig('FS_BOLD'), 14); // Turn off the grid $table->SetGrid(0); diff --git a/Examples/examples_tables/no_test_table_mex00.php b/Examples/examples_tables/table_mex00.php similarity index 64% rename from Examples/examples_tables/no_test_table_mex00.php rename to Examples/examples_tables/table_mex00.php index 543dee4a..24c89abc 100644 --- a/Examples/examples_tables/no_test_table_mex00.php +++ b/Examples/examples_tables/table_mex00.php @@ -1,17 +1,20 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_TIMES'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Set default table alignment $table->SetAlign('right'); diff --git a/Examples/examples_tables/no_test_table_mex1.php b/Examples/examples_tables/table_mex1.php similarity index 55% rename from Examples/examples_tables/no_test_table_mex1.php rename to Examples/examples_tables/table_mex1.php index 44316267..2ee4731e 100644 --- a/Examples/examples_tables/no_test_table_mex1.php +++ b/Examples/examples_tables/table_mex1.php @@ -1,17 +1,20 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Setup default column width $table->SetMinColWidth(40); @@ -40,17 +47,17 @@ $table->setGrid(0); // Setup font for row 4 and 0 -$table->SetRowFont(4, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(4, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); // Setup color $table->SetRowFillColor(4, 'orange@0.5'); $table->SetFillColor(0, 1, 0, 6, 'teal@0.8'); // Setup grids -$table->SetRowGrid(4, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE2')); -$table->SetColGrid(1, 1, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); -$table->SetRowGrid(1, 1, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(4, 1, 'black', Configs::getConfig('TGRID_DOUBLE2')); +$table->SetColGrid(1, 1, 'black', Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(1, 1, 'black', Configs::getConfig('TGRID_SINGLE')); // Add table to the graph $graph->Add($table); diff --git a/Examples/examples_tables/no_test_table_mex2.php b/Examples/examples_tables/table_mex2.php similarity index 57% rename from Examples/examples_tables/no_test_table_mex2.php rename to Examples/examples_tables/table_mex2.php index 35840e8b..38ada231 100644 --- a/Examples/examples_tables/no_test_table_mex2.php +++ b/Examples/examples_tables/table_mex2.php @@ -1,17 +1,20 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Set default minimum color width $table->SetMinColWidth(40); @@ -40,13 +47,13 @@ $table->setGrid(0); // Setup font -$table->SetRowFont(4, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(4, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); // Setup various grid lines -$table->SetRowGrid(4, 2, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); -$table->SetColGrid(1, 3, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); -$table->SetRowGrid(1, 1, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(4, 2, 'black', Configs::getConfig('TGRID_SINGLE')); +$table->SetColGrid(1, 3, 'black', Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(1, 1, 'black', Configs::getConfig('TGRID_SINGLE')); // Setup various colors $table->SetFillColor(0, 1, 0, 6, 'black'); diff --git a/Examples/examples_tables/no_test_table_mex3.php b/Examples/examples_tables/table_mex3.php similarity index 55% rename from Examples/examples_tables/no_test_table_mex3.php rename to Examples/examples_tables/table_mex3.php index 73893c70..89315e7d 100644 --- a/Examples/examples_tables/no_test_table_mex3.php +++ b/Examples/examples_tables/table_mex3.php @@ -1,17 +1,20 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Set default minimum color width $table->SetMinColWidth(40); @@ -40,14 +47,14 @@ $table->SetBorder(2); // Setup font -$table->SetRowFont(4, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); -$table->SetFont(1, 2, 1, 3, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(4, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); +$table->SetFont(1, 2, 1, 3, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); // Setup grids -$table->SetRowGrid(4, 2, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); -$table->SetColGrid(1, 1, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); -$table->SetRowGrid(1, 1, 'black', Graph\Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(4, 2, 'black', Configs::getConfig('TGRID_SINGLE')); +$table->SetColGrid(1, 1, 'black', Configs::getConfig('TGRID_SINGLE')); +$table->SetRowGrid(1, 1, 'black', Configs::getConfig('TGRID_SINGLE')); // Setup colors $table->SetFillColor(0, 1, 0, 6, 'black'); diff --git a/Examples/examples_tables/no_test_table_vtext.php b/Examples/examples_tables/table_vtext.php similarity index 66% rename from Examples/examples_tables/no_test_table_vtext.php rename to Examples/examples_tables/table_vtext.php index fc4401f2..09eb16b1 100644 --- a/Examples/examples_tables/no_test_table_vtext.php +++ b/Examples/examples_tables/table_vtext.php @@ -1,17 +1,20 @@ Set($data); $table->SetAlign('right'); -$table->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 12); -$table->SetCellFont(0, 0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 16); +$table->SetFont( + Configs::getConfig('FF_TIMES'), + Configs::getConfig('FS_NORMAL'), + 12 +); +$table->SetCellFont(0, 0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 16); // Rotate the entire table 90 degrees $table->SetTextOrientation(90); diff --git a/Examples/examples_tables/no_test_table_vtext_ex1.php b/Examples/examples_tables/table_vtext_ex1.php similarity index 65% rename from Examples/examples_tables/no_test_table_vtext_ex1.php rename to Examples/examples_tables/table_vtext_ex1.php index e5895f7a..1ffa2468 100644 --- a/Examples/examples_tables/no_test_table_vtext_ex1.php +++ b/Examples/examples_tables/table_vtext_ex1.php @@ -1,17 +1,20 @@ Set($data); -$table->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); +$table->SetFont( + Configs::getConfig('FF_TIMES'), + Configs::getConfig('FS_NORMAL'), + 11 +); // Default table alignment $table->SetAlign('right'); // Adjust font in (0,0) -$table->SetCellFont(0, 0, Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_BOLD'), 14); +$table->SetCellFont(0, 0, Configs::getConfig('FF_TIMES'), Configs::getConfig('FS_BOLD'), 14); // Rotate all textxs in row 0 $table->SetRowTextOrientation(0, 90); diff --git a/Examples/examples_tables/no_test_tablebarex1.php b/Examples/examples_tables/tablebarex1.php similarity index 61% rename from Examples/examples_tables/no_test_tablebarex1.php rename to Examples/examples_tables/tablebarex1.php index bcd562b8..25c32a48 100644 --- a/Examples/examples_tables/no_test_tablebarex1.php +++ b/Examples/examples_tables/tablebarex1.php @@ -1,31 +1,35 @@ SetMarginColor('white'); // Setup titles and fonts$example_title='Bar and table'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_NORMAL'), 14); +$graph->title->SetFont( + Configs::getConfig('FF_VERDANA'), + Configs::getConfig('FS_NORMAL'), + 14 +); $graph->yaxis->title->Set('Flow'); -$graph->yaxis->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->yaxis->title->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 12 +); $graph->yaxis->title->SetMargin(10); // Create the bars and the accbar plot @@ -56,14 +68,18 @@ $table->SetPos($tablexpos, $tableypos + 1); // Basic table formatting -$table->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$table->SetFont( + Configs::getConfig('FF_ARIAL'), + Configs::getConfig('FS_NORMAL'), + 10 +); $table->SetAlign('right'); $table->SetMinColWidth($cellwidth); $table->SetNumberFormat('%0.1f'); // Format table header row $table->SetRowFillColor(0, 'teal@0.7'); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); $table->SetRowAlign(0, 'center'); // .. and add it to the graph diff --git a/Examples/examples_tables/no_test_tableex00.php b/Examples/examples_tables/tableex00.php similarity index 65% rename from Examples/examples_tables/no_test_tableex00.php rename to Examples/examples_tables/tableex00.php index 65af768f..27f0f0fc 100644 --- a/Examples/examples_tables/no_test_tableex00.php +++ b/Examples/examples_tables/tableex00.php @@ -1,14 +1,16 @@ Init(); $table->Set($data); -$table->SetRowFont(0, Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$table->SetRowFont(0, Configs::getConfig('FF_FONT1'), Configs::getConfig('FS_BOLD')); $table->SetRowColor(0, 'navy'); $table->SetRowFillColor(0, 'lightgray'); -$table->SetColFont(0, Graph\Configs::getConfig('FF_FONT1'), Graph\Configs::getConfig('FS_BOLD')); +$table->SetColFont(0, Configs::getConfig('FF_FONT1'), Configs::getConfig('FS_BOLD')); $table->SetColColor(0, 'navy'); $table->SetColFillColor(0, 'lightgray'); diff --git a/Examples/examples_tables/no_test_tableex02.php b/Examples/examples_tables/tableex02.php similarity index 60% rename from Examples/examples_tables/no_test_tableex02.php rename to Examples/examples_tables/tableex02.php index 0549ad92..94025020 100644 --- a/Examples/examples_tables/no_test_tableex02.php +++ b/Examples/examples_tables/tableex02.php @@ -1,34 +1,35 @@ Init(); $table->Set($data); // Setup row and column headers -$table->SetRowFont(0, Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetRowFont(0, Configs::getConfig('FF_TIMES'), Configs::getConfig('FS_BOLD'), 11); $table->SetRowAlign(0, 'left', 'bottom'); $table->SetRowColor(0, 'navy'); $table->SetRowFillColor(0, 'lightgray'); -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 11); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_BOLD'), 11); $table->SetColColor(0, 'navy'); $table->SetColFillColor(0, 'lightgray'); diff --git a/Examples/examples_tables/no_test_tableex04.php b/Examples/examples_tables/tableex04.php similarity index 57% rename from Examples/examples_tables/no_test_tableex04.php rename to Examples/examples_tables/tableex04.php index 8a88347f..27061f62 100644 --- a/Examples/examples_tables/no_test_tableex04.php +++ b/Examples/examples_tables/tableex04.php @@ -1,12 +1,14 @@ $j; ++$j) { $tmp += $data[$j][$i]; } - $data[3][$i] = sprintf('%2.1f', $tmp); + $data[3][$i] = \sprintf('%2.1f', $tmp); } -$__width = 350; +$__width = 350; $__height = 200; -$graph = new CanvasGraph($__width, $__height); +$graph = new CanvasGraph($__width, $__height); $table = new GTextTable(); $table->Init(); @@ -39,15 +42,15 @@ $table->SetCellAlign($r - 1, 0, 'right'); // Setup row and column headers -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 10); $table->SetRowColor(0, 'navy'); $table->SetRowFillColor(0, 'lightgray'); -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 10); $table->SetColColor(0, 'navy'); $table->SetColFillColor(0, 'lightgray'); -$table->SetRowGrid($r - 1, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE')); +$table->SetRowGrid($r - 1, 1, 'black', Configs::getConfig('TGRID_DOUBLE')); $graph->Add($table); $graph->Stroke(); diff --git a/Examples/examples_tables/no_test_tableex05.php b/Examples/examples_tables/tableex05.php similarity index 55% rename from Examples/examples_tables/no_test_tableex05.php rename to Examples/examples_tables/tableex05.php index 18dc841b..93b94013 100644 --- a/Examples/examples_tables/no_test_tableex05.php +++ b/Examples/examples_tables/tableex05.php @@ -1,12 +1,14 @@ $j; ++$j) { $tmp += $data[$j][$i]; } - $data[3][$i] = sprintf('%2.1f', $tmp); + $data[3][$i] = \sprintf('%2.1f', $tmp); } -$__width = 350; +$__width = 350; $__height = 200; -$graph = new CanvasGraph($__width, $__height); +$graph = new CanvasGraph($__width, $__height); $table = new GTextTable(); $table->Init(); @@ -39,17 +42,17 @@ $table->SetCellAlign($r - 1, 0, 'right'); // Setup row and column headers -$table->SetRowFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$table->SetRowFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 10); $table->SetRowColor(0, 'navy'); $table->SetRowFillColor(0, 'lightgray'); -$table->SetColFont(0, Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$table->SetColFont(0, Configs::getConfig('FF_ARIAL'), Configs::getConfig('FS_NORMAL'), 10); $table->SetColColor(0, 'navy'); $table->SetColFillColor(0, 'lightgray'); -$table->SetRowGrid($r - 1, 1, 'black', Graph\Configs::getConfig('TGRID_DOUBLE')); +$table->SetRowGrid($r - 1, 1, 'black', Configs::getConfig('TGRID_DOUBLE')); -$table->SetFont(1, 4, 2, 6, Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 18); +$table->SetFont(1, 4, 2, 6, Configs::getConfig('FF_TIMES'), Configs::getConfig('FS_NORMAL'), 18); $table->SetFillColor(1, 1, 2, 3, 'red'); $table->MergeCol(1); diff --git a/Examples/examples_theme/aqua_example.php b/Examples/examples_theme/aqua_example.php index 1a8ddd16..86a080a8 100644 --- a/Examples/examples_theme/aqua_example.php +++ b/Examples/examples_theme/aqua_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -25,11 +25,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -38,7 +39,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -47,7 +48,7 @@ $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -56,8 +57,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'AquaTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'AquaTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/broken_no_test_fusion_example.php b/Examples/examples_theme/broken_no_test_fusion_example.php index a4902589..953ac8e9 100644 --- a/Examples/examples_theme/broken_no_test_fusion_example.php +++ b/Examples/examples_theme/broken_no_test_fusion_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], 1 => [0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94], 2 => [0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7], @@ -23,11 +23,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -36,7 +37,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -44,7 +45,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -53,8 +54,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'FusionTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'FusionTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/green_example.php b/Examples/examples_theme/green_example.php index 16d00b37..5b6ddcf8 100644 --- a/Examples/examples_theme/green_example.php +++ b/Examples/examples_theme/green_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'GreenTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'GreenTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/ocean_example.php b/Examples/examples_theme/ocean_example.php index c300f154..3657e4a9 100644 --- a/Examples/examples_theme/ocean_example.php +++ b/Examples/examples_theme/ocean_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'OceanTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'OceanTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/orange_example.php b/Examples/examples_theme/orange_example.php index b9429be3..d92f68a2 100644 --- a/Examples/examples_theme/orange_example.php +++ b/Examples/examples_theme/orange_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'OrangeTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'OrangeTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/pastel_example.php b/Examples/examples_theme/pastel_example.php index 7c7f6174..8eda4a27 100644 --- a/Examples/examples_theme/pastel_example.php +++ b/Examples/examples_theme/pastel_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], 1 => [0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94], 2 => [0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7], @@ -23,11 +23,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -36,7 +37,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -44,7 +45,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -53,8 +54,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'PastelTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'PastelTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/rose_example.php b/Examples/examples_theme/rose_example.php index 53267885..9c77c89f 100644 --- a/Examples/examples_theme/rose_example.php +++ b/Examples/examples_theme/rose_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'RoseTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'RoseTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/softy_example.php b/Examples/examples_theme/softy_example.php index 9566d359..5ce92c29 100644 --- a/Examples/examples_theme/softy_example.php +++ b/Examples/examples_theme/softy_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'SoftyTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'SoftyTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/theme_example.php b/Examples/examples_theme/theme_example.php index 2a907ede..88045805 100644 --- a/Examples/examples_theme/theme_example.php +++ b/Examples/examples_theme/theme_example.php @@ -1,7 +1,7 @@ SetScale('textlin'); $theme_class = new Themes\AquaTheme(); diff --git a/Examples/examples_theme/universal_example.php b/Examples/examples_theme/universal_example.php index 012a0d07..aa7830a4 100644 --- a/Examples/examples_theme/universal_example.php +++ b/Examples/examples_theme/universal_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'UniversalTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'UniversalTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_theme/vivid_example.php b/Examples/examples_theme/vivid_example.php index 1180f763..3afb74b9 100644 --- a/Examples/examples_theme/vivid_example.php +++ b/Examples/examples_theme/vivid_example.php @@ -1,7 +1,7 @@ [0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32], @@ -24,11 +24,12 @@ ]; // Create the graph. These two calls are always required -$__width = 400; +$__width = 400; $__height = 300; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); $graph->SetScale('textlin'); + if ($theme) { $graph->SetTheme(new $theme()); } @@ -37,7 +38,7 @@ $plot = []; // Create the bar plots -for ($i = 0; $i < 4; ++$i) { +for ($i = 0; 4 > $i; ++$i) { $plot[$i] = new Plot\BarPlot($data[$i]); $plot[$i]->SetLegend('plot' . ($i + 1)); } @@ -45,7 +46,7 @@ //$acc1->value->Show(); $gbplot = new Plot\GroupBarPlot([$plot[2], $plot[1]]); -for ($i = 4; $i < 8; ++$i) { +for ($i = 4; 8 > $i; ++$i) { $plot[$i] = new Plot\LinePlot($data[$i]); $plot[$i]->SetLegend('plot' . $i); $plot[$i]->value->Show(); @@ -54,8 +55,8 @@ $graph->Add($gbplot); $graph->Add($plot[4]); -$title = 'VividTheme Example'; -$title = mb_convert_encoding($title, 'UTF-8'); +$title = 'VividTheme Example'; +$title = \mb_convert_encoding($title, 'UTF-8'); $example_title = $title; $graph->title->set($example_title); $graph->xaxis->title->Set('X-title'); diff --git a/Examples/examples_tick/manualtickex2.php b/Examples/examples_tick/manualtickex2.php index e9ebbb12..18a97761 100644 --- a/Examples/examples_tick/manualtickex2.php +++ b/Examples/examples_tick/manualtickex2.php @@ -1,7 +1,7 @@ E(0, 10); +$f = new Util\FuncGenerator('cos($x)+1.5*cos(2*$x)'); +[$datax, $datay] = $f->E(0, 10); // Now get labels at 1/2 PI intervall -$tickPositions = []; -$tickLabels = []; +$tickPositions = []; +$tickLabels = []; $tickPositions[0] = 0; -$tickLabels[0] = '0'; -for ($i = 1; $i / 2 * M_PI < 11; ++$i) { - $tickPositions[$i] = $i / 2 * M_PI; +$tickLabels[0] = '0'; + +for ($i = 1; $i / 2 * \M_PI < 11; ++$i) { + $tickPositions[$i] = $i / 2 * \M_PI; + if ($i % 2) { $tickLabels[$i] = $i . '/2' . Graph\SymChar::Get('pi'); } else { @@ -34,16 +37,16 @@ } } -$n = count($datax); +$n = \count($datax); $xmin = $datax[0]; $xmax = $datax[$n - 1]; // // The code to setup a very basic graph // -$__width = 400; +$__width = 400; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); // // We use an integer scale on the X-axis since the positions on the X axis @@ -51,7 +54,11 @@ $graph->SetScale('linlin', 0, 0, $xmin, $xmax); $example_title = 'Example with manual tick labels'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // // Make sure that the X-axis is always at the bottom of the scale @@ -63,8 +70,16 @@ $graph->xaxis->SetMajTickPositions($tickPositions, $tickLabels); // Use Times font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 10); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 10); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 10 +); // Add a X-grid $graph->xgrid->Show(); diff --git a/Examples/examples_tick/manualtickex3.php b/Examples/examples_tick/manualtickex3.php index 6c814da4..a7588a6b 100644 --- a/Examples/examples_tick/manualtickex3.php +++ b/Examples/examples_tick/manualtickex3.php @@ -1,7 +1,7 @@ E(0, 10); +$f = new Util\FuncGenerator('cos($x)+1.5*cos(2*$x)'); +[$datax, $datay] = $f->E(0, 10); // Now get labels at 1/2 PI intervall -$tickPositions = []; -$tickLabels = []; +$tickPositions = []; +$tickLabels = []; $tickPositions[0] = 0; -$tickLabels[0] = '0'; -for ($i = 1; $i / 2 * M_PI < 11; ++$i) { - $tickPositions[$i] = $i / 2 * M_PI; +$tickLabels[0] = '0'; + +for ($i = 1; $i / 2 * \M_PI < 11; ++$i) { + $tickPositions[$i] = $i / 2 * \M_PI; + if ($i % 2) { $tickLabels[$i] = $i . '/2' . Graph\SymChar::Get('pi'); } else { @@ -34,23 +37,27 @@ } } -$n = count($datax); +$n = \count($datax); $xmin = $datax[0]; $xmax = $datax[$n - 1]; // // The code to setup a very basic graph // -$__width = 400; +$__width = 400; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); // We use an integer scale on the X-axis since the positions on the X axis // are assumed to be UNI timestamps $graph->SetScale('linlin', 0, 0, $xmin, $xmax); $example_title = 'Example with manual tick labels'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('white'); // Setup a abackground gradient @@ -66,8 +73,16 @@ $graph->xaxis->SetMajTickPositions($tickPositions, $tickLabels); // Use Times font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); // Set colors for axis $graph->xaxis->SetColor('lightgray'); @@ -77,9 +92,13 @@ $graph->xgrid->Show(); // Show ticks outwards -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); $graph->xaxis->SetLabelMargin(8); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Setup a filled y-grid //$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); diff --git a/Examples/examples_tick/manualtickex4.php b/Examples/examples_tick/manualtickex4.php index 6ab392cc..a592d55e 100644 --- a/Examples/examples_tick/manualtickex4.php +++ b/Examples/examples_tick/manualtickex4.php @@ -1,7 +1,7 @@ E(0, 10); +$f = new Util\FuncGenerator('cos($x)+1.5*cos(2*$x)'); +[$datax, $datay] = $f->E(0, 10); // Now get labels at 1/2 PI intervall -$tickPositions = []; -$tickLabels = []; +$tickPositions = []; +$tickLabels = []; $tickPositions[0] = 0; -$tickLabels[0] = '0'; -for ($i = 1; $i / 2 * M_PI < 11; ++$i) { - $tickPositions[$i] = $i / 2 * M_PI; +$tickLabels[0] = '0'; + +for ($i = 1; $i / 2 * \M_PI < 11; ++$i) { + $tickPositions[$i] = $i / 2 * \M_PI; + if ($i % 2) { $tickLabels[$i] = $i . '/2' . Graph\SymChar::Get('pi'); } else { @@ -34,23 +37,27 @@ } } -$n = count($datax); +$n = \count($datax); $xmin = $datax[0]; $xmax = $datax[$n - 1]; // // The code to setup a very basic graph // -$__width = 400; +$__width = 400; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); // We use an integer scale on the X-axis since the positions on the X axis // are assumed to be UNI timestamps $graph->SetScale('linlin', 0, 0, $xmin, $xmax); $example_title = 'Example with manual tick labels'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_BOLD'), + 12 +); $graph->title->SetColor('white'); // Setup a abackground gradient @@ -66,8 +73,16 @@ $graph->xaxis->SetMajTickPositions($tickPositions, $tickLabels); // Use Times font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 11); -$graph->yaxis->SetFont(Graph\Configs::getConfig('FF_TIMES'), Graph\Configs::getConfig('FS_NORMAL'), 9); +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 11 +); +$graph->yaxis->SetFont( + Graph\Configs::getConfig('FF_TIMES'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); // Set colors for axis $graph->xaxis->SetColor('lightgray'); @@ -77,9 +92,13 @@ $graph->xgrid->Show(); // Show ticks outwards -$graph->xaxis->SetTickSide(Graph\Configs::getConfig('SIDE_DOWN')); +$graph->xaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_DOWN') +); $graph->xaxis->SetLabelMargin(8); -$graph->yaxis->SetTickSide(Graph\Configs::getConfig('SIDE_LEFT')); +$graph->yaxis->SetTickSide( + Graph\Configs::getConfig('SIDE_LEFT') +); // Setup a filled y-grid //$graph->ygrid->SetFill(true,'darkgray:1.55@0.7','darkgray:1.6@0.7'); diff --git a/Examples/examples_tick/no_test_manualtickex1.php b/Examples/examples_tick/no_test_manualtickex1.php index 79ef23ab..d16687be 100644 --- a/Examples/examples_tick/no_test_manualtickex1.php +++ b/Examples/examples_tick/no_test_manualtickex1.php @@ -1,7 +1,7 @@ GetTicks($datax); +$dateUtils = new DateScaleUtils(); +[$tickPositions, $minTickPositions] = $dateUtils->GetTicks($datax); // We add some grace to the end of the X-axis scale so that the first and last // data point isn't exactly at the very end or beginning of the scale $grace = 400000; -$xmin = $datax[0] - $grace; -$xmax = $datax[$n - 1] + $grace; +$xmin = $datax[0] - $grace; +$xmax = $datax[$n - 1] + $grace; // // The code to setup a very basic graph // -$__width = 400; +$__width = 400; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); // // We use an integer scale on the X-axis since the positions on the X axis @@ -48,7 +50,11 @@ $graph->SetScale('intlin', 0, 0, $xmin, $xmax); $example_title = 'Basic example with manual ticks'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // // Make sure that the X-axis is always at the bottom of the scale @@ -62,8 +68,12 @@ // The labels should be formatted at dates with "Year-month" $graph->xaxis->SetLabelFormatString('My', true); -// Use Ariel font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +// Use Arial font +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); // Add a X-grid $graph->xgrid->Show(); diff --git a/Examples/examples_tick/no_test_manualtickex1a.php b/Examples/examples_tick/no_test_manualtickex1a.php index 79ef23ab..d16687be 100644 --- a/Examples/examples_tick/no_test_manualtickex1a.php +++ b/Examples/examples_tick/no_test_manualtickex1a.php @@ -1,7 +1,7 @@ GetTicks($datax); +$dateUtils = new DateScaleUtils(); +[$tickPositions, $minTickPositions] = $dateUtils->GetTicks($datax); // We add some grace to the end of the X-axis scale so that the first and last // data point isn't exactly at the very end or beginning of the scale $grace = 400000; -$xmin = $datax[0] - $grace; -$xmax = $datax[$n - 1] + $grace; +$xmin = $datax[0] - $grace; +$xmax = $datax[$n - 1] + $grace; // // The code to setup a very basic graph // -$__width = 400; +$__width = 400; $__height = 200; -$graph = new Graph\Graph($__width, $__height); +$graph = new Graph\Graph($__width, $__height); // // We use an integer scale on the X-axis since the positions on the X axis @@ -48,7 +50,11 @@ $graph->SetScale('intlin', 0, 0, $xmin, $xmax); $example_title = 'Basic example with manual ticks'; $graph->title->set($example_title); -$graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 12); +$graph->title->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 12 +); // // Make sure that the X-axis is always at the bottom of the scale @@ -62,8 +68,12 @@ // The labels should be formatted at dates with "Year-month" $graph->xaxis->SetLabelFormatString('My', true); -// Use Ariel font -$graph->xaxis->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_NORMAL'), 9); +// Use Arial font +$graph->xaxis->SetFont( + Graph\Configs::getConfig('FF_ARIAL'), + Graph\Configs::getConfig('FS_NORMAL'), + 9 +); // Add a X-grid $graph->xgrid->Show(); diff --git a/Examples/examples_windrose/windrose_2plots_ex1.php b/Examples/examples_windrose/windrose_2plots_ex1.php index fc673bd2..43d4a088 100644 --- a/Examples/examples_windrose/windrose_2plots_ex1.php +++ b/Examples/examples_windrose/windrose_2plots_ex1.php @@ -1,7 +1,7 @@ SetShadow(); $example_title = 'Two windrose plots in one graph'; $graph->title->set($example_title); diff --git a/Examples/examples_windrose/windrose_bgimg_ex1.php b/Examples/examples_windrose/windrose_bgimg_ex1.php index 6483df6e..a65ee3a8 100644 --- a/Examples/examples_windrose/windrose_bgimg_ex1.php +++ b/Examples/examples_windrose/windrose_bgimg_ex1.php @@ -1,7 +1,7 @@ [12, 8, 2, 3], - 6 => [5, 4, 4, 5, 4], + 6 => [5, 4, 4, 5, 4], ]; $se_CompassLbl = ['O', 'ONO', 'NO', 'NNO', 'N', 'NNV', 'NV', 'VNV', 'V', 'VSV', 'SV', 'SSV', 'S', 'SSO', 'SO', 'OSO']; // Create a new small windrose graph -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); $graph->SetMargin(25, 25, 25, 25); $graph->SetFrame(); $example_title = 'Example with background flag'; $graph->title->set($example_title); -#$graph->title->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_BOLD,14); +//$graph->title->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_BOLD,14); //$graph->SetBackgroundImage(__DIR__.'/../assets/bkgimg.jpg',BGIMG_FILLFRAME); //$graph->SetBackgroundImageMix(90); diff --git a/Examples/examples_windrose/windrose_ex0.php b/Examples/examples_windrose/windrose_ex0.php index 3c916aab..1bbbbb06 100644 --- a/Examples/examples_windrose/windrose_ex0.php +++ b/Examples/examples_windrose/windrose_ex0.php @@ -1,7 +1,7 @@ [5, 5, 5, 8], - 1 => [3, 4, 1, 4], + 0 => [5, 5, 5, 8], + 1 => [3, 4, 1, 4], 'WSW' => [1, 5, 5, 3], - 'N' => [2, 3, 8, 1, 1], - 15 => [2, 3, 5], ]; + 'N' => [2, 3, 8, 1, 1], + 15 => [2, 3, 5], ]; // First create a new windrose graph with a title -$__width = 400; -$__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 400; +$__height = 400; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'A basic Windrose graph'; $graph->title->set($example_title); diff --git a/Examples/examples_windrose/windrose_ex1.php b/Examples/examples_windrose/windrose_ex1.php index 49830a46..7a455621 100644 --- a/Examples/examples_windrose/windrose_ex1.php +++ b/Examples/examples_windrose/windrose_ex1.php @@ -1,7 +1,7 @@ [1, 1, 2.5, 4], - 1 => [3, 4, 1, 4], + 0 => [1, 1, 2.5, 4], + 1 => [3, 4, 1, 4], 'wsw' => [1, 5, 5, 3], - 'N' => [2, 7, 5, 4, 2], - 15 => [2, 7, 12], ]; + 'N' => [2, 7, 5, 4, 2], + 15 => [2, 7, 12], ]; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup title $example_title = 'Windrose basic example'; diff --git a/Examples/examples_windrose/windrose_ex1b.php b/Examples/examples_windrose/windrose_ex1b.php index e171a328..5087d436 100644 --- a/Examples/examples_windrose/windrose_ex1b.php +++ b/Examples/examples_windrose/windrose_ex1b.php @@ -1,7 +1,7 @@ [1, 1, 2.5, 4], - 1 => [3, 4, 1, 4], + 0 => [1, 1, 2.5, 4], + 1 => [3, 4, 1, 4], 'wsw' => [1, 5, 5, 3], - 'N' => [2, 7, 5, 4, 2], - 15 => [2, 7, 12], ]; + 'N' => [2, 7, 5, 4, 2], + 15 => [2, 7, 12], ]; // First create a new windrose graph with a title -$__width = 400; -$__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 400; +$__height = 400; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Windrose example 1b'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); diff --git a/Examples/examples_windrose/windrose_ex2.1.php b/Examples/examples_windrose/windrose_ex2.1.php index ecc33c05..50c7f0a2 100644 --- a/Examples/examples_windrose/windrose_ex2.1.php +++ b/Examples/examples_windrose/windrose_ex2.1.php @@ -1,7 +1,7 @@ [2, 7, 1, 2], ]; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup title $example_title = 'Windrose example 2'; @@ -34,7 +34,7 @@ $wp->SetType(Plot\Configs::getConfig('WINDROSE_TYPE4')); // Setup the weight of the laegs for the different ranges -$weights = array_fill(0, 8, 10); +$weights = \array_fill(0, 8, 10); $wp->SetRangeWeights($weights); // Adjust the font and font color for scale labels diff --git a/Examples/examples_windrose/windrose_ex2.php b/Examples/examples_windrose/windrose_ex2.php index 3740de2e..483251d9 100644 --- a/Examples/examples_windrose/windrose_ex2.php +++ b/Examples/examples_windrose/windrose_ex2.php @@ -1,7 +1,7 @@ [2, 7, 1, 2], ]; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup title $example_title = 'Windrose example 2'; @@ -34,7 +34,7 @@ $wp->SetType(Plot\Configs::getConfig('WINDROSE_TYPE8')); // Setup the weight of the laegs for the different ranges -$weights = array_fill(0, 8, 10); +$weights = \array_fill(0, 8, 10); $wp->SetRangeWeights($weights); // Adjust the font and font color for scale labels diff --git a/Examples/examples_windrose/windrose_ex3.php b/Examples/examples_windrose/windrose_ex3.php index 77056672..0a2fe0dc 100644 --- a/Examples/examples_windrose/windrose_ex3.php +++ b/Examples/examples_windrose/windrose_ex3.php @@ -1,7 +1,7 @@ [2, 7, 1, 2], ]; $data[1] = [ - 'n' => [1, 1, 2.5, 4], + 'n' => [1, 1, 2.5, 4], 'ssw' => [3, 4, 1, 4], - 'se' => [2, 7, 4, 4, 3], ]; + 'se' => [2, 7, 4, 4, 3], ]; // Store the position and size data for each plot in an // array to make it easier to create multiple plots. @@ -32,9 +32,9 @@ $legendtxt = ['(m/s) Station 7', '(m/s) Station 12']; // First create a new windrose graph with a dropshadow -$__width = 600; +$__width = 600; $__height = 350; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); $graph->SetShadow('darkgray'); // Setup titles$example_title='Windrose example 3'; $graph->title->set($example_title); @@ -46,7 +46,7 @@ $graph->subtitle->SetColor('navy'); // Create the two windrose plots. -for ($i = 0; $i < count($data); ++$i) { +for ($i = 0; \count($data) > $i; ++$i) { $wp[$i] = new Plot\WindrosePlot($data[$i]); // Make it have 8 compass direction diff --git a/Examples/examples_windrose/windrose_ex4.php b/Examples/examples_windrose/windrose_ex4.php index 6d4e0691..543aca7a 100644 --- a/Examples/examples_windrose/windrose_ex4.php +++ b/Examples/examples_windrose/windrose_ex4.php @@ -1,7 +1,7 @@ [2, 7, 1, 2], ]; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup title $example_title = 'Windrose example 4'; diff --git a/Examples/examples_windrose/windrose_ex6.1.php b/Examples/examples_windrose/windrose_ex6.1.php index d1010845..16ba7157 100644 --- a/Examples/examples_windrose/windrose_ex6.1.php +++ b/Examples/examples_windrose/windrose_ex6.1.php @@ -1,7 +1,7 @@ [1, 1, 2.5, 4], - '32.0' => [3, 4, 1, 4], + '10' => [1, 1, 2.5, 4], + '32.0' => [3, 4, 1, 4], '120.5' => [2, 3, 4, 4, 3, 2, 1], '223.2' => [2, 4, 1, 2, 2], '285.7' => [2, 2, 1, 2, 4, 2, 1, 1], @@ -30,18 +30,18 @@ $rangeColors = ['khaki', 'yellow', 'orange', 'orange:0.7', 'brown', 'darkred', 'black']; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 450; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup title $example_title = 'Using chinese charecters'; $graph->title->set($example_title); -#$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_BOLD,12); +//$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_BOLD,12); $graph->title->SetColor('navy'); $subtitle_text = '(Free type plot)'; $graph->subtitle->Set($subtitle_text); -#$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_ITALIC,10); +//$graph->subtitle->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_ITALIC,10); $graph->subtitle->SetColor('navy'); // Create the windrose plot. @@ -59,10 +59,10 @@ $wp->SetRangeColors($rangeColors); // Adjust the font and font color for scale labels -#$wp->scale->SetFont(Graph\Configs::getConfig('FF_ARIAL'),FS_NORMAL,9); +//$wp->scale->SetFont(Graph\Configs::getConfig('FF_ARIAL'),FS_NORMAL,9); // Set the diameter and position for plot -#$wp->SetSize(240); +//$wp->SetSize(240); $wp->SetSize(200); $wp->SetZCircleSize(30); $wp->SetPos(0.5, 0.5); @@ -80,7 +80,7 @@ // Set legend label font color $wp->legend->SetLFontColor('orange:0.7'); -#$wp->legend->SetLFont(Graph\Configs::getConfig('FF_ARIAL'),FS_ITALIC,8); +//$wp->legend->SetLFont(Graph\Configs::getConfig('FF_ARIAL'),FS_ITALIC,8); // Display legend values with no decimals $wp->legend->SetFormat('%d'); @@ -88,7 +88,7 @@ // Set the circle font to use chinse character set // Note: When Graph\Configs::getConfig('FF_CHINESE') is used the input charectr data are // assumed to already be in utf-8 encoding -#$wp->legend->SetCFont(Graph\Configs::getConfig('FF_CHINESE'),FS_NORMAL,14); +//$wp->legend->SetCFont(Graph\Configs::getConfig('FF_CHINESE'),FS_NORMAL,14); $wp->legend->SetCircleText($ctxt); $wp->legend->SetCFontColor('red'); diff --git a/Examples/examples_windrose/windrose_ex6.php b/Examples/examples_windrose/windrose_ex6.php index d1bd483f..01241ea2 100644 --- a/Examples/examples_windrose/windrose_ex6.php +++ b/Examples/examples_windrose/windrose_ex6.php @@ -1,7 +1,7 @@ [1, 1, 2.5, 4], - '32.0' => [3, 4, 1, 4], + '10' => [1, 1, 2.5, 4], + '32.0' => [3, 4, 1, 4], '120.5' => [2, 3, 4, 4, 3, 2, 1], '223.2' => [2, 4, 1, 2, 2], '285.7' => [2, 2, 1, 2, 4, 2, 1, 1], ]; // Specify text for direction labels -$labels = ['120.5' => "Plant\n#1275", - '285.7' => "Reference\n#13 Ver:2", ]; +$labels = ['120.5' => "Plant\n#1275", + '285.7' => "Reference\n#13 Ver:2", ]; // Range colors to be used $rangeColors = ['khaki', 'yellow', 'orange', 'orange:0.7', 'brown', 'darkred', 'black']; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 450; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Setup titles$example_title='Windrose example 6'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); diff --git a/Examples/examples_windrose/windrose_ex7.1.php b/Examples/examples_windrose/windrose_ex7.1.php index b791d532..085fe6ee 100644 --- a/Examples/examples_windrose/windrose_ex7.1.php +++ b/Examples/examples_windrose/windrose_ex7.1.php @@ -1,7 +1,7 @@ title->set($example_title); -#$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_BOLD,14); +//$graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'),FS_BOLD,14); $graph->title->SetColor('navy'); // Create the free windrose plot. @@ -48,14 +48,14 @@ $jp_CompassLbl = ['東', '', '北東', '', '北', '', '北西', '', '西', '', '南西', '', '南', '', '南東', '', ]; $wp->SetCompassLabels($jp_CompassLbl); -#$wp->SetFont(Graph\Configs::getConfig('FF_MINCHO'),FS_NORMAL,15); +//$wp->SetFont(Graph\Configs::getConfig('FF_MINCHO'),FS_NORMAL,15); // Localize the "Calm" text into Swedish and make the circle // slightly bigger than default $jp_calmtext = '平穏'; $wp->legend->SetCircleText($jp_calmtext); $wp->legend->SetCircleRadius(20); -#$wp->legend->SetCFont(Graph\Configs::getConfig('FF_MINCHO'),FS_NORMAL,10); +//$wp->legend->SetCFont(Graph\Configs::getConfig('FF_MINCHO'),FS_NORMAL,10); $wp->legend->SetMargin(5, 0); $wp->SetPos(0.5, 0.5); @@ -65,7 +65,7 @@ // Set the scale to always have max value of 30 $wp->scale->Set(30, 10); -#$wp->scale->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_NORMAL,12); +//$wp->scale->SetFont(Graph\Configs::getConfig('FF_VERA'),FS_NORMAL,12); // Finally add it to the graph and send back to client $graph->Add($wp); diff --git a/Examples/examples_windrose/windrose_ex7.php b/Examples/examples_windrose/windrose_ex7.php index 64fd4efb..02e36003 100644 --- a/Examples/examples_windrose/windrose_ex7.php +++ b/Examples/examples_windrose/windrose_ex7.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); diff --git a/Examples/examples_windrose/windrose_ex8.1.php b/Examples/examples_windrose/windrose_ex8.1.php index 5d7c3911..d8200c49 100644 --- a/Examples/examples_windrose/windrose_ex8.1.php +++ b/Examples/examples_windrose/windrose_ex8.1.php @@ -1,7 +1,7 @@ [3, 2, 1, 2, 2], - 355 => [1, 1, 1.5, 2], - 180 => [1, 1, 1.5, 2], - 150 => [1, 2, 1, 3], - 'S' => [2, 3, 5, 1], + 355 => [1, 1, 1.5, 2], + 180 => [1, 1, 1.5, 2], + 150 => [1, 2, 1, 3], + 'S' => [2, 3, 5, 1], ]; // Add some labels for afew of the directions $labels = [355 => "At\nHome base", 180 => "Probe\n123", 150 => "Power\nplant"]; // Define the color,weight and style of some individual radial grid lines. -$axiscolors = [355 => 'red']; +$axiscolors = [355 => 'red']; $axisweights = [355 => 8]; -$axisstyles = [355 => 'solid', 150 => 'solid']; +$axisstyles = [355 => 'solid', 150 => 'solid']; // First create a new windrose graph with a title -$__width = 400; -$__height = 460; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 400; +$__height = 460; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Adding label backgrounds'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); diff --git a/Examples/examples_windrose/windrose_ex8.php b/Examples/examples_windrose/windrose_ex8.php index 985bc009..88dd0c01 100644 --- a/Examples/examples_windrose/windrose_ex8.php +++ b/Examples/examples_windrose/windrose_ex8.php @@ -1,7 +1,7 @@ [3, 2, 1, 2, 2], - 355 => [1, 1, 1.5, 2], - 180 => [1, 1, 1.5, 2], - 150 => [1, 2, 1, 3], - 'S' => [2, 3, 5, 1], + 355 => [1, 1, 1.5, 2], + 180 => [1, 1, 1.5, 2], + 150 => [1, 2, 1, 3], + 'S' => [2, 3, 5, 1], ]; // Add some labels for afew of the directions $labels = [355 => "At\nHome base", 180 => "Probe\n123", 150 => "Power\nplant"]; // Define the color,weight and style of some individual radial grid lines. -$axiscolors = [355 => 'red']; +$axiscolors = [355 => 'red']; $axisweights = [355 => 8]; -$axisstyles = [355 => 'solid', 150 => 'solid']; +$axisstyles = [355 => 'solid', 150 => 'solid']; // First create a new windrose graph with a title -$__width = 400; -$__height = 500; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 400; +$__height = 500; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Windrose example 8'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); diff --git a/Examples/examples_windrose/windrose_ex9.php b/Examples/examples_windrose/windrose_ex9.php index 70116e98..cfd0b866 100644 --- a/Examples/examples_windrose/windrose_ex9.php +++ b/Examples/examples_windrose/windrose_ex9.php @@ -1,7 +1,7 @@ [3, 2, 1, 2, 2], - 'N' => [1, 1, 1.5, 2], + 'E' => [3, 2, 1, 2, 2], + 'N' => [1, 1, 1.5, 2], 'nw' => [1, 1, 1.5, 2], - 'S' => [2, 3, 5, 1], + 'S' => [2, 3, 5, 1], ]; // Define the color,weight and style of some individual radial @@ -23,14 +23,14 @@ // Note; Depending on how many axis you have in the plot the // index will vary between 0..n where n is the number of // compass directions. -$axiscolors = ['nw' => 'brown']; +$axiscolors = ['nw' => 'brown']; $axisweights = ['nw' => 8]; // Could also be specified as 6 => 8 -$axisstyles = ['nw' => 'solid']; +$axisstyles = ['nw' => 'solid']; // First create a new windrose graph with a title -$__width = 400; -$__height = 500; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 400; +$__height = 500; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Windrose example 9'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); diff --git a/Examples/examples_windrose/windrose_no_test_ex5.php b/Examples/examples_windrose/windrose_no_test_ex5.php index b625e80b..96c38e3f 100644 --- a/Examples/examples_windrose/windrose_no_test_ex5.php +++ b/Examples/examples_windrose/windrose_no_test_ex5.php @@ -1,7 +1,7 @@ [2, 7, 1, 2], ]; // Text to be added. -$txt = []; +$txt = []; $txt[0] = 'It is possible to add arbitrary,multi line, text to a graph. '; $txt[0] .= "Such a paragraph can have it's text be left, right or center "; $txt[0] .= 'aligned.'; @@ -27,9 +27,9 @@ $rangeColors = ['silver', 'khaki', 'orange', 'brown', 'blue', 'navy', 'maroon', 'red']; // First create a new windrose graph with a title -$__width = 570; -$__height = 430; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 570; +$__height = 430; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Windrose example 5'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 12); @@ -47,7 +47,8 @@ $graph->SetColor('darkgreen@0.7'); // Setup all the defined text boxes -$n = count($txt); +$n = \count($txt); + for ($i = 0; $i < $n; ++$i) { $txtbox[$i] = new Text($txt[$i]); $txtbox[$i]->SetPos($txtlayout[$i][0], $txtlayout[$i][1], 'right'); @@ -55,7 +56,8 @@ $txtbox[$i]->SetParagraphAlign($txtlayout[$i][3]); $txtbox[$i]->SetColor($txtlayout[$i][4]); $txtbox[$i]->SetBox($txtlayout[$i][5]); - if (count($txtlayout[$i]) > 6) { + + if (\count($txtlayout[$i]) > 6) { $txtbox[$i]->SetFont($txtlayout[$i][6], $txtlayout[$i][7], $txtlayout[$i][8]); } } diff --git a/Examples/examples_windrose/windrose_no_test_ex9.1.php b/Examples/examples_windrose/windrose_no_test_ex9.1.php index 046a1953..5cc93001 100644 --- a/Examples/examples_windrose/windrose_no_test_ex9.1.php +++ b/Examples/examples_windrose/windrose_no_test_ex9.1.php @@ -1,7 +1,7 @@ [3, 2, 1, 2, 2], - 4 => [1, 1, 1.5, 2], - 6 => [1, 1, 1.5, 2], + 0 => [3, 2, 1, 2, 2], + 4 => [1, 1, 1.5, 2], + 6 => [1, 1, 1.5, 2], 12 => [2, 3, 5, 1], ]; @@ -23,9 +23,9 @@ $ypos2 = 0.9; // First create a new windrose graph with a title -$__width = 650; -$__height = 350; -$graph = new Graph\WindroseGraph($__width, $__height); +$__width = 650; +$__height = 350; +$graph = new Graph\WindroseGraph($__width, $__height); $example_title = 'Interpretation of ordinal keys'; $graph->title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_VERDANA'), Graph\Configs::getConfig('FS_BOLD'), 14); diff --git a/Examples/examples_windrose/windrose_no_test_icon_ex1.php b/Examples/examples_windrose/windrose_no_test_icon_ex1.php index eccbbdf5..f431c23a 100644 --- a/Examples/examples_windrose/windrose_no_test_icon_ex1.php +++ b/Examples/examples_windrose/windrose_no_test_icon_ex1.php @@ -1,7 +1,7 @@ [1, 1, 2.5, 4], - 1 => [3, 4, 1, 4], + 0 => [1, 1, 2.5, 4], + 1 => [3, 4, 1, 4], 'wsw' => [1, 5, 5, 3], - 'N' => [2, 7, 5, 4, 2], - 15 => [2, 7, 12], ]; + 'N' => [2, 7, 5, 4, 2], + 15 => [2, 7, 12], ]; // First create a new windrose graph with a title -$__width = 400; +$__width = 400; $__height = 400; -$graph = new Graph\WindroseGraph($__width, $__height); +$graph = new Graph\WindroseGraph($__width, $__height); // Creta an icon to be added to the graph $icon = new IconPlot('tornado.jpg', 10, 10, 1.3, 50); diff --git a/Examples/examples_windrose/windrose_no_test_layout_ex0.php b/Examples/examples_windrose/windrose_no_test_layout_ex0.php index 8f2fd32e..a2424841 100644 --- a/Examples/examples_windrose/windrose_no_test_layout_ex0.php +++ b/Examples/examples_windrose/windrose_no_test_layout_ex0.php @@ -1,7 +1,7 @@ SetShadow(); $example_title = 'Multiple plots with automatic layout'; $graph->title->set($example_title); @@ -36,7 +36,8 @@ // Setup the individual windrose plots $wp = []; -for ($i = 0; $i < 4; ++$i) { + +for ($i = 0; 4 > $i; ++$i) { $wp[$i] = new Plot\WindrosePlot($data[$i]); $wp[$i]->SetSize(0.22); $wp[$i]->SetCenterSize(0.25); @@ -46,7 +47,7 @@ // bottom row. $hl1 = new LayoutHor([$wp[0], $wp[1]]); $hl2 = new LayoutHor([$wp[2], $wp[3]]); -$vl = new LayoutVert([$hl1, $hl2]); +$vl = new LayoutVert([$hl1, $hl2]); $graph->Add($vl); $graph->Stroke(); diff --git a/Examples/examples_windrose/windrose_no_test_layout_ex1.php b/Examples/examples_windrose/windrose_no_test_layout_ex1.php index 8dfdd2b6..dd4f1472 100644 --- a/Examples/examples_windrose/windrose_no_test_layout_ex1.php +++ b/Examples/examples_windrose/windrose_no_test_layout_ex1.php @@ -1,7 +1,7 @@ title->set($example_title); $graph->title->SetFont(Graph\Configs::getConfig('FF_ARIAL'), Graph\Configs::getConfig('FS_BOLD'), 14); // Setup the individual windrose plots $wp = []; -for ($i = 0; $i < 5; ++$i) { + +for ($i = 0; 5 > $i; ++$i) { $wp[$i] = new Plot\WindrosePlot($data[$i]); $wp[$i]->SetType(Plot\Configs::getConfig('WINDROSE_TYPE8')); - if ($i < 2) { + + if (2 > $i) { $wp[$i]->SetSize(0.28); } else { $wp[$i]->legend->Hide(); @@ -58,7 +60,7 @@ // bottom row. $hl1 = new LayoutHor([$wp[0], $wp[1]]); $hl2 = new LayoutHor([$wp[2], $wp[3], $wp[4]]); -$vl = new LayoutVert([$hl1, $hl2]); +$vl = new LayoutVert([$hl1, $hl2]); $graph->Add($vl); $graph->Stroke(); diff --git a/Examples/listallflags.php b/Examples/listallflags.php deleted file mode 100644 index fcca54aa..00000000 --- a/Examples/listallflags.php +++ /dev/null @@ -1,29 +0,0 @@ -\n"; -$cols = 0; -while (list($key, $val) = each($flags->iCountryNameMap)) { - echo '\n"; - - if (++$cols == 5) { - echo "\n"; - $cols = 0; - } -} - -echo '
Width:
' . $this->GenHTMLInput('w', 8, 4, 300) . '

'; - echo "${key}
idx=${val}
'; diff --git a/Examples/listallflags_helper.php b/Examples/listallflags_helper.php index 7c5434f5..498fa84f 100644 --- a/Examples/listallflags_helper.php +++ b/Examples/listallflags_helper.php @@ -1,10 +1,11 @@ GetImgByIdx($idx); -header('Content-type: image/png'); -imagepng($img); +$img = $flags->GetImgByIdx($idx); +\header('Content-type: image/png'); +\imagepng($img); diff --git a/Examples/show-example.php b/Examples/show-example.php index f2dba894..6c4c2d41 100755 --- a/Examples/show-example.php +++ b/Examples/show-example.php @@ -1,15 +1,18 @@ "; +$target = \basename(\urldecode($_GET['target'] ?? 'axislabelbkgex01.php')); +$folder = \basename(\urldecode($_GET['folder'] ?? 'examples_axis')); + +echo ''; echo ''; echo ' Image ' . $target . ''; - -if (!strstr($target, 'csim')) { - $highlighted = highlight_file(($folder ? $folder . '/' : '') . $target, true); +if (!\mb_strstr($target, 'csim')) { + $highlighted = \highlight_file(($folder ? $folder . '/' : '') . $target, true); echo ''; echo ''; @@ -17,7 +20,6 @@ echo $highlighted; echo ''; } else { - echo '