Column Google chart legend position issue

google-visualization, javascript

Solution

If you want the legend at the top of your chart, you need to set the `legend.position` option to "top":

legend: { position: 'top', alignment: 'start' }

and when using a ChartWrapper, your options need to be inside the "options" parameter:

var wrapper = new google.visualization.ChartWrapper({
    chartType: 'ColumnChart',
    dataTable: Dydata,
    containerId: 'visualization',
    options: {
        legend: { position: 'top', alignment: 'start' },
        width: 520,
        height: 350
    }
});
wrapper.draw();

Problem

I want to simply set the marked place legend on top of the graph. The following is the Google Chart code which does not work: ``` var wrapper = new google.visualization.ChartWrapper({ chartType: 'ColumnChart', dataTable: Dydata, containerId: 'visualization', legend: { position: 'bottom', alignment: 'start' }, width: 520, height: 350 }); wrapper.draw(); ```

Original source