PMSI-AlignAlytics / dimple

An object-oriented API for business analytics
Other
2.73k stars 556 forks source link

Coloring based on values #230

Open eox2 opened 8 years ago

eox2 commented 8 years ago

Hi

I am aware of colorAxis but it is not what I am looking for.

I want to color different ranges of values different colors to signify different things.

Currently the colorAxis just takes all your values and relative to that and generates colors relative to your other values. I want either to define the color for set ranges of values or have it generate a color based on the current value relative to the maximum possible value.

Ex: Green for values 0 and Red for 90

Thank you

johnkiernander commented 8 years ago

You can manually set the min and max for a colorAxis:

var colorAxis = chart.addColorAxis("MyDimension", ["Green", "Red"]);
colorAxis.overrideMin = 0;
colorAxis.overrideMax = 90;

Is that what you are after?

eox2 commented 8 years ago

Hi John

I already tried that. Though it is not exactly what I am after, it would still be nice if it worked properly. I assumed it would try to divide the overrideMax by the number of colors present in the color array and set specific colors for those intervals. However, this is not the behaviour that I am seeing. If i only have 2 points, even if the point is say 20 and the overridemax is 81, this point is at the other end of the extremity of colors. I am using more than just 2 colors so it is not related to a limited colour array.

Thanks