Highcharts Heatmap colorAxis不会停止渐变

时间:2016-11-09 14:47:18

标签: javascript jquery highcharts colors heatmap

我已使用highcharts模块热图成功创建了热图

这些示例显示了如何设置颜色,并定义了多个色标,在两个停止点之间有一个漂亮的颜色渐变。当我尝试定义颜色停止时,我没有得到停止之间的平滑渐变,每个值似乎接近最近的停止...

我有一个小提琴来展示这个http://jsfiddle.net/qpe3bqbx/2/

我想知道这是因为我使用了9个停靠点,而不是示例中的3个停靠点。是否有最多停靠点?

    -- ================================================
-- Template generated from Template Explorer using:
-- Create Scalar Function (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION ISINTEGER
(
    -- Add the parameters for the function here
    @SINT nvarchar(20)
)
RETURNS int
AS
BEGIN

    IF LEN(@SINT) = 0 
        RETURN 0;

    IF LEFT(@SINT, 1) IN('+', '-') AND LEN(@SINT) > 1
        RETURN CASE WHEN SUBSTRING(@SINT, 2, 1) IN ('+', '-') THEN 
                                        0 
                                    ELSE   
                                        DBO.ISINTEGER(RIGHT(@SINT, LEN(@SINT) - 1)) 
                                    END;        

    RETURN CASE WHEN @SINT NOT LIKE '%[^0-9]%' THEN 1 ELSE 0 END;

END
GO

以下是原始示例http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/maps/demo/heatmap/

1 个答案:

答案 0 :(得分:2)

原来你不能将六角颜色与颜色名称混合......它无法定义#00007F和蓝色之间的渐变,所以你必须使用:

stops: [
            [0, '#00007F'],
            [0.125, '#0000ff'],
            [0.25, '#007FFF'],
            [0.375, '#00ffff'],
            [0.5, '#7FFF7F'],
            [0.625, '#ffff00'],
            [0.75, '#FF7F00'],
            [0.875, '#ff0000'],
            [1, '#7F0000']