Hello
I am using your cartesian-charts package.
What we are currently trying to implement is that we need to use two annotations per chart.
And there are 20 pieces of data in total.
However, it is not displayed in the first data (index 0) and the last data (index 19).
(if the x value is 0 or 19)
Index1-18 shows it normally.
https://help.syncfusion.com/flutter/cartesian-charts/annotations
The sample code posted on the link above cannot be expressed normally.
I will also attach the sample code.
x: 1, y: 10 -> show
x: 0, y : 10 -> disappear
|
CartesianChartAnnotation(
widget: Text(
'Me',
style: TextStyle(
color: Color(0xFFD4D4D4),
fontSize: 18,
fontWeight: FontWeight.bold),
),
coordinateUnit: CoordinateUnit.point,
horizontalAlignment: ChartAlignment.near,
x: 0,
y: 10) |
Hi!
How can I know to distinguish between the cases?
I wanted to know if the annotation in the plot area, I want it be is in the center. if there is an overflow from the right I want to use ChartAlignment.far and if there is an overflow from the left, I want ChartAlignment.near.
Hi Iyar Avital,
Currently, in our chart widget, the annotation which gets overflowed out of the plot area will get hidden and we don’t have any way to check whether the annotation is overflowing or not out of the plot area. However, we can achieve this by using a workaround but that will not be a straight forwarded method and is not suitable for the annotation feature. Sorry for the inconvenience.
However, we would like to let you know that we have data label support which we suspect can be helpful in your case if you can provide us with your exact requirement or what you are trying to achieve. So that we can further analyze to provide the solution sooner.
Please find the references for the data label feature.
Data label user guide: https://help.syncfusion.com/flutter/cartesian-charts/marker-datalabel#data-label
Data label event customization user guide: https://help.syncfusion.com/flutter/cartesian-charts/callbacks#ondatalabelrender
Regards,
Sriram Kiran