user21293
user21293

Reputation: 6469

dygraphs - getting rid of black x and y axis for "sparkline"-style chart?

I am new to the dygraphs library, and am trying to generate a "sparkline"-style chart that is very small, I can get the size and everything right, but I can't seem to get rid of the black x and y-axes. Is there a way to set the color of the axes in dygraphs?

Thanks, Ben

Upvotes: 0

Views: 734

Answers (1)

Cameron Goodale
Cameron Goodale

Reputation: 432

Ben,

Check out:

http://dygraphs.com/tests/unboxed-spark.html for the full source of a working demo.

Here is the bit I think you are interested in. You just need to set the drawXAxis and drawYAxis to false to make a sparkline style chart. You just make them non-visible and don't have to worry about changing colors.

  var show_box = false;
  g = new Dygraph(
        document.getElementById("div_g"),
        data, {
          drawXAxis: show_box,
          drawYAxis: show_box,
          drawXGrid: show_box,
          drawYGrid: show_box
        }
      );

Upvotes: 2

Related Questions