Page 1 of 1

Fit BarSeries to complete chart width

Posted: Fri Jun 24, 2016 11:15 am
by Igor
Hi,

in my example project I have 500 values added to BarSeries.
Now I wonder why the BarSeries didn't use the complete chart width.
Is there a property or something like that I have to set?
FitBarSeriesToCompleteWidth.png
FitBarSeriesToCompleteWidth.png (206.49 KiB) Viewed 5275 times
thanks
Igor

Re: Fit BarSeries to complete chart width

Posted: Fri Jun 24, 2016 11:16 am
by Igor
my current chart and barSeries configuration

Code: Select all

            _chart.ColorTheme = ColorTheme.LightGray;

            _chart.ViewXY.YAxes[0].SetRange(0, 100);
            _chart.ViewXY.XAxes[0].SetRange(1, 10);

            _chart.ViewXY.DropOldSeriesData = true;
            _chart.ViewXY.XAxes[0].Visible = false;


            //Add bar series
            _barSeries = new BarSeries(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
            _chart.ViewXY.BarViewOptions.BarSpacing = 10;
            _chart.ViewXY.BarViewOptions.Grouping = BarsGrouping.ByIndexFitWidth;
            _chart.ViewXY.BarViewOptions.Stacking = BarsStacking.None;
            _chart.ViewXY.BarViewOptions.IndexGroupingFitGroupDistance = 0;
            _chart.ViewXY.BarViewOptions.IndexGroupingFitSideMargins = 5;
            _chart.ViewXY.BarSeries.Add(_barSeries);
            _chart.ViewXY.BarViewOptions.Grouping = BarsGrouping.ByIndexFitWidth;
            _chart.ViewXY.BarViewOptions.KeepBaseLevelAtAxisMinimum = true;

Re: Fit BarSeries to complete chart width

Posted: Thu Jun 30, 2016 12:56 pm
by ArctionPasi
The bar width is rounded to nearest integer pixel, when using fitting. So in this case, please don't use fitting, but set location of each bar value yourself.