Replies: 3 comments
-
Hi, what if you pass an empty |
Beta Was this translation helpful? Give feedback.
-
That is what I do - I return a Container. Returning a SizedBox does not seem to make a difference.
I am no expert here. Looking at the CPU profiler, it shows that a lot of time is spent in performLayout, and visitChildrenForSemantics. All this is gone if I pick an interval of say 50. But, as I pointed out above, fixed intervals do not work for a timeline as years do not have a fixed number of days. |
Beta Was this translation helpful? Give feedback.
-
BTW, I ended up writing a custom widget for my data axis in order to have full control as to when draw labels on the X axis (sometimes yearly, quarterly, monthly). |
Beta Was this translation helpful? Give feedback.
-
I am using LineChart to plot data against arbitrary time periods.
Sometimes those time periods are very long (say 10 years and more).
Depending on the chose reporting period, I only show selected dates on the Y axis.
Sometimes, the first days of a quarter, or only the years, or only every 3 years, or only every 5 or 10 years.
My issue: in order to decide which labels to draw, I set the
interval = 1
in the SideTitles. However, that makes the layouting slow for long reporting periods - there are too many (empty) widgets createdI think I cannot use the any interval other than 1, because a) the reporting period can start at any time (there is no "starting offset"), and b) quarters or years do not have a fixed length (think about leap years).
What are my options to address this?
checkToShowTitle
method. Are there plans to re-introduce such a method?The chart looks something like this:
Here are some code fragments as of today:
Looking at the profiling information, drawing the data series with that many data points is not the problem. The layouting of the axis widgets appears to be the problem. If I remove the axis titles (or set a sufficiently high interval), the the performance is acceptable.
I appreciate any hints.
Beta Was this translation helpful? Give feedback.
All reactions