简体   繁体   English

从Y轴莫里斯折线图中删除点

[英]Remove Dot From the Y-axis Morris Line Chart

I have implemented the Morris Line Chart with the following code and this is working well. 我已使用以下代码实现了Morris Line Chart ,并且运行良好。

But I need some modifications in the second line name with the goal. 但是我需要在第二行名称中对目标进行一些修改。 You have seen dots come on every month. 您已经看到每个月都有斑点出现。 I want to remove these dots from that line so that I will be a straight line. 我想从那条线中删除这些点,以便我成为一条直线。

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'],
});

莫里斯折线图

Try to change pointSize to 0. Set pointSiZe: 0 at the begining 尝试将pointSize更改为0。在开始时将pointSiZe设置为0。

Morris.Line({
    element: 'line-chart',
    pointSize: 0, ....
)}

use this script after you render the chart. 呈现图表后,请使用此脚本。

$(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");

        });
    });

but on hover it will show those points again . 但是在悬停时它将再次显示这些点。 thats the problem only. 多数民众赞成在唯一的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM