开发者

Peity Sparklines , customizing

We are using this excellent plugin for some small sparkline charts.

Issue I have is changing colours of the sparklines, sizes etc. The documentation is very brief.

We are using LINE and BAR charts.

Can someone point me in the right direction, please. Or do a quick snippet with custom colours, and size configurations for the sparkline types we need.

http://benpickles.github.com/peit开发者_开发百科y/


Hey, have a look here : http://jsfiddle.net/jpz3m/

Basically you can setup the colors when initializing the plugin :

$(".line").peity("line",{
    colour: "#FF2200",
    strokeColour:"#882200",
    strokeWidth:2,
  }
);

The default options are :

$.fn.peity.defaults.pie = {
  colours: ["#FFF4DD", "#FF9900"],
  delimeter: "/",
  radius: 16
};

$.fn.peity.defaults.line = {
  colour: "#c6d9fd",
  strokeColour: "#4d89f9",
  strokeWidth: 1,
  delimeter: ",",
  height: 16,
  max: null,
  width: 32
};

$.fn.peity.defaults.bar = {
  colour: "#4D89F9",
  delimeter: ",",
  height: 16,
  max: null,
  width: 32
};


Just in case you need to use a vanilla js version of peity charts - https://github.com/railsjazz/peity_vanilla

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜