0

I was wondering if it was possible to change the color of individual data points. I have tried writing my own function into it like in tickFormatter, but it doesn't seem to be working. This is kinda what I'm talking about:

graph = Flotr.draw(container, [ 
            { data : dataset, label : 'Scores1', lines:{show:true}, 
                points: {
                    show: true,
                    color: function(o){
                        return 'yellow';
                    }
                }},
            { data : patient_average, label : 'Scores2',  lines:{show:true}, points: {show:true}},
            { data : overall_average, label : "Scores3", lines : {show:true, color:'#FFCD00'}, points: {show:true, color: '#FFCD00'}}
            ], {

Right now I was just trying to get it to show yellow so that I knew that the function would work. If that works I basically want it so that depending on what the value of the data point is I would color it into a certain color. But with the code above it just displays the points as grey meaning that it doesn't understand my code. Is this even possible? Thanks for any help.

4

2 回答 2

2

请尝试使用: lines:{show: true, fill: true, fillColor:'#000000'}代替您的代码。

它应该运作良好。积分也是一样。

于 2012-11-28T08:49:59.367 回答
0

在我看来应该有'fillColor'而不是'color'。还要检查另一个属性:'fill: true'。

于 2012-08-08T07:06:56.760 回答