{"id":13311,"date":"2014-05-08T10:20:15","date_gmt":"2014-05-08T04:50:15","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=13311"},"modified":"2014-05-13T14:19:49","modified_gmt":"2014-05-13T08:49:49","slug":"fusioncharts-part-2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/fusioncharts-part-2\/","title":{"rendered":"FusionCharts Part \u2013 2"},"content":{"rendered":"<p>Using Fusion charts you can create different variety of charts two of them are single series chart and multiple series chart . As the name implies in case of single series chart you can only display single chart and in case of multiple series chart you can display multiple charts.<br \/>\nNow lets take an example to have better understanding of these chart.<\/p>\n<h4>Single series chart<\/h4>\n<p>In order to create single series chart you need to have a json in the following format:<br \/>\n[java]<br \/>\n {<br \/>\n            &quot;chart&quot;:{<br \/>\n            &quot;caption&quot;:&quot;Monthly Revenue&quot;,<br \/>\n            &quot;xaxisname&quot;:&quot;Month&quot;,<br \/>\n            &quot;yaxisname&quot;:&quot;Revenue&quot;,<br \/>\n            &quot;numberprefix&quot;:&quot;$&quot;,<br \/>\n            &quot;showvalues&quot;:&quot;0&quot;<br \/>\n        },<br \/>\n            &quot;data&quot;:[{<br \/>\n            &quot;label&quot;:&quot;Jan&quot;,<br \/>\n            &quot;Value&quot;:&quot;420000&quot;<br \/>\n        },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Feb&quot;,<br \/>\n                    &quot;Value&quot;:&quot;910000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Mar&quot;,<br \/>\n                    &quot;Value&quot;:&quot;720000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Apr&quot;,<br \/>\n                    &quot;Value&quot;:&quot;550000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;May&quot;,<br \/>\n                    &quot;Value&quot;:&quot;810000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Jun&quot;,<br \/>\n                    &quot;Value&quot;:&quot;510000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Jul&quot;,<br \/>\n                    &quot;Value&quot;:&quot;680000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Aug&quot;,<br \/>\n                    &quot;Value&quot;:&quot;620000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Sep&quot;,<br \/>\n                    &quot;Value&quot;:&quot;610000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Oct&quot;,<br \/>\n                    &quot;Value&quot;:&quot;490000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Nov&quot;,<br \/>\n                    &quot;Value&quot;:&quot;530000&quot;<br \/>\n                },<br \/>\n                {<br \/>\n                    &quot;label&quot;:&quot;Dec&quot;,<br \/>\n                    &quot;Value&quot;:&quot;330000&quot;<br \/>\n                }<br \/>\n        ],<br \/>\n            &quot;trendlines&quot;:{<br \/>\n            &quot;line&quot;:[{<br \/>\n                &quot;startvalue&quot;:&quot;700000&quot;,<br \/>\n                &quot;color&quot;:&quot;009933&quot;,<br \/>\n                &quot;displayvalue&quot;:&quot;Target&quot;<br \/>\n            }<br \/>\n            ]<br \/>\n        },<br \/>\n            &quot;styles&quot;: {<br \/>\n            &quot;definition&quot;: [<br \/>\n                    {<br \/>\n                        &quot;name&quot;: &quot;CanvasAnim&quot;,<br \/>\n                        &quot;type&quot;: &quot;animation&quot;,<br \/>\n                        &quot;param&quot;: &quot;_xScale&quot;,<br \/>\n                        &quot;start&quot;: &quot;0&quot;,<br \/>\n                        &quot;duration&quot;: &quot;1&quot;<br \/>\n                    }<br \/>\n            ],<br \/>\n            &quot;application&quot;: [<br \/>\n                    {<br \/>\n                        &quot;toobject&quot;: &quot;Canvas&quot;,<br \/>\n                        &quot;styles&quot;: &quot;CanvasAnim&quot;<br \/>\n                    }<br \/>\n            ]<br \/>\n        }<br \/>\n        }<br \/>\n [\/java]<\/p>\n<p>In the previous article I explained how to display fusion charts please refer to it if you don&#8217;t now how to create fusion charts by clicking <a target=\"_blank\" href=\"http:\/\/www.tothenew.com\/blog\/fusioncharts-part-1\/\">Here<\/a>.<\/p>\n<p>Html you need to display fusion chart<br \/>\n[java]<br \/>\n&lt;%@ page contentType=&quot;text\/html;charset=UTF-8&quot; %&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n    &lt;title&gt;Fusion chart&lt;\/title&gt;<br \/>\n    &lt;script src=&quot;..\/js\/jquery.min.js&quot;&gt;&lt;\/script&gt;<br \/>\n    &lt;script src=&quot;..\/js\/FusionCharts.js&quot;&gt;&lt;\/script&gt;<br \/>\n    &lt;script src=&quot;..\/js\/FusionCharts.HC.js&quot;&gt;&lt;\/script&gt;<br \/>\n    &lt;script src=&quot;..\/js\/FusionCharts.HC.Charts.js&quot;&gt;&lt;\/script&gt;<br \/>\n    &lt;script src=&quot;..\/js\/FusionCharts.jqueryplugin.js&quot;&gt;&lt;\/script&gt;<br \/>\n    &lt;script src=&quot;..\/js\/FusionChartsExportComponent.js&quot;&gt;&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n      &lt;div id=&quot;chartDisplaydiv&quot;&gt;&lt;\/div&gt;<br \/>\n      &lt;script&gt;<br \/>\n            $(document).ready(function(){<br \/>\n                              $(&quot;#chartDisplaydiv&quot;).insertFusionCharts({<br \/>\n                                                                          swfUrl: &quot;Line&quot;,<br \/>\n                                                                          dataSource: &#8216;..\/demo\/jsonData&#8217;,<br \/>\n                                                                          renderer: &#8216;JavaScript&#8217;,<br \/>\n                                                                          dataFormat: &quot;jsonUrl&quot;,<br \/>\n                                                                          width: &quot;1000&quot;,<br \/>\n                                                                          height: &quot;600&quot;,<br \/>\n                                                                          id: &quot;Sschart&quot;<br \/>\n                                                                       });<\/p>\n<p>                                            });<\/p>\n<p>      &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>[\/java]<br \/>\nIn the above code at dataSource &#8216;..\/demo\/jsonData&#8217; we have the required json in format for single series chart.<br \/>\nYou will get the following chart as the result<br \/>\n<a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/07\/singleSeriesGraph.png\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/07\/singleSeriesGraph.png\" alt=\"Single series chart\" width=\"700\" height=\"400\" class=\"aligncenter size-full\" \/><\/p>\n<h4>Multiple series chart<\/h4>\n<p>In order to create single series chart you need to have a json in the following format:<br \/>\n[java]<br \/>\n{<br \/>\n  &quot;chart&quot;:{ &quot;caption&quot;:&quot;Business Results 2005 v 2006&quot;, &quot;xaxisname&quot;:&quot;Month&quot;, &quot;yaxisname&quot;:&quot;Revenue&quot;, &quot;showvalues&quot;:&quot;0&quot;, &quot;numberprefix&quot;:&quot;\\$&quot; },<br \/>\n  &quot;categories&quot;:[{<br \/>\n      &quot;category&quot;:[{ &quot;label&quot;:&quot;Jan&quot;},<br \/>\n        { &quot;label&quot;:&quot;Feb&quot; },<br \/>\n        { &quot;label&quot;:&quot;Mar&quot; },<br \/>\n        { &quot;label&quot;:&quot;Apr&quot; },<br \/>\n        { &quot;label&quot;:&quot;May&quot; },<br \/>\n        { &quot;label&quot;:&quot;Jun&quot; },<br \/>\n        { &quot;vline&quot;:&quot;true&quot;, &quot;color&quot;:&quot;FF5904&quot;, &quot;thickness&quot;:&quot;2&quot; },<br \/>\n        { &quot;label&quot;:&quot;Jul&quot; },<br \/>\n        { &quot;label&quot;:&quot;Aug&quot; },<br \/>\n        { &quot;label&quot;:&quot;Sep&quot; },<br \/>\n        { &quot;label&quot;:&quot;Oct&quot; },<br \/>\n        { &quot;label&quot;:&quot;Nov&quot; },<br \/>\n        { &quot;label&quot;:&quot;Dec&quot; } ]<br \/>\n    }<br \/>\n  ],<br \/>\n  &quot;dataset&quot;:[{<br \/>\n      &quot;seriesname&quot;:&quot;2006&quot;,<br \/>\n      &quot;data&quot;:[{ &quot;value&quot;:&quot;27400&quot; },<br \/>\n        { &quot;value&quot;:&quot;29800&quot; },<br \/>\n        { &quot;value&quot;:&quot;25800&quot; },<br \/>\n        { &quot;value&quot;:&quot;26800&quot; },<br \/>\n        { &quot;value&quot;:&quot;29600&quot; },<br \/>\n        { &quot;value&quot;:&quot;32600&quot; },<br \/>\n        { &quot;value&quot;:&quot;31800&quot; },<br \/>\n        { &quot;value&quot;:&quot;36700&quot; },<br \/>\n        { &quot;value&quot;:&quot;29700&quot; },<br \/>\n        { &quot;value&quot;:&quot;31900&quot; },<br \/>\n        { &quot;value&quot;:&quot;34800&quot; },<br \/>\n        { &quot;value&quot;:&quot;24800&quot; }]<br \/>\n    },<br \/>\n    {<br \/>\n      &quot;seriesname&quot;:&quot;2005&quot;,<br \/>\n      &quot;data&quot;:[{ &quot;value&quot;:&quot;10000&quot; },<br \/>\n        { &quot;value&quot;:&quot;11500&quot; },<br \/>\n        { &quot;value&quot;:&quot;12500&quot; },<br \/>\n        { &quot;value&quot;:&quot;15000&quot; },<br \/>\n        { &quot;value&quot;:&quot;11000&quot; },<br \/>\n        { &quot;value&quot;:&quot;9800&quot;  },<br \/>\n        { &quot;value&quot;:&quot;11800&quot; },<br \/>\n        { &quot;value&quot;:&quot;19700&quot; },<br \/>\n        { &quot;value&quot;:&quot;21700&quot; },<br \/>\n        { &quot;value&quot;:&quot;21900&quot; },<br \/>\n        { &quot;value&quot;:&quot;22900&quot; },<br \/>\n        { &quot;value&quot;:&quot;20800&quot; }]<br \/>\n    }<br \/>\n  ],<\/p>\n<p>  &quot;styles&quot;:[{<br \/>\n      &quot;definition&quot;:[{<br \/>\n          &quot;style&quot;:[{ &quot;name&quot;:&quot;CanvasAnim&quot;, &quot;type&quot;:&quot;animation&quot;, &quot;param&quot;:&quot;_xScale&quot;, &quot;start&quot;:&quot;0&quot;, &quot;duration&quot;:&quot;1&quot; }]<br \/>\n        }<br \/>\n      ],<br \/>\n      &quot;application&quot;:[{<br \/>\n          &quot;apply&quot;:[{&quot;toobject&quot;:&quot;Canvas&quot;, &quot;styles&quot;:&quot;CanvasAnim&quot; }]<br \/>\n        }]<br \/>\n    }]<br \/>\n}<br \/>\n[\/java]<br \/>\nFor html you need to do the following changes in the code:<br \/>\n[java]<br \/>\n      &lt;script&gt;<br \/>\n            $(document).ready(function(){<br \/>\n                              $(&quot;#chartDisplaydiv&quot;).insertFusionCharts({<br \/>\n                                                                          swfUrl: &quot;MsLine&quot;,<br \/>\n                                                                          dataSource: &#8216;..\/demo\/jsonData&#8217;,<br \/>\n                                                                          renderer: &#8216;JavaScript&#8217;,<br \/>\n                                                                          dataFormat: &quot;jsonUrl&quot;,<br \/>\n                                                                          width: &quot;1000&quot;,<br \/>\n                                                                          height: &quot;600&quot;,<br \/>\n                                                                          id: &quot;Mschart&quot;<br \/>\n                                                                       });<\/p>\n<p>                                            });<\/p>\n<p>      &lt;\/script&gt;<\/p>\n<p>[\/java]<\/p>\n<p>Now at dataSource &#8216;..\/demo\/jsonData&#8217; we have the json for Multiple series chart.<\/p>\n<p>You will get following chart as result<br \/>\n<a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/07\/multipleseries.png\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/07\/multipleseries.png\" alt=\"Multiple series chart\" width=\"700\" height=\"400\" class=\"aligncenter size-full\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Fusion charts you can create different variety of charts two of them are single series chart and multiple series chart . As the name implies in case of single series chart you can only display single chart and in case of multiple series chart you can display multiple charts. Now lets take an example [&hellip;]<\/p>\n","protected":false},"author":102,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[7],"tags":[1378,55,27],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/13311"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=13311"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/13311\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=13311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=13311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=13311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}