oxyplot / documentation-examples

examples used in the documentation
MIT License
43 stars 145 forks source link

Xamarin Forms add itemsource to var barSeries = new ColumnSeries from ObservableRangeCollection #16

Open ArimaSD opened 5 years ago

ArimaSD commented 5 years ago

Hi, I want to populate itemsource items with: var items = Registrar.OrderBy(c => c.Especie).Select(x => x.Ancho).ToList();

I was thinking of something like this perhaps??

var barSeries = new ColumnSeries { ItemsSource = new List(new[] { new BarItem{ Value = Registrar.OrderBy(c => c.Especie).Select(x => x.Ancho), },

             }),
            LabelPlacement = LabelPlacement.Inside,
            LabelFormatString = "{0}"
        };
ArimaSD commented 5 years ago

ItemsSource = Registrar.OrderBy(c => c.Especie).Select(x=> new BarItem() { Value = x.Ancho }).ToList();

Solved