[英]Remove Dot From the Y-axis Morris Line Chart
我已使用以下代碼實現了Morris Line Chart
,並且運行良好。
但是我需要在第二行名稱中對目標進行一些修改。 您已經看到每個月都有斑點出現。 我想從那條線中刪除這些點,以便我成為一條直線。
Morris.Line({
element: 'line-chart',
data: JSON.parse(GraphData),
xkey: 'title',
ykeys: ['goal', 'actual'],
labels: ['Goal', 'Actual'],
xLabelFormat: function(x) { // <--- x.getMonth() returns valid index
var month = months[x.getMonth()];
return month;
},
dateFormat: function(x) {
var month = months[new Date(x).getMonth()];
return month;
},
resize: true,
lineColors: ['#ecb201', '#1B17BB'],
gridTextFamily: "'Nunito', sans-serif",
gridTextWeight: '300',
gridTextSize: 11,
gridTextColor: '#090b0d',
pointSize: 4,
lineWidth: 2,
pointStrokeColors: ['#ffffff', '#ffffff'],
});
嘗試將pointSize更改為0。在開始時將pointSiZe設置為0。
Morris.Line({
element: 'line-chart',
pointSize: 0, ....
)}
呈現圖表后,請使用此腳本。
$(document).ready(function(){
$('circle[fill="#ecb201"]').each(function(i,el) {
//console.log($(this).attr("r" , 0));
$(this).removeAttr("r");
$(this).removeAttr("cy");
$(this).removeAttr("cx");
});
});
但是在懸停時它將再次顯示這些點。 多數民眾贊成在唯一的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.