UI-For-UWP icon indicating copy to clipboard operation
UI-For-UWP copied to clipboard

Range support for SeriesDescriptor.CollectionIndex

Open zateutsch opened this issue 3 years ago • 0 comments

Summary

More dynamic usage of CollectionIndexes for SeriesDescriptors could add some flexibility to dynamic Chart creation. In my current fork of the repo, I have the CollectionIndex property functioning as a range start point:

A SeriesDescriptor with a CollectionIndex of 2 will effect every Series style from index 2 on, up until the next CollectionIndex on a new SeriesDescriptor.

API Changes

Potential API Changes:

  • Functionality change to ChartSeriesProvider.GetDescriptor to switch to ranges
  • Addition of SeriesDescriptor.RangeIndex property to describe range behavior separate from existing CollectionIndex behavior

My current hacky implementation of ChartSeriesProvider.GetDescriptor for ranges: Getting a max descriptor index implementation

Intended Use Case

Intended use case would be for adding a dynamic number of series to a chart that could all have different styles. Range support would allow you to "section off" portions of your ObservableCollection and DataBind to indexes to keep the chart dynamically updating.

Another potential change would be to change the SeriesProvider to allow multiple ObservableCollections, where each Collection represents a unique styling,but this change looks considerably less practical given current architecture.

zateutsch avatar Oct 07 '21 21:10 zateutsch