Callback function to allow color setting on the chart ticks. #917

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

fmsf commented Dec 30, 2012

Allow the user to set a function callback for the tick colors. The callback function will be: function(value, axis_direction).

I don't know if calling "$.isFunction(axis.options.tickColor)" in the middle of a loop is a good call (as it won't change during the loop). But wanted to avoid polluting the code. And this function should always process fast.

Allow the user to set a function callback for the tick colors. The ca…
…llback function will be: function(value, axis_direction)

fmsf commented Dec 30, 2012

The use case for this was to have different tick colors on specific intervals. Like when using days: have a darker tick on 00:00 and lighter on the other ones

I would like to see $.isFunction(color) support across bar fill as well, similar to this request:

#847

It is probably reasonable to do this for any color in the options. If it's a string, use CSS, if it's an array, use a gradient, if it's a function, call the function (then apply recursively).

@fmsf is it possible for you to make the code changes for bar fill color to allow a function? This is really the feature I am after. We will need a slightly different context for the bar color fill context.

I also need to color pie slices individually :)

dnschnur added a commit that referenced this pull request Mar 7, 2013

Axis and tick color options now make more sense.
The axis color now controls the color of the axis line, instead of its
ticks and labels, while the tickColor controls the tick color. This
makes a little more sense and provides the minor feature of being able
to change the axis line color separately from that of its ticks.  Pull
request #917 ought to be easier to merge now, too.

dnschnur added a commit to dnschnur/flot that referenced this pull request Apr 6, 2013

Axis and tick color options now make more sense.
The axis color now controls the color of the axis line, instead of its
ticks and labels, while the tickColor controls the tick color. This
makes a little more sense and provides the minor feature of being able
to change the axis line color separately from that of its ticks.  Pull
request #917 ought to be easier to merge now, too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment