Syntax to create a heat map with Highcharts

2020-04-20 12:29发布

问题:

I would like to do a heat map but without 'time' and integer as X and Y axis (In fact in the example of Highcharts http://jsfiddle.net/9pJhF/ it use csv with integers and data time) but with the strings, something like that:

'Name1','A',3077
'Name2','B',5486
'Name3','A',377
'Name4','B',546
'Name5','A',77
'Name6','B',46

I would like to know how is implemented the data variable when we not use the csv or a trick to circumvent the problem with csv strings.

回答1:

You can use something like this

xAxis: {
        //type: 'category',
        categories: ['Name1','Name2','Name3'],
        tickInterval:  1,
        gridLineWidth: 1,
        tickLength: 0,
        lineWidth: 0,
        min: 0, 
        max: 2
    },

    yAxis: {
        categories: ['Name1a','Name2a','Name3a'],
        tickInterval:  1,
        title: {
            text: null
        },
        minPadding: 0,
        maxPadding: 0,
        startOnTick: false,
        endOnTick: false,
        tickLength: 0,
        lineWidth: 0,
        min: 0,
        max: 2
    },
  • http://jsfiddle.net/tZ6GP/5
  • http://jsfiddle.net/tZ6GP/6