stineco

Howto fusionchart XT Multi-series chart from Database (SQL)

Recommended Posts

Hi,

 

I am using fusionchart XT to generate charts from my MS SQL SERVER.

I have no problem to get the data from my server into my charts (Bar,Pie,...)

but when i wanna put data in Multi-series charts i dont now how.

 

Can someone help my with a example.

Tnx.

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum.

 

To get multi-series data you need to format the XML/JSON data retrieved as per the FusionCharts format.

 

Could you confirm which server side language you are using so that we can help you out with a sample?

 

Also, check out this link if it helps: http://docs.fusioncharts.com/tutorial-using-with-server-side-languages-php-different-ways-of-loading-data.html

 

Awaiting response.

Share this post


Link to post
Share on other sites

Hi,

Already a big thanks, but there is a problem,

i have deleted the data from factory 2 date 1-02-2003 but when i go to the chart,

factory 1,2,3 on show everything on the first date
factory 1,2,3 on the  show everything second date

On the third date is shows only factory 1 and 3
But i have deleted one line in the output table from factory 2 (second date)

Can you check this?

Thanx

Share this post


Link to post
Share on other sites

The problem is that if one value is not there, the output goes wrong, the xml is created correct.

The solution is that to create a <set value=''>. any help?

Share this post


Link to post
Share on other sites

Hi,

 

This is the screenshot 1z648iu.jpg

The generated code of the html file



<html>
   <head>
      <title>FusionCharts XT - Column 2D Chart - Data from a database</title>
    <link  rel="stylesheet" type="text/css" href="css/style.css" />

      <!-- You need to include the following JS file to render the chart.
      When you make your own charts, make sure that the path to this JS file is correct.
      Else, you will get JavaScript errors. -->

      <script src="fusioncharts/fusioncharts.js"></script>
  </head>

   <body>
              <script type="text/javascript">
            FusionCharts.ready(function () {
                new FusionCharts({"type":"mscolumn2d","id":"myFirstChart","width":600,"height":300,"renderAt":"chart-1","dataFormat":"xml","dataSource":'<chart caption= "Top 10 Most Populous Countries"  paletteColors= "#0075c2,#00ff00,#ff00a5"  bgColor= "#ffffff"  borderAlpha= "20"  canvasBorderAlpha= "0"  usePlotGradientColor= "0"  plotBorderAlpha= "10"  showXAxisLine= "1"  xAxisLineColor= "#999999"  showValues= "0"  divlineColor= "#999999"  divLineIsDashed= "1"  showAlternateHGridColor= "0" ><categories><category label="1-01-2003" /><category label="1-02-2003" /><category label="1-03-2003" /></categories><dataset seriesName=" Factory1 "><set value="21" /><set value="23" /><set value="22" /></dataset><dataset seriesName=" Factory2 "><set value="121" /><set value="122" /></dataset><dataset seriesName=" Factory3 "><set value="54" /><set value="56" /><set value="89" /></dataset></chart>'});
            });
        </script>        <script type='text/javascript'>
            FusionCharts.ready(function () {
                FusionCharts("myFirstChart").render();
            });
        </script>
      <div id="chart-1">Fusion Charts will render here</div>

   </body>

</html>
Edited by stineco

Share this post


Link to post
Share on other sites

Hi,

 

The issue is replicated. But as per your use case another condition has to be included in the code for this scenario.

 

Another 'if' clause for the null data will help to solve out the issue.

 

Currently no sample implementation is present. We will try to share the same as soon as possible.

Share this post


Link to post
Share on other sites

Hi

 

For me when I include the fusioncharts.php file I get a blank page. No error message.

 

Checked path is correct by loading get file in the browser from the include path I use; fine.

 

If I comment out include the rest of the page loads fine.

 

I've downloaded the wrapper file twice and uploaded twice.

 

Any suggestions please?

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum.

 

Can you provide some more details like are you trying to render the chart using the database or static string of data?

 

Also which version of FusionCharts you are using?

 

You can refer the latest sample of FusionCharts using PHP wrapper: https://www.dropbox.com/s/4g2gur3f3vdeb67/php_samplewith_%20XML.rar?dl=0

 

Awaiting response.

Share this post


Link to post
Share on other sites

Hi,

Please can someone inform me if there is way of  generating charts from my SQL server, but not from different tables, I have one table which contain lot of column and i want to compare two or more columns choosed by the user whilst checking a checkbox.

I wanna put data in Multi-series charts but i dont now how it works. 

I am in a big trouble  :( !

Share this post


Link to post
Share on other sites
6 hours ago, Ayan Bhadury said:

Hi,

Kindly refer this documentation url, it will guide how to render FusionCharts using jsp wrapper where the datas are fetched from database.
http://www.fusioncharts.com/dev/using-with-server-side-languages/java/creating-charts-with-data-from-a-database.html

Hi , I need the sample code for multi series bar chart only . I have tried the bar chart . That gets worked out . But in multi series or stacked charts only the forming of data is difficult . 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now