FusionCharts API-Methods: clone

Created using FusionCharts Suite XT - www.fusioncharts.com

by FusionCharts

HTML

<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<!-- This sample shows usage of the clone() method -->
<div id="indicatorDiv">Method Name: <b>clone()</b>

    <br>
    <br>Creates a copy of a chart instance, creating a new chart with identical construction properties of the chart being cloned. The cloned chart, assigned an auto-generated ID, is rendered in a container DOM element that is explicitly provided.</br>
    <br>Click the <b> Create an exact clone </b> button to create an exact replica of the column 2D chart shown below. Click the <b> Create a modified clone </b> button to create a bar chart replica of the column chart.</br>
    <br>Scroll down to see the cloned chart rendered below the original column chart.</br>
</div>
<br>
<center>
    <button id="exact_copy">Create an exact clone</button>
    <button id="modified_copy">Create a modified clone</button>
    <br>
    <br>
    <div id="chart-container">FusionCharts will render here</div>
    <div id="cloned-chart-container">Cloned FusionCharts will render here</div>
    <br>
</center>

CSS

#exact_copy {
    height: 25px;
    font-size: 13px;
}
#modified_copy {
    height: 25px;
    font-size: 13px;
}
body {
    padding: 5px;
    margin: 0 auto;
}
#indicatorDiv {
    width: 500px;
    font-family:'Arial', 'Helvetica';
    font-size: 13px;
}

JavaScript

FusionCharts.ready(function () {
    var revenueChart = new FusionCharts({
        type: 'column2d',
        renderAt: 'chart-container',
        width: '450',
        height: '200',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Monthly revenue for last year",
                    "subCaption": "Harry's SuperMart",
                    "xAxisName": "Month",
                    "yAxisName": "Revenue (In USD)",
                    "numberPrefix": "$",
                    "paletteColors": "#0075c2",
                    "bgColor": "#ffffff",
                    "borderAlpha": "20",
                    "canvasBorderAlpha": "0",
                    "usePlotGradientColor": "0",
                    "plotBorderAlpha": "10",
                    "placevaluesInside": "1",
                    "rotatevalues": "1",
                    "valueFontColor": "#ffffff",
                    "showXAxisLine": "1",
                    "xAxisLineColor": "#999999",
                    "divlineColor": "#999999",
                    "divLineIsDashed": "1",
                    "showAlternateHGridColor": "0",
                    "subcaptionFontBold": "0",
                    "captionFontSize": "13",
                    "subcaptionFontSize": "12"
            },
                "data": [{
                "label": "Jan",
                    "value": "420000"
            }, {
                "label": "Feb",
                    "value": "810000"
            }, {
                "label": "Mar",
                    "value": "720000"
            }, {
                "label": "Apr",
                    "value": "550000"
            }, {
                "label": "May",
                    "value": "910000"
            }, {
                "label": "Jun",
                    "value": "510000"
            }, {
                "label": "Jul",
                    "value": "680000"
            }, {
                "label": "Aug",
                   ...