imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.87k stars 1.78k forks source link

more a question: Show titles before / beyond meta.min / max? #1703

Closed Tobbyte closed 4 months ago

Tobbyte commented 4 months ago

Hey and thanks again for your great library!

I'm facing a challenge with your LineChart and I hope you can offer some advice. I've implemented zoom and scroll functionality on the chart by scaling the LineChartData 's minX and maxX values. While everything works well, I'm having an issue with the (bottom) titles.

Currently, the titles only appear within the visible chart area when their corresponding data point (FlSpot) comes into view. Ideally, I'd like them to render before their associated FlSpot enters the chart, allowing them to scroll smoothly into view. This problem exists because I show (long) dates as title and I've rotated my titles by -35 degrees, causing them to abruptly appear on the right side of the chart. (Rotating them positively (+35 degrees) would make them appear on the left side.)

Do you have any suggestions on how to achieve this pre-rendering of rotated titles, allowing them to scroll smoothly with the chart?

tl;dr The goal is to display titles outside the visible data range for smooth scrolling into view.

look at the bottom right:

https://github.com/imaNNeo/fl_chart/assets/7722596/e50d99c4-1adc-4275-9a5a-f407a55b94c3