Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Seuleuzeuh opened this issue Mar 23, 2021 · 2 comments
Closed

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

Seuleuzeuh opened this issue Mar 23, 2021 · 2 comments

Comments

@Seuleuzeuh
Copy link
Contributor

Seuleuzeuh commented Mar 23, 2021

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.

@Seuleuzeuh
Copy link
Contributor Author

Seuleuzeuh commented Mar 23, 2021

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.

@eman1986
Copy link
Member

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

@eman1986 eman1986 pinned this issue Mar 26, 2021
@microcharts-dotnet microcharts-dotnet locked and limited conversation to collaborators Mar 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants