2014-01-28 53 views

回答

1

看起來像flot填充堆棧插件的錯誤。我能想到的唯一快速解決方案就是將數據複製爲兩組數據。第一個繪製的線條和填充,第二頂部只是點:

someData = [[1, 3], 
      [2, 16], 
      [3, 3], 
      [4, 3], 
      [5, 8], 
      [6, 12], 
      [7, 3]]; 

var dataset = [ 
    {color: "#edc240", data: someData, stack: 1, lines: {fill: 1, show: true}, points: {show: false}}, 
    {color: "#afd8f8", data: someData, stack: 1, lines: {fill: 1, show: true}, points: {show: false}}, 
    {color: "#cb4b4b", data: someData, stack: 1, lines: {fill: 1, show: true}, points: {show: false}}, 
    {color: "#4da74d", data: someData, stack: 1, lines: {fill: 1, show: true}, points: {show: false}}, 
    {color: "#edc240", data: someData, stack: 2, lines: {show: false}, points: {show: true}}, 
    {color: "#afd8f8", data: someData, stack: 2, lines: {show: false}, points: {show: true}}, 
    {color: "#cb4b4b", data: someData, stack: 2, lines: {show: false}, points: {show: true}}, 
    {color: "#4da74d", data: someData, stack: 2, lines: {show: false}, points: {show: true}} 
]; 

$.plot("#flot", dataset, {}); 

小提琴here

產地:

enter image description here

+0

謝謝您的回答!目前這看起來是最合理的方法。 – Vilis