Modify y-axis range in highcharts chart

0

I'm starting to venture into high charts and would like to do two chart lines, one with my weight and another with fat percentage.

The problem is that the weight will always be larger in proportion to the graph than the percentage of fat. Ex: 70 kg for 15 of fat. the interval between one line and the other will be 55.

Would you have a way to cut the interval? A rule to stay only 2, 3 measures above the percentage and 2,3 in the weight line? And bring them closer?

I'm running the script inside HTML to be able to use the PHP variables.

<script src="https://code.highcharts.com/highcharts.js"></script><scriptsrc="https://code.highcharts.com/modules/exporting.js"></script>

<script>
Highcharts.chart('container', {
    chart: {
        type: 'areaspline'
    },
    title: {
        text: 'Meus registros'
    },
    legend: {
        layout: 'vertical',
        align: 'left',
        verticalAlign: 'top',
        x: 150,
        y: 100,
        floating: true,
        borderWidth: 1,
        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
    },
    xAxis: {
        categories: [
            '<?php echo $date[0]; ?>',
            '<?php echo $date[1]; ?>',
            '<?php echo $date[2]; ?>',
            '<?php echo $date[3]; ?>',
            '<?php echo $date[4]; ?>',
            '<?php echo $date[5]; ?>'
        ],
        plotBands: [{ // visualize the weekend
            from: 4.5,
            to: 6.5,
            color: 'rgba(68, 170, 213, .2)'
        }]
    },
    yAxis: {
        title: {
            text: '',

        }
    },
    tooltip: {
        shared: true,

    },
    credits: {
        enabled: false
    },
    plotOptions: {
        areaspline: {
            fillOpacity: 0.5
        }
    },
    series: [{
        name: 'Peso(Kg)',
        data: [<?php echo $peso[0]; ?>,
         <?php echo $peso[1]; ?>,
         <?php echo $peso[2]; ?>,
         <?php echo $peso[3]; ?>,
         <?php echo $peso[4]; ?>,
         <?php echo $peso[5]; ?> ]
    }, {
        name: 'Body Fat(%)',
        data: [<?php echo $bf[0]; ?>,
               <?php echo $bf[1]; ?>,
               <?php echo $bf[2]; ?>,
               <?php echo $bf[3]; ?>,
               <?php echo $bf[4]; ?>,
               <?php echo $bf[5]; ?>]
    }]
});
</script>
    
asked by anonymous 24.02.2018 / 00:44

0 answers