Float chart, problem with small Y values

49 views
Skip to first unread message

Забуга Татьяна

unread,
May 26, 2015, 11:28:03 AM5/26/15
to flot-...@googlegroups.com

Hello! Can anybody help me (

I try to draw chart, but when numbers on Y asix is small (for ex: 5.4,   3,1,    4.3) I get problem with fill color. It fill chart not from bottom to line, but from line to top!

       $scope.zeroSectionOptions = {
                series: {
                    stack: 0,
                    lines: {
                        lineWidth: 1,
                        show: true,
                        fill: true,
                        steps: false
                    },
                    bars: {
                        show: false,
                        barWidth: 0.4
                    }
                },
                xaxis: {
                    color: '#eee',
                    mode: "time",
                    timeformat: "%Y-%m-%d"
                },
                yaxis: {
                        min: 0,
                        max: 10,
                        color: '#eee'
                           },
                grid: {
                    hoverable: true,
                    clickable: false,
                    borderWidth: 0,
                    aboveData: false
                },
                legend: {
                    show: true,
                    noColumns: 3
                },
                points: {
                    show: false
                },
                tooltip: false,
                tooltipOpts: {
                    defaultTheme: false,
                    content: "<span>%x</span> : <span>%y</span>"
                }
            };

            $scope.zeroSection = [
                {
                                   data:  data,
                    color: $rootScope.settings.color.themethirdcolor
                }
            ];
            var plot = $("#zero-section").plot($scope.zeroSection, $scope.zeroSectionOptions).data("plot");




Ced

unread,
May 26, 2015, 1:27:00 PM5/26/15
to flot-...@googlegroups.com
I suspect some of your data may have a 3rd coordinate.  For example, one of your data points might look like: [0, 5.4, 10]
I see you have bars disabled.  The bars and fill features both use the 3rd coordinate so maybe you have a conflict there.
For bars, the 3rd coordinate allows you to specify where the bar starts.
For line fill, the 3rd coordinate allows you to specify where the fill starts.

Several other plugins use additional coordinates and sometimes the plugin does this internally so you don't even know about it.

I don't know if this applies to you but in some cases it is useful to pass your own custom values using this method.  However, you need to make sure it will not conflict with the plugins or plot types you are using.  For that reason, it is generally safer to use the 4th coordinate (or 5th depending on the plugins)
eg. [0, 5.4, null, 10]

Забуга Татьяна

unread,
May 27, 2015, 10:52:18 AM5/27/15
to flot-...@googlegroups.com
Yes! Thanks a lot! It was the problem... there were 3 number in  array! 

вторник, 26 мая 2015 г., 20:27:00 UTC+3 пользователь Ced написал:
Reply all
Reply to author
Forward
0 new messages