Remove empty zone in bar chart
Hello,
I'm using the bar chart, but my data have some missing value so the Chart display empty zone :
The "ChartEmptyPointSettings" in Drop mode don't hide this empty zone.
What is the solution to hide this empry zone without adding the missing data ?
Thanks by advance for your answer.
Regards,
Hi Alexandre,
We have analyzed your query and found that we do not have the support to remove the empty zone using the “ChartEmptyPointSettings” property. It only supports linear charts. Therefore, we suggest filtering the datasource with the code snippet provided below to remove the empty zone. For your reference, we have attached a sample and screenshot. Please check the code snippet provided below.
|
protected override void OnInitialized() { filteredDataSource = MedalDetails.Where(item => item.Y != 0).ToList(); } |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/RemoveEmptyZone-573279260.zip
Screenshot:
Kindly revert us if you have any concerns.
Regards,
Gopalakrishnan Veeraraghavan
The solution suppose that my data are continous and have Y to zero. But they do not exist in my list.
For exemple, my data are based on DateTime like this :
Value1 : 10/01/2023 1:30 ; 10
Value2 : 10/01/2023 2:00 ; 110
Value3 : 10/01/2023 2:30 ; 150
Value4 : 10/01/2023 3:00 ; 2300
Value5 : 10/01/2023 5:00 ; 50
between Value 4 et Value 5 no data exist in the list, but hte chart create empty value, how to hide it on the chart ?
Hi Alexandre,
We recommend changing the value type of the X-axis of the chart to “DateTimeCategory” in the ChartPrimaryXAxis property in order to eliminate the empty space in the chart. We have included a sample and a screenshot for your convenience. Please refer to the code snippet below.
|
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTimeCategory" /> |
Screenshot:
Kindly revert us if you have any concerns.
Regards,
Gopalakrishnan Veeraraghavan
Yes ! It's working well :)
I need now to create dynamic grouping for X axis Label, it's another story.
Thanks to you.
Regards,
Alexandre
Hi Alexandre,
Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.
Regards,
Gopalakrishnan Veeraraghavan
- 5 Replies
- 2 Participants
-
AC Alexandre CLAVERIE
- May 19, 2023 03:10 PM UTC
- May 24, 2023 07:16 AM UTC