Plot Multiple Values on Chart

I know that php is no Delphi. But for the principle: in Delphi there are components for graphs and you can define one or more series to that. It’s a simple api to do so, I don’t need to configure much more than the type of graph, dimensions etc. A similar approach to the graphs module of SC would be great. In fact, a field of type ‘graph’ with properties would do the job. The graph will be displayed in a div and thus can mix with the other components like the barcode etc. The property series should make it possible to draw more charts within. I would like to be able to compare illness percentages of departments in one graph. A piece of cake in Delphi.

@Cavadinha, of course we can create blank applications for everything SC doesn’t support out-of-the-box, and I find that a very conveniant way to integrate regular php. But for javascript I need to generate the series from php to javascript and embed that in the code. Above approach would fit in the filosofy of Scriptcase. Especially when you want to clone the product to a BI tool. End-users don’t understand a thing about javascript and they need to be able to compare results by mulitiple series in a chart. But it’s imho of course.

The reseller/powerusers have found each other in a Google+ group. I think it would be a great place to discuss issues like these.

[QUOTE=aducom;26809]

The reseller/powerusers have found each other in a Google+ group. I think it would be a great place to discuss issues like these.[/QUOTE]

Just an aclaration. If you talk about G+ group I created, it’s just for Resellers and NetMake employees. If it’s other group, can you share a link?

I mean your (our) group. Cavadinha is a Netmake employee. It would be great if NM would share and discuss his/her ideas regarding the product in the private G+.

This is one of the reasons why exists

well, we want outcome afterall, G+ or whatever you go guys, we want outcome :smiley:

good luck :cool:

[QUOTE=Cavadinha;26762]The chart app is new so we will continue to improve it in the future releases.

So, you need to make a blank app and use all its power. I will post a static example, it should be enough.
Switch -> INSTALL_PATH to your folder.

For more custom charts read FusionCharts documentation.
We have the right to use their lib so enjoy this powerfull add of V8.

The expected result should be this:

Code below:

?>
<script language="javascript" type="text/javascript" src="/INSTALL_PATH/prod/third/jquery/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="/INSTALL_PATH/prod/third/fusioncharts/FusionCharts/FusionCharts.js"></script>

<div id="chart-container" style="margin-top:35px;">FusionCharts will render here</div>
<script>
    var chartReport;
    
    $(function() {
            generateGraphAppDev();        
    });
    
    function generateGraphAppDev()
    {        
            chartReport = new FusionCharts({
                type: 'mscolumn3d',
                renderAt: 'chart-container',
                width: '1200',
                height: '600',
                dataFormat: 'json',
                dataSource: {
                "chart": {
                "caption": "Aplications X Devs",
                "xAxisName": "Type of application",
                "yAxisName": "Ammount",
                "theme": "fint"
            },
            "categories": 
                [
					{
						"category":   
							[
								{"label": "Blank"},{"label": "Graph"},{"label": "Container"},{"label": "Control"},
								{"label": "Grid"},{"label": "Form"},{"label": "Filter"},{"label": "Menu"},
								{"label": "Menu Tree"},{"label": "Tab"},{"label": "Procedure"}
							]
					}
				],
                "dataset":
					[
						{
							"seriesname":"Admin","data":
							[
								{"value": "2"},{"value": "2"},{"value": "7"},{"value": "22"},{"value": "42"},{"value": "50"},
								{"value": "4"},{"value": "11"},{"value": "5"},{"value": "3"},{"value": "0"}
							]
						},{
							"seriesname":"Cavadinha","data":
							[
								{"value": "5"},{"value": "15"},{"value": "10"},{"value": "1"},{"value": "31"},{"value": "20"},
								{"value": "33"},{"value": "1"},{"value": "12"},{"value": "3"},{"value": "9"}
							]
						},{
							"seriesname":"Smiley Face","data":
							[
								{"value": "10"},{"value": "1"},{"value": "3"},{"value": "0"},{"value": "22"},{"value": "27"},
								{"value": "5"},{"value": "2"},{"value": "7"},{"value": "9"},{"value": "0"}
							]
						}
            		]
        		}
    		});

            chartReport.render();
            
    }
</script>

<?php

[/QUOTE]

Hi, @Cavadinha
Your code cannot work on my environment, my version is v8 and copy all your code, change the include like this:

<script language=“javascript” type=“text/javascript” src="<?php echo $this->Ini->path_third ?>/jquery/js/jquery.js"></script>
<script language=“javascript” type=“text/javascript” src="<?php echo $this->Ini->path_third ?>/fusioncharts/FusionCharts/FusionCharts.js"></script>

And it can point to my folder, but cannot get the charts. How’s that?

Could @aducom answer my last question? the js-custom chart question, thank you very much.

Sorry, I answer questions when I have something to add, not for ‘just answering’. I have no clue.

[QUOTE=jerry;28594]Hi, @Cavadinha
Your code cannot work on my environment, my version is v8 and copy all your code, change the include like this:

<script language=“javascript” type=“text/javascript” src="<?php echo $this->Ini->path_third ?>/jquery/js/jquery.js"></script>
<script language=“javascript” type=“text/javascript” src="<?php echo $this->Ini->path_third ?>/fusioncharts/FusionCharts/FusionCharts.js"></script>

And it can point to my folder, but cannot get the charts. How’s that?[/QUOTE]

I’ve tried your include. this php echo prints the path of the third party libraries, but as the system path, not as the URL path.

As on my installation, I’ve tried one line with your PHP (as it would be very useful on deployment) and one as hardcoded URL, and this is what I see on the rendered HTML:

<script language=“javascript” type=“text/javascript” src="/daxonichely/public_html/scriptcase/prod/third/jquery/js/jquery.js"></script>
<script language=“javascript” type=“text/javascript” src="/scriptcase/prod/third/fusioncharts/FusionCharts/FusionCharts.js"></script>

As you can see, we might use another variable.

I’m just a regular user, so I don’t know of the execution variables of the system, but maybe I’ll make it work with some substring function of PHP (though, there should be a more elegant way)

Regarding the issue of this thread. I’ve looked for the multiple values chart example (I’m running V8) but can’t find it. What is it called?