Proposal: Area Charts API #2
hdralexandru
started this conversation in
Ideas
Replies: 2 comments
-
Similar to |
Beta Was this translation helpful? Give feedback.
0 replies
-
We should take into account this comment here as well. |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
📢 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:
Beta Was this translation helpful? Give feedback.
All reactions