ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Financial Chart export transparent image
Posted by streampow on Feb-10-2017 20:45
Attachments:
Hi, I am using phpChardirector for finacial chart on Codeignter Framework, but it export transparent image.
First, Code load 3 helper:
$this->load->helper(array("chartdir/lib/phpchartdir", "chartdir/lib/financechart", "chartdir/financedemochart"));
struct of variable $c:
"
FinanceChart Object
(
    [m_totalWidth] => 780
    [m_totalHeight] => 422
    [m_antiAlias] => 1
    [m_logScale] =>
    [m_axisOnRight] => 1
    [m_leftMargin] => 40
    [m_rightMargin] => 40
    [m_topMargin] => 30
    [m_bottomMargin] => 35
    [m_plotAreaBgColor] => 16777215
    [m_plotAreaBorder] => 8947848
    [m_plotAreaGap] => 2
    [m_majorHGridColor] => 14540253
    [m_minorHGridColor] => 14540253
    [m_majorVGridColor] => 14540253
    [m_minorVGridColor] => 14540253
    [m_legendFont] => normal
    [m_legendFontSize] => 8
    [m_legendFontColor] => 4294901762
    [m_legendBgColor] => 2160905420
    [m_yAxisFont] => normal
    [m_yAxisFontSize] => 8
    [m_yAxisFontColor] => 4294901762
    [m_yAxisMargin] => 14
    [m_xAxisFont] => normal
    [m_xAxisFontSize] => 8
    [m_xAxisFontColor] => 4294901762
    [m_xAxisFontAngle] => 0
    [m_timeStamps] => Array
        (
            [0] => 63615663000
            [1] => 63615922200
            [2] => 63616008600
            [3] => 63616095000
            [4] => 63616181400
            [5] => 63616267800
            [6] => 63616527000
            [7] => 63616613400
            [8] => 63616699800
            [9] => 63616786200
            [10] => 63616872600
            [11] => 63617131800
            [12] => 63617218200
            [13] => 63617304600
            [14] => 63617391000
            [15] => 63617477400
            [16] => 63617736600
            [17] => 63617823000
            [18] => 63617909400
            [19] => 63617995800
            [20] => 63618082200
            [21] => 63618341400
            [22] => 63618427800
            [23] => 63618514200
            [24] => 63618600600
            [25] => 63618687000
            [26] => 63618946200
            [27] => 63619032600
            [28] => 63619119000
            [29] => 63619205400
            [30] => 63619291800
            [31] => 63619551000
            [32] => 63619637400
            [33] => 63619723800
            [34] => 63619810200
            [35] => 63619896600
            [36] => 63620155800
            [37] => 63620242200
            [38] => 63620328600
            [39] => 63620415000
            [40] => 63620501400
            [41] => 63620760600
            [42] => 63620847000
            [43] => 63620933400
            [44] => 63621019800
            [45] => 63621106200
            [46] => 63621365400
            [47] => 63621451800
            [48] => 63621538200
            [49] => 63621624600
            [50] => 63621711000
            [51] => 63621970200
            [52] => 63622056600
            [53] => 63622143000
            [54] => 63622229400
            [55] => 63622315800
        )

    [m_highData] => Array
        (
            [0] => 1009
            [1] => 994
            [2] => 997
            [3] => 988
            [4] => 997
            [5] => 969
            [6] => 960
            [7] => 967
            [8] => 960
            [9] => 944
            [10] => 945
            [11] => 951
            [12] => 920
            [13] => 938
            [14] => 950
            [15] => 958
            [16] => 978
            [17] => 971
            [18] => 973
            [19] => 980
            [20] => 983
            [21] => 961
            [22] => 992
            [23] => 1005
            [24] => 1009
            [25] => 995
            [26] => 982
            [27] => 981
            [28] => 962
            [29] => 951
            [30] => 949
            [31] => 923
            [32] => 951
            [33] => 937
            [34] => 936
            [35] => 951
            [36] => 936
            [37] => 899
            [38] => 874
            [39] => 888
            [40] => 859
            [41] => 840
            [42] => 858
            [43] => 842
            [44] => 853
            [45] => 866
            [46] => 865
            [47] => 844
            [48] => 831
            [49] => 812
            [50] => 810
            [51] => 806
            [52] => 798
            [53] => 793
            [54] => 815
            [55] => 788
        )

    [m_lowData] => Array
        (
            [0] => 978
            [1] => 969
            [2] => 971
            [3] => 956
            [4] => 960
            [5] => 947
            [6] => 925
            [7] => 945
            [8] => 936
            [9] => 913
            [10] => 936
            [11] => 908
            [12] => 897
            [13] => 904
            [14] => 922
            [15] => 933
            [16] => 945
            [17] => 938
            [18] => 938
            [19] => 955
            [20] => 946
            [21] => 946
            [22] => 949
            [23] => 985
            [24] => 971
            [25] => 981
            [26] => 960
            [27] => 945
            [28] => 916
            [29] => 906
            [30] => 914
            [31] => 899
            [32] => 912
            [33] => 913
            [34] => 918
            [35] => 932
            [36] => 895
            [37] => 877
            [38] => 843
            [39] => 842
            [40] => 831
            [41] => 824
            [42] => 837
            [43] => 800
            [44] => 829
            [45] => 852
            [46] => 831
            [47] => 815
            [48] => 808
            [49] => 791
            [50] => 777
            [51] => 757
            [52] => 749
            [53] => 767
            [54] => 786
            [55] => 768
        )

    [m_openData] => Array
        (
            [0] => 1000
            [1] => 975
            [2] => 986
            [3] => 985
            [4] => 977
            [5] => 948
            [6] => 947
            [7] => 949
            [8] => 945
            [9] => 935
            [10] => 938
            [11] => 925
            [12] => 917
            [13] => 915
            [14] => 934
            [15] => 949
            [16] => 959
            [17] => 953
            [18] => 958
            [19] => 973
            [20] => 973
            [21] => 955
            [22] => 969
            [23] => 986
            [24] => 985
            [25] => 992
            [26] => 982
            [27] => 971
            [28] => 944
            [29] => 920
            [30] => 929
            [31] => 907
            [32] => 923
            [33] => 930
            [34] => 919
            [35] => 946
            [36] => 921
            [37] => 890
            [38] => 866
            [39] => 870
            [40] => 858
            [41] => 826
            [42] => 848
            [43] => 832
            [44] => 830
            [45] => 854
            [46] => 852
            [47] => 832
            [48] => 826
            [49] => 808
            [50] => 800
            [51] => 788
            [52] => 762
            [53] => 787
            [54] => 796
            [55] => 784
        )

    [m_closeData] => Array
        (
            [0] => 982
            [1] => 984
            [2] => 981
            [3] => 974
            [4] => 964
            [5] => 966
            [6] => 941
            [7] => 949
            [8] => 951
            [9] => 924
            [10] => 943
            [11] => 932
            [12] => 908
            [13] => 927
            [14] => 936
            [15] => 950
            [16] => 960
            [17] => 956
            [18] => 970
            [19] => 977
            [20] => 961
            [21] => 959
            [22] => 980
            [23] => 987
            [24] => 999
            [25] => 995
            [26] => 972
            [27] => 954
            [28] => 926
            [29] => 932
            [30] => 917
            [31] => 917
            [32] => 942
            [33] => 921
            [34] => 928
            [35] => 934
            [36] => 907
            [37] => 880
            [38] => 855
            [39] => 852
            [40] => 844
            [41] => 837
            [42] => 844
            [43] => 819
            [44] => 835
            [45] => 861
            [46] => 849
            [47] => 830
            [48] => 827
            [49] => 795
            [50] => 794
            [51] => 769
            [52] => 780
            [53] => 778
            [54] => 796
            [55] => 786
        )

    [m_volData] => Array
        (
            [0] => 1.1018648926639
            [1] => 0.99562469043201
            [2] => 0.51469856407836
            [3] => 2.4645063914276
            [4] => 0.80139659305601
            [5] => 0.9968145122977
            [6] => 1.5938091108328
            [7] => 0.73010754823454
            [8] => 1.5690103660033
            [9] => 1.8529843989185
            [10] => 1.5029010118458
            [11] => 0.6684180116673
            [12] => 2.2044978956004
            [13] => 2.0922499242221
            [14] => 0.79215486075081
            [15] => 1.7991209182188
            [16] => 1.27226736042
            [17] => 0.95313539040581
            [18] => 2.0758857935611
            [19] => 1.6276729724202
            [20] => 0.81802591223224
            [21] => 2.2864508633005
            [22] => 1.9959490521569
            [23] => 1.139988776911
            [24] => 1.0404334549188
            [25] => 2.288835056077
            [26] => 1.0504835700967
            [27] => 2.3920142831961
            [28] => 1.2703891863978
            [29] => 2.3403849843518
            [30] => 1.3675753327244
            [31] => 1.2849993446807
            [32] => 2.1824448280228
            [33] => 0.63055224440306
            [34] => 1.706766680164
            [35] => 1.1650390957168
            [36] => 1.8047938098444
            [37] => 1.9382992790635
            [38] => 1.6538207901534
            [39] => 1.7639961795099
            [40] => 1.1271410353079
            [41] => 2.3006001710427
            [42] => 2.4139421838135
            [43] => 0.96384703751277
            [44] => 1.8999299750198
            [45] => 1.7113639109794
            [46] => 1.6008334749147
            [47] => 1.6660851042639
            [48] => 2.2675924114342
            [49] => 1.3143389864858
            [50] => 1.948932858987
            [51] => 0.97952577855427
            [52] => 2.1088911927326
            [53] => 0.51088928524658
            [54] => 0.93229514230795
            [55] => 1.7806140983665
        )

    [m_volUnit] => M
    [m_extraPoints] => 26
    [m_yearFormat] => {value|yyyy}
    [m_firstMonthFormat] => <*font=bold*>{value|mmm yy}
    [m_otherMonthFormat] => {value|mmm}
    [m_firstDayFormat] => <*font=bold*>{value|d mmm}
    [m_otherDayFormat] => {value|d}
    [m_firstHourFormat] => <*font=bold*>{value|d mmm
h:nna}
    [m_otherHourFormat] => {value|h:nna}
    [m_timeLabelSpacing] => 50
    [m_generalFormat] => P3
    [m_toolTipMonthFormat] => [{xLabel|mmm yyyy}]
    [m_toolTipDayFormat] => [{xLabel|mmm d, yyyy}]
    [m_toolTipHourFormat] => [{xLabel|mmm d, yyyy hh:nn:ss}]
    [m_mainChart] => XYChart Object
        (
            [ptr] => $$pointer$$class XYChart *@38df9d8
            [xAxis] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@3910104
                )

            [xAxis2] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@390fd1c
                )

            [yAxis] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@39104ec
                )

            [yAxis2] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@3910cbc
                )

        )

    [m_currentChart] => XYChart Object
        (
            [ptr] => $$pointer$$class XYChart *@3992a30
            [xAxis] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@38f667c
                )

            [xAxis2] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@38f6a64
                )

            [yAxis] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@38f6e4c
                )

            [yAxis2] => Axis Object
                (
                    [ptr] => $$pointer$$class Axis *@38f7a04
                )

        )

    [ptr] => $$pointer$$class MultiChart *@398fbb0
    [charts] => Array
        (
            [0] => XYChart Object
                (
                    [ptr] => $$pointer$$class XYChart *@392e3a8
                    [xAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@390f164
                        )

                    [xAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@39108d4
                        )

                    [yAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@390f934
                        )

                    [yAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@390f54c
                        )

                )

            [1] => XYChart Object
                (
                    [ptr] => $$pointer$$class XYChart *@38df9d8
                    [xAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@3910104
                        )

                    [xAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@390fd1c
                        )

                    [yAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@39104ec
                        )

                    [yAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@3910cbc
                        )

                )

            [2] => XYChart Object
                (
                    [ptr] => $$pointer$$class XYChart *@3992a30
                    [xAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@38f667c
                        )

                    [xAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@38f6a64
                        )

                    [yAxis] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@38f6e4c
                        )

                    [yAxis2] => Axis Object
                        (
                            [ptr] => $$pointer$$class Axis *@38f7a04
                        )

                )

        )

    [mainChart] => FinanceChart Object
*RECURSION*
)
"
File (chartdir) lib/finacialdemochart.php same as (codeigniter dir) application/helpers/chartdir/financedemochart_helper.php
File (chartdir)  phpchartdir same as
(codeigniter dir) application/helpers/chartdir/phpchartdir_helper.php
File (chartdir) Financechart.php same as
(codeigniter dir) application/helpers/chartdir/financechart_helper.php

But if i using on normal php in example code (finacialdemochart.php in folder phpdemo), not error appear.

Please help me! Thanks!
finacial_chart_error.png

  Re: Financial Chart export transparent image
Posted by Peter Kwan on Feb-11-2017 02:33
Hi streampow,

In your charting code, please add an extra line to save the chart as an image. For exmaple:

$c->makeChart("/tmp/mychart.png");

Now in addition to displaying the chart to the browser, there should be a chart image created in "/tmp/mychart.png" (please make sure you created the "/tmp" directory first, and also make sure the directory is readable and writable by the web server anonymous user. You may want to make the directory readable and writable to everyone for testing.)

Please attach the image "/tmp/mychart.png" so I can analyse it.

Also, on the browser page, if the image is transparent, you may still be able to save it by right clicking on the image, and press "Save Image As".

You can also use the method in the following page to save the image (by creating a web page with a URL to the image, and right click it and choose "Save Link As").

http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200

Please kindly attach the images you can obtain so I can analyse them

If the "/tmp/mychart.png" looks fine, but the display does not show the image, would you mind to clarify how your code outputs the image? Are you using the PHP function "header" to set the MIME type, and "print" to output the image, or are you using some Codeigniter specific methods?

Regards
Peter Kwan