We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

XAxis Date Format - Remove Generated Dates

Thread ID:

Created:

Updated:

Platform:

Replies:

151257 Feb 5,2020 09:58 AM UTC Feb 10,2020 12:08 PM UTC WinForms 3
loading
Tags: Chart
Crampo
Asked On February 5, 2020 09:58 AM UTC

Hi,
I have a stacked chart, that shows the last 7 days of data.
If i show the axis as "text" it puts the values as text i.e. 03/02/2020 , 04/02/2020 , 05/02/2020 , 29/01/2020, 30/01/2020, 31/01/2020
If i set the axis as Dateformat it correctly orders it, but it includes dates where no data exists.
Picture attached.
How do i set the chart to not include these?
(example here is 01/02/2020 & 02/02/2020)

Code used:
        Me.cht_Last7Days.PrimaryXAxis.ValueType = ChartValueType.DateTime
        Me.cht_Last7Days.PrimaryXAxis.DateTimeFormat = "dd/MM/yyyy"
        Me.cht_Last7Days.PrimaryXAxis.DateTimeRange = New ChartDateTimeRange(StartDate, StartDate.AddDays(6), 1, ChartDateTimeIntervalType.Days)

Thanks




Attachment: chart_946ecc76.zip

Hemalatha Marikumar [Syncfusion]
Replied On February 6, 2020 01:14 PM UTC

Hi Crampo, 
  
Greetings from Syncfusion. 
  
You achieve your requirement by setting the Indexed as True as per the below code snippet. 
  
Code Snippet [Xaml]: 
  
Me.cht_Last7Days.PrimaryXAxis.Indexed = True 
  
  
Please let us know if need any further assistance on this. 
 
Regards,
Hemalatha M. 


Crampo
Replied On February 7, 2020 02:32 PM UTC

Hi Crampo, 
  
Greetings from Syncfusion. 
  
You achieve your requirement by setting the Indexed as True as per the below code snippet. 
  
Code Snippet [Xaml]: 
  
Me.cht_Last7Days.PrimaryXAxis.Indexed = True 
  
  
Please let us know if need any further assistance on this. 
 
Regards,
Hemalatha M. 


Hi,
Thanks For your reply.
Unfortunatly when i add 
"cht_Last7Days.PrimaryXAxis.Indexed = True"
It tells me that this property is not used anymore.
And doesnt have any affect on the outcome of the chart.

Best Regards
Alex

Hemalatha Marikumar [Syncfusion]
Replied On February 10, 2020 12:08 PM UTC

Hi Crampo, 
  
We would like to let you know that Indexed property is working fine at our end. Please find the tested sample from below link. 
  
  
Screenshot
Before setting Indexed 
After setting Indexed 
 
 
  
As we can't know your exact application scenario, couldn't replicate the issue in your case. Could you please provide the complete chart control code snippet which is used in your application? If possible, can you please revert us by modifying the provided sample based on your application along with replication procedure. This will be helpful for us to provide you better solution at the earliest. 
 
Regards,
Hemalatha M. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon