Search code examples
javascriptchartslinelinechart

Google classic line chart upper space


I am using google line chart in my project. I need to add some space between the highest value and the top bar.

I want to make it look like google url shortener statistics. I am linking to two images, the first one is my project's current status screenshot and the second one is google url shortener statistics screenshot. Hope you will understand what I need.

My project's google line chart. I need some space between the highest value and the top bar.

Google url shortener statistics screenshot. It has some space between the highest value and the top bar.


Solution

  • Add the following to your options:

    vAxis: {
        viewWindow:{
            max:6,
            min:0
        },
        ticks: [1, 2, 3, 4, 5, 6],
    },
    

    Updated your Jsfiddle.