How Draw Vertical Line to Histogram Graph on Google Charts??

1,695 views
Skip to first unread message

Dustqm Sybolls

unread,
Feb 24, 2014, 6:53:40 AM2/24/14
to google-visua...@googlegroups.com

If I draw line chart there is no problem but I want to this on histogram graph..

For LineChart;

var chart = new google.visualization.LineChart(document.querySelector('#chart_div'));

For Histogram;

var chart = new google.visualization.Histogram(document.querySelector('#chart_div'));

Other Codes;

function drawChart () {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Name');
    data.addColumn({type: 'string', role: 'annotation'});
    data.addColumn('number', 'Value');

    data.addRows([
        ['Foo', null, 4],
        ['Bar', null, 3],
        ['Baz', null, 7],
        ['Bat', null, 9],
        ['Cad', 'Vertical line here', 9],
        ['Qud', null, 2],
        ['Piz', null, 6]
    ]);

    var chart = new google.visualization.Histogram(document.querySelector('#chart_div'));
    chart.draw(data, {
        height: 300,
        width: 400,
        annotation: {
            // index here is the index of the DataTable column providing the annotation
            1: {
                style: 'line'
            }
        }
    });
}

Daniel LaLiberte

unread,
Feb 24, 2014, 10:24:54 AM2/24/14
to google-visua...@googlegroups.com
Hi Dustqm,

Unfortunately, the Histogram chart doesn't support annotations yet.  Given that it is very similar to the column chart, it might not be too difficult to add support for annotations, but we don't have plans to do that at the moment.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Dustqm Sybolls

unread,
Feb 25, 2014, 2:46:36 AM2/25/14
to google-visua...@googlegroups.com
thank you for your answer Daniel..

24 Şubat 2014 Pazartesi 17:24:54 UTC+2 tarihinde Daniel LaLiberte yazdı:
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages