最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - FlotCharts two colored background - Stack Overflow

programmeradmin1浏览0评论

Using flot chart, I need to split the background into two colors. It is not going to be right down the middle, it will have a slight offset.

As of what I can see I can not find any documents on the internet that provide this information. If someone could point me in the right direction that would be great. Can someone put code in on how to do it if it is possible?

Using flot chart, I need to split the background into two colors. It is not going to be right down the middle, it will have a slight offset.

As of what I can see I can not find any documents on the internet that provide this information. If someone could point me in the right direction that would be great. Can someone put code in on how to do it if it is possible?

Share Improve this question edited Jun 19, 2013 at 20:27 alex wilhelm asked Jun 19, 2013 at 20:21 alex wilhelmalex wilhelm 2335 silver badges16 bronze badges 2
  • Please ask a question and provide what you have already tried to solve this problem. – John Koerner Commented Jun 19, 2013 at 20:25
  • My question is I do not know how to do it and i can not find it... I was thinking of using a bar and changing its opacity, would that work? – alex wilhelm Commented Jun 19, 2013 at 20:29
Add a ment  | 

1 Answer 1

Reset to default 10

If I understand your question correctly, the easiest way is to use the grid markings option.

For example:

$.plot($("#placeholder"), [ d1 ], {grid: {
    markings: [
        {xaxis: { from: 0, to: 6 },color: "#C11B17"},
        {xaxis: { from: 6, to: 100},color: "#FDD017"}
    ]}
});

Produces:

Fiddle here.

发布评论

评论列表(0)

  1. 暂无评论