开发者

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

I am new to the dygraph开发者_JAVA百科s 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


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
        }
      );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜