Mennims

Heatmap gradient start and end color range

Recommended Posts

Hi,

I'm trying to make my heatmap chart gradient range from white to red.

If I specify the red color code in the color range object for the chart it will range from black to red, which is not ideal for my use case.
To fix this I'd have to do the following
 

"colorRange": {
    "gradient": "1",
    "minValue": "0",
    "code": "#ffffff",
    "startLabel": "Poor",
    "endLabel": "Good",
    "color": [
    {
        "code": "#FF0000",
        "maxValue": "666"
    }]
}

This works as expected, however the problem is that I have to specify the max value, which means I need to find the highest value column in the heatmap chart and apply that value to the maxValue key, which makes this far less convenient than it could be.

It would be great if I could do something like this

"colorRange": {
    "gradient": "1",
    "minValue": "0"
    "startCode": "#ffffff",
    "code": "#FF0000",
    "startLabel": "Poor",
    "endLabel": "Good"
}

Which would result in the following

image.png.75cc727b53c955bf869da53cde37e4df.png

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hi,

The gradient legend is showcasing a pane which is derived from the "colorRange" definitions where the color objects need to define for numeric range blends with the next color allowing to form a gradient strip.

According to your use case you need to set color object from lower to higher value i.e from white to red. For reference please check http://jsfiddle.net/Soumya_dutta/ema79zrf/2/ where the generic definition is provided within "colorRange" object and each color object defining the specific numeric range corresponding to a particular color.

Hope this would help.

Share this post


Link to post
Share on other sites

Hi Soumya,

Thank you for taking your time to help me out with this, however I don't think you understand what my request is.

I know how to make it work properly with the colorRange object, the problem I have is that I have to enter a max value, which won't always be static. I won't always have values ranging from 1-10, depending on data it might be from 1 to 666.

I'd like FusionCharts to determine the max value for me, it could look at the cell that has the highest value and set the maxValue internally for me.

I suggest having a look at my example JSON again, I provided an example of the JSON I'd like to provide FusionCharts to get the desired effect.

Keep in mind that FusionCharts knows how to determine the max value automatically, because if you do not provide the colorRange object, and just a single colour, it automatically determines the gradient of the colour from 1 to the highest value cell in the chart.

The problem I have with this is that it only allows a range from BLACK to the specified colour, instead of a specified colour to a specified colour.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now