jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – Flot Chart – 根据数据不同的线和点颜色大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有dis / likes的折线图.正值应为深绿色边框,红色值为深红色边框.此外,红点应填充红色,而不是绿色.

这是它的样子!

它应该是这样的

几个小时后,我无法得到任何解决方案,所以欢迎任何帮助.这是我的代码

$.plot("#curvePlaceholder",[{
    data: data,color: "#83ce16",threshold: {
        below: 0,color: "#c00000"
    },lines: {
        fill: true,lineWidth: 3,fillColor: {
            colors: [{ opacity: 1 },{ opacity: 1 } ]
        }
    }
}],{
    series: {
        lines: {
            show: true,fill: true
        },points: {
            show: true,fillColor: '#83ce16'
        }
    },grid: {
        hoverable: true,clickable: true,BACkgroundColor: 'transparent',color: 'transparent',show: true,markings: [
            { yaxis: { from: 0,to: 0 },color: "#737374"}
        ],markingsLineWidth: 6
    },yaxis: {
        show: false,<?=$chart_data['ymin'];?>
        <?=$chart_data['ymax'];?>
    },xaxis: {
        show: false,min: -0.4
    }
});

解决方法

获得你想要的外观的最简单方法删除阈值插件并将其拆分为两个系列:

[{
    data: [[0,0],[5,1],[7,0]],{ opacity: 1 } ]
        }
    },points: {
        show: true,fillColor: '#83ce16'
    }
},{                           
    data: [[7,[11,-1],color: "#c00000",fillColor: '#c00000'
    }
}],

小提琴here.

大佬总结

以上是大佬教程为你收集整理的jquery – Flot Chart – 根据数据不同的线和点颜色全部内容,希望文章能够帮你解决jquery – Flot Chart – 根据数据不同的线和点颜色所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。