FormidableLabs / FormidableLabs/victory-native-xl
Combined Enhancement Request for AxisOptions and Negative Value Representation in Charts
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 3
Description
### Description of AxisOptions Enhancement
I propose an enhancement inspired by VictoryChart's axisOptions. The main improvement involves allowing for the external provision of a labelComponent using native Skia for enhanced visual quality and functionality.
Currently, a limitation in handling multi-line text, such as needing to display "month" and "day" on separate lines in contentX, exists due to Skia's inability to process '\n'. Furthermore, the mandatory font requirement in Skia is restrictive for projects that do not utilize fonts, which can affect the display of axes. Making fonts optional would increase the flexibility and usability of our charts.
### Proposal for AxisOptions
The enhancement would be to expand axisOptions to include the capability for a custom labelComponent. This would enable the creation of more personalized and complex label designs, overcoming the limitations posed by Skia's text rendering and font requirements. Allowing users to develop their own label components would accommodate specific needs such as multi-line text and support projects that do not rely on fonts.
### Description of Negative Values Enhancement
Additionally, I propose an improvement in the visualization of negative values on our charts. The chart should extend downwards for negative values, contrasting distinctly against the positive values, as depicted in the attached image. This feature is crucial for accurately conveying data, as it prevents misinterpretation by providing a clear visual distinction between positive and negative values.
### Proposal for Negative Values
I recommend updating the chart rendering logic to mirror the visual representation seen in the attached image. This involves shading the area below the zero line when negative values are present and adjusting the chart's fill logic to proportionally represent the magnitude of negative versus positive values. This enhancement is essential for an intuitive data representation and is especially important in analyses where negative values have significant analytical weight.

Contributor guide
Research direction
Start by locating the axisOptions handling and the chart rendering logic described in the issue; no specific files or tests are named. Define completion as supporting externally supplied label components and optional fonts, while rendering negative values below the zero line with proportional fill.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- frontend, mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100