Search code examples
javascriptjquerygraphflot

Flot graph changes tick label color with zoom plugin and rotate ticks on canvas


I'm trying to have a flot graph with time stamps on the x-Axis. These are pretty large so I tried to use the rotateticks plugin. It all works fine, but one thing seems to be odd. I also use the navigate plugin to zoom with the mousewheel and pan the graph. If I do the zooming or panning however, the color of the plot ticks change to the color of the data series. I want them to stay black instead.

I use plotting on canvas also.

Do you have any suggestions?


Solution

  • I didn't get a minimum example to work, I apologize, but I managed to solve my issue and I want to share it here just in case someone comes across.

    It's a rather crude fix but in jquery.flot.tickrotor.js line 173 I added:

    ctx.fillStyle = "#000000";

    This will hard set the drawn text in the canvas to the color I wanted (black).