Jeff
Jeff

Reputation: 1800

GoogleCharts - How to display data in stacked form - ComboChart

I have a chart - I want to group values by month, and stack the numbers for each month by category.

This is the data. The idea here is there is values that have dates, categories, and costs.

I'd like to display a stacked combo chart where the Y is month, the X is cost, but the bar displayed is stacked in sections by category.

Similar to something that looks like:

example:

Here's my attempt -- I'm close, I just can't get the categories to show/stack.

Code from attempt:

var options = {
    title: "Cost By Month/Category",
    tooltip: {
        showColorCode: true
    },
    isStacked: true,
    yAxis: {
        format: 'MMMM'
    },
    bars: 'vertical',
    seriesType: 'bars'
};

Any help?

Upvotes: 0

Views: 85

Answers (1)

Purvesh Desai
Purvesh Desai

Reputation: 1805

You have only one category and because of that it looks like normal combo chart if you have more than one category it will appear as stacked, for stacked chart isStacked: true will display combo chart into stacked chart.

Upvotes: 1

Related Questions