Girl Geek
Girl Geek

Reputation: 79

Highchart-treemaps equal tiles

I am trying represent JSON data in treemaps with equal squares. I found out that highchart-treemap has 4 inbuilt algorithms namely squarified, slice and dice, stripes and strip. These algorithms do not meet my requirement of getting equal tiles. Is there a way i can modify them to get the desired result? I Tried finding online for the documentation of these algorithms so that i can modify them but could not find one.

Upvotes: 0

Views: 737

Answers (1)

Kacper Madej
Kacper Madej

Reputation: 7896

Equal tiles will be set if you have such data. Title size is based on value property of each data point. Make all values equal and all tiles will have same sizes.

Example: http://jsfiddle.net/f6a48zmb/

$(function () {
    $('#container').highcharts({
        series: [{
            type: "treemap",
            layoutAlgorithm: 'stripes',
            data: [{
                id: 'A',
                name: 'Apples',
                color: "#EC2500",
                value: 1
            }, {
                id: 'B',
                name: 'Bananas',
                color: "#ECE100",
                value: 1
            }, {
                id: 'O',
                name: 'Oranges',
                color: '#EC9800',
                value: 1
            }]
        }],
        title: {
            text: 'Fruit consumption'
        }
    });
});

Upvotes: 3

Related Questions