You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the current proposal beneath. React with 👍🏻 if you like it or with 👎🏻 if you don't.
If you 👎🏻 the API, please specify why and suggest an alternative.
The API
We are suggesting the following approach.
Most of the API is the same as in #1
Unlike the case with Bar Charts, here we need to compute the value for both axis, not only the Y axis. However, the formula stays the same.
data classChartPoint(
valx:Float,
valy:Float,
)
Through the class, the user will give us the values of the Point and we will use them to compute the position in our chart. Note that the points are NOT equidistant on the X axis.
data classStackedAreaEntry(
vallabel:DataLabel,
valentries:List<ChartPoint>
)
The number of entries in data will represent the number of areas visible on the UI. entries will represent the points on the UI, just like a plain AreaChart
areaColor: Map<DataLabel, Brush>
Those colours will be used for filling the area between 2 charts.
decorationColors: Map<DataLabel, Color>
Used for the graph's line, points etc.
Styling
When it comes to styling, we decided to adopt the approach used in TextStyle: have a dedicated class for styling, with an easy to use copy method.
For all 3 charts, the styling would look like this:
Discussed in #2
Originally posted by hdralexandru April 6, 2023
📢 Place of discussion for the Area's Chart API
See the current proposal beneath. React with 👍🏻 if you like it or with 👎🏻 if you don't.
If you 👎🏻 the API, please specify why and suggest an alternative.
The API
We are suggesting the following approach.
Most of the API is the same as in #1
LineChart
data: List<CharPoint>
Unlike the case with Bar Charts, here we need to compute the value for both axis, not only the Y axis. However, the formula stays the same.
Through the class, the user will give us the values of the Point and we will use them to compute the position in our chart. Note that the points are NOT equidistant on the X axis.
lineChartStyle: AreaChartDefaults.LineChartStyle
More about this below
AreaChart
areaChartStyle: AreaChartDefaults.AreaChartStyle
More about this below
showPoints: Boolean
Whether or not to show points on the chart.
showLine: Boolean
Whether or not to show the line of the chart.
Setting to
true
will yield the same UI as the LineChart.StackedAreaChart
See Stacked Area Graph for more info about StackedAreaChart
data: List<StackedAreaEntry>
The number of entries in
data
will represent the number of areas visible on the UI.entries
will represent the points on the UI, just like a plainAreaChart
areaColor: Map<DataLabel, Brush>
Those colours will be used for filling the area between 2 charts.
decorationColors: Map<DataLabel, Color>
Used for the graph's line, points etc.
Styling
When it comes to styling, we decided to adopt the approach used in
TextStyle
: have a dedicated class for styling, with an easy to use copy method.For all 3 charts, the styling would look like this:
The text was updated successfully, but these errors were encountered: