google / charts

https://pub.dev/packages/charts_flutter
Apache License 2.0
2.81k stars 1.2k forks source link

Legend with "bottom" position has width limited by chartArea #794

Open php4fan opened 1 year ago

php4fan commented 1 year ago

image

The graph above has these options:

options.legend = {
                    position: 'bottom'
                };
                options.chartArea = {
                    top: 12,
                    width: '85%',
                    left: '12%'
                }

Since the legend has position "bottom", I expect it to occupy the whole available width (with whatever margin/padding you deem reasonable, evenly distributed by default between left and right), regardless of the chartArea.

Having the width of a bottom-positioned legend be limited by the witdth of the chartArea (and the same would go for the height of a left- or right-positioned legend) could be a desirable option to have, but it cannot be the only available option. If you want to allow that, you should provide options for the legend area (such as width, height, left, top, etc) which currently don't exist.