Configuring Charts - Manually defining y-axis limits and number of divisional lines

Using Div lines in Line chart

by Megha Jagadeesh

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- Customizing the divisional lines in a chart.

If you need to force y-axis lower and upper limits, you need to disable the auto calculation of number of divisional lines using adjustDiv attributes.

Attributes: 

    1. adjustDiv - To disable automatic div calculation
    2. yAxisMaxvalue - manually defined y-Axis max value
    3. yAxisMinValue - manually defined y-Axis min value
    4. numDivLines - Number of divisional lines you want to show on the y-axis (not including y-axis lower and upper limits)

 -->
<div id="chart-container">FusionCharts will render here</div>

JavaScript

FusionCharts.ready(function () {
    var vstrChart = new FusionCharts({
        type: 'msline',
        renderAt: 'chart-container',
        width: '500',
        height: '250',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Website Visitors",
                "subCaption": "Last week Vs Current week",
                "xAxisName": "Day",
                "yAxisName": "No. of Visitors",
                "theme": "fint",
                "showValues": "0",
                //Setting automatic calculation of div lines to off
                "adjustDiv": "0",
                //Manually defining y-axis lower and upper limit
                "yAxisMaxvalue": "35000",
                "yAxisMinValue": "5000",
                //Setting number of divisional lines to 9
                "numDivLines": "9",
                "legendIconScale":"1"
            },            
            "categories": [
                {
                    "category": [
                        {
                            "label": "Mon"
                        }, 
                        {
                            "label": "Tue"
                        }, 
                        {
                            "label": "Wed"
                        }, 
                        {
                            "label": "Thu"
                        }, 
                        {
                            "label": "Fri"
                        }, 
                        {
                            "label": "Sat"
                        }, 
                        {
                            "label": "Sun"
                        }
                    ]
                }
            ],            
            "dataset": [
                {
                    "seriesname": "Week 1",
                    "data": [
                        {
                            "value": "13000"
                        }, 
                        {
             ...