使用Highcharts创建热图的语法 [英] Syntax to create a heat map with Highcharts

查看:177
本文介绍了使用Highcharts创建热图的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个热图,但没有'时间'和整数作为X和Y轴(实际上在Highcharts的例子中 http://jsfiddle.net/9pJhF/ 它使用csv与整数和数据时间),但与字符串,类似的东西:

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

我想知道当我们不使用csv或技巧来规避csv字符串的问题时,如何实现data变量。

  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
},




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.

解决方案

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
    },

这篇关于使用Highcharts创建热图的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆