Skip to content

[Spec][Draft] Stepped series (DateSerie, TimeSerie, FloatSerie) #250

Closed

Description

@Seuleuzeuh

The feature
Be able to declare series for Chart with an auto generation of the labels part, accordingly to a range and step size.

API
[ class abstract BaseChartSerie ]

Property Type Description
Entries IEnumerable Get (only) the Entries
Name string Gets or sets the name of the serie
Color SkColor? Gets or sets the color of the fill

[class ChartSerie]
Inherit from BaseChartSerie

Property Type Description
Entries IEnumerable Overided for Get and set the Entries

[class abstract BaseChartEntry]
Generic BaseChartEntry with Typed Label value

Property Type Description
Value float Get the value
Label TLabel Gets or sets the caption label
ValueLabel string Gets or sets the label associated to the value.
Color SkColor Gets or sets the color of the fill.
TextColor SkColor Gets or sets the color of the text (for the caption label).
ValueLabelColor SkColor Gets or sets the color of the value label

[class ChartEntry]
Inherit from BaseChartEntry.
Equivalient of the actual ChartEntry

[class DateTimeChartEntry]
Inherit from BaseChartEntry.

[enum StepDateType]

Name Description
Day .
Week .
Month .
Year .

[class DateSerie]
Inherit from BaseChartSerie

Property Type Description
Entries IEnumerable Overided - generate Entries on get
StartDate DateTime Gets or sets the start date of the range of labels
EndDate DateTime Gets or sets the end date of the range of labels
StepType DateStepType Gets or sets the DateStepType for generating the labels
StepValueInterval int Gets or sets the number of StepType between each value
StepLabelInterval int Gets or sets the number of StepType between the drawing of label
LabelFormat string Gets or sets the datetime label formats
Values IEnumerable Gets or sets the values entries with DateTime labels

Scenario
All the 'magic' will be made during the first Get of DateSerie.Entries, and the entries will be generated accordingly to the others option of the class.
The same type of class can be applied for TimeSeries, FloatSeries, and others.
With this API Model, no change will be made of the core charts.

Additional context
Feedback required.

Activity

  1. Seuleuzeuh commented on Mar 23, 2021

    @Seuleuzeuh
    ContributorAuthor

    I've split the value generation (StepValueInterval) and the label generation (StepLabelInterval). For example : That allow user to draw a chart with daily value, but with label draw every 7 days.

    I think an other update is required to manage monthly label generation (the first of every month for example). I don't know if it's a needed feature. I need some feedback.

  2. eman1986 commented on Mar 26, 2021

    @eman1986
    Member

    this looks pretty good, I like the direction you're going with this.

  3. pinned this issue on Mar 26, 2021
  4. locked and limited conversation to collaborators on Mar 26, 2021
  5. unpinned this issue on Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions