Open chenCoB opened 11 months ago
Unfortunately, it is not possible at the moment.
have you tried Transform.translate when building your TitleSide?
have you tried Transform.translate when building your TitleSide?
You're right. As we use widgets to show titles, you can wrap it with Transform widget and it should work.
The problem with this approach is that we still have to specify the reservedSize property, which takes up space on the side of the chart. If we want the chart to fill the whole parent AND have the titles inside, we can't do that as there's a forced margin in AxisChartScaffoldWidget. @imaNNeo Would it be possible to add a "useMargin" boolean or something similar to AxisChartData and then check for it in the stackWidgets function before adding the margin to the container?
In the meantime, we can use the extra lines api
extraLinesData: ExtraLinesData(
horizontalLines: [10000, 7500, 5000, 2500, 0, -2500, -5000, -7500, -10000].map((y) {
return HorizontalLine(
y: y.toDouble(),
strokeWidth: 0,
color: Colors.white.withOpacity(0.1),
label: HorizontalLineLabel(
show: true,
padding: EdgeInsets.only(left: 16.w, bottom: 2.w),
labelResolver: (p0) {
final value = (p0.y / 1000).abs();
return value.toStringAsFixed(value == value.toInt() ? 0 : 1);
},
style: TextStyle(fontSize: 12.sp, fontWeight: FontWeight.w300),
),
);
}).toList(),
),
Yes, we can do that. But the question is: should we do that?
Because there might be another solution, something like showTitlesInside: false|true
What do you think?
Any update?
Sorry for the late reply Iman, forgot this was here 😅 The only thing I cared about at the moment was showing the titles inside the chart while filling the container, so as long as that happens, the API for that can be whatever, I think.
I want to display the y-axis inside the chart, but I don’t see the corresponding configuration. Is this function available? Thanks for clearing up the confusion