-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColumnSeries not displayed correctly, have bug based on different data #2211
Comments
Hi @ImanGhasemiArani , We have reviewed the mentioned behavior at our end and we recommend using the plotOffset property in the primary axis. This property provides additional padding at the start and end of the plot area, ensuring that the full column series is displayed correctly at both ends of the plot area. Additionally, you can use the plotOffsetStart property to add padding at the start of the plot area and the plotOffsetEnd property to add padding at the end. Code snippet:
For further details, we have provided a link to the user guide (UG) documentation and included a demo and sample for your reference. UG link: https://help.syncfusion.com/flutter/cartesian-charts/axis-customization#offset-the-rendering. Regards, |
Thank you for your response. But the problem is not showing part of the bar at the beginning and end of the chart. This problem is solved by what you said and I solved it before. Regards, |
Hi @ImanGhasemiArani , In SfCartesianChart, the width property is used to change the width of the rectangle. The default value of the width is 0.7, and the value ranges from 0 to 1. The column segment width is calculated based on the number of series and axis visible range. You can achieve the mentioned requirement by rendering the column series with the fixed width using the ColumnSeriesRenderer and Column Segment. To render all the Column Segment with equal width for given three set of data, you can render the custom Column Segment with the fixed width in the ColumnSeriesRenderer by creating a renderer using the onCreateRenderer callback. Disclaimer: However, while rendering the Column Series with the fixed width, the Column Segment might overlap with the other Column Segment. Based on your requirement, you can modify the rendering logic. Code snippet:
Demo: Additionally, we have attached the sample and demo below for your reference and you can modify the sample according to your needs. If you have further queries, please get back to us. Sample file: 668443_same_column_width.zip Regards, |
Hi @BPraveenBalu Regards, |
We have validated your query and you can achieve the mentioned requirement using the onCreateRenderer callback in the ColumnSeriesRenderer and ColumnSegment. In the onPaint method of the custom ColumnSegment, we calculated a custom rect with a fixed width and obtained the default segment rect with series width property. If the custom rect width is smaller than the default segment rect width, the default segment rect is rendered. Otherwise, the custom rect is rendered if it is smaller. we have attached code snippet for onPaint method below. Code snippet:
Also, we have provided the demo and sample below for your reference and you can modify the sample according to your needs. Sample: 668443_column_width_responsive.zip Regards, |
Please reopen if you need further assistance on this. |
Bug description
see test record
Steps to reproduce
see test 1 and 2 and their data.
but see test 3.
test 3 is correct, but test 1 and 2 are not correct in displaying the chart.
The current problem is that the bars are shown in different sizes in each case. Here I gave 3 data sets as an example. Which is what I expect is the last one. In the first and second cases, the bars are too big and this is not acceptable.
I want the bars to be displayed as in the third case, no matter how many data I give to the chart.
Code sample
Test 1 (bug)
Test 2 (bug)
Test 3 (expected)
Screenshots or Video
Screenshots test 1 (bug)
Screenshots test 2 (bug)
Screenshots test 3 (expected)
Stack Traces
Stack Traces
-
On which target platforms have you observed this bug?
Android
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: