Initial Gridline / Label Control

Hi,

I have a chart that starts on June 21st and ends on July 22nd (as shown in the attached).

I would like there to be just one major gridline and label on July 1st, and neither a label nor a gridline at the minimum and maximum chart dates (June 21st and July 22nd), as there is currently. It seems that the first label is always generated at the minimum chart date, however.

Would it be possible to have, as I say, just the one label and gridline on July 1st?

Many thanks for your time,

James



Attachment: Simulator_Screen_Shot__iPhone_12_Pro__20210722_at_17.02.43.png_c18a04df.zip

12 Replies 1 reply marked as answer

DP Dharanitharan Palanisamy Syncfusion Team July 23, 2021 02:14 PM UTC

Hi James, 
 
We have looked over your situation and created a sample that meets your needs. For your request, we used the minimum, maximum, visibleMinimum, and visibleMaximum attributes. Please utilize the sample and screenshot for your reference, and if you believe we misunderstood your query, please respond with more specifics. This will help us assess and provide a solution to you as soon as possible. 
 
 
Screenshot: 
 
            
 
Thanks,
Dharanitharan. P
 



JA James July 23, 2021 03:40 PM UTC

Dear Dharanitharan,


Thank you for your time with this issue - unfortunately, however, your solution isn't what I'm looking for.


I attach three figures that I hope better explain what I'm after.


Figure 1:

This is current behaviour, and is the same as the first screenshot you send me. However, what I would like would for the 1st July gridline to appear on the second screenshot​.


Figure 2:

This is similar to your second screenshot, but notice that the gridlines are not on July 1st.


Figure 3:

This is the behaviour that I am looking for: that the visibleMinimum and visibleMaximum are such that the data fills the whole chart, but that the gridline is still on July 1st.​


The best solution to this might be through a callback that determines whether the label is rendered. So, for my situation, I could pass:


shouldRenderLabelAndGridline: (DateTime dateTime) => dateTime.day == 1;


Thanks again for your time,

James


Attachment: Gridlines_issue_cd1c1020.zip



JA James July 27, 2021 01:15 PM UTC

Hi Dharanitharan,


Just wondering whether you had any updates on this?


Thanks,


James



DP Dharanitharan Palanisamy Syncfusion Team July 27, 2021 01:47 PM UTC

Hi James, 
 
Thanks for being patience. We have analyzed your query and thanks for your explanation and screenshot of your requirement. We would like to point out that your need for a single grid line and data label is not possible by default. Because the gridlines and data labels are drawn using the data and interval provided and it is changing when panning. So, we met your demand by customizing the data label with the axisLabelFormatter call back and drawing the vertical line using plotBands, which is equivalent to the grid line. We have attached a sample and screenshot for your review and revert us if you require any further assistance on this. 
 
 
Screenshot 
 
 
 
Thanks, 
Dharanitharan. P 
 
 



JA James July 27, 2021 02:24 PM UTC

Dear Dharanitharan,


Thank you for your help.


However, I have found that on panning, the label will often not render. I attach some screenshots showing the issue. 


Rendering the labels as a function of the actualText is a great idea, however in most instances there is not a label with an actualText of, say, 'Jul 1'.


Perhaps if there was a label for each date then the label for July 1st would always render (i.e. whatever the visibleMinimum was).


Again, thank you for your time - we are getting so close!


James


Attachment: panning_issue_f23d9a56.zip


DP Dharanitharan Palanisamy Syncfusion Team July 29, 2021 01:26 PM UTC

Hi James, 

Most Welcome and we have looked into your request and would like to suggest the following options for meeting your needs. As previously stated, grid lines and data labels are produced dependent on the data and the axis interval, thus there are two approaches to accomplish your needs. One is to use the label formatter call back, like in the previous update, and the other is to use annotation in which plotBands for the grid line requirement is common in both approaches. Please see the sample below with annotations for your reference, and please contact us if you require any additional assistance. 

 
Thanks, 
Dharanitharan. P 


Marked as answer

JA James replied to Dharanitharan Palanisamy July 30, 2021 12:54 AM UTC

Dear Dharanitharan,


Thank you so much for your help with this issue, you've been fantastic.


Given that we are kind of 'hacking' here, I was wondering whether precise label/gridline control (i.e. a means to solve this cleanly) was on the roadmap?


Best,


James



DP Dharanitharan Palanisamy Syncfusion Team July 30, 2021 12:48 PM UTC

Hi James, 
 
Most Welcome and thanks for your response. We have investigated it and can tell you that this requirement is not a necessity that most users have, and it varies from user to user. As a result, we have no plans to include this in future releases and would wish to end with this workaround. Please contact us if you require any additional assistance. 
 
Thanks, 
Dharanitharan. P 



JA James replied to Dharanitharan Palanisamy July 31, 2021 03:41 PM UTC

Dear Dharanitharan,


I would agree that, obviously, just wanting to render a label/gridline for July 1st is not a necessity for your users!


I chose July 1st as an example - what I'm really trying to do is to render labels and gridlines programatically. I've got the workaround that you kindly provided to work in my case, but I had to make numerous other hacks for the correct look.


Do you not think that the capacity to render gridlines/ labels programatically is fairly basic functionality? It seems to me that in any use case where the chart's boundaries are, say, the past n-days, then you would want the gridlines at meaningful intervals.


Suppose, for example, you want the chart to display the past 365 days of some time series. Surely then you would want gridlines at the first of each month, and not somewhat arbitrarily (e.g. 20th of each month) as they are in the present implementation?


Perhaps I've not been so clear, so apologies if that is the case. I really think that this would be a massive improvement to the package.


Many thanks your patience,


James



DP Dharanitharan Palanisamy Syncfusion Team August 2, 2021 07:44 AM UTC

Hi James, 
 
Thanks for your suggestion and would like to ask you for more details like the competitor’s reference links will help us to analyze this and after the validation, we will consider this a new feature request and provide this support. 
 
Thanks, 
Dharanitharan. P 



JA James replied to Dharanitharan Palanisamy August 4, 2021 12:45 AM UTC

Dear Dharanitharan,


I'm not quite sure what you mean by competitor's reference links, but I attach some images with what I've achieved (rather laboriously!) with the workaround.


In the chart showing the previous year of the user's weight, I'm rendering gridlines and labels on the first of each month. I'm also doing this on the past three months chart.


For the chart showing the user's weight for the past month, I'm showing a label and gridline on each Monday.


Hope this helps,


James



Attachment: examples_9448bb89.zip


DP Dharanitharan Palanisamy Syncfusion Team August 4, 2021 02:25 PM UTC

Hi james, 
 
We have investigated your question and can tell you that we have already provided the example with our chart attributes, such as plotBands and annotations, therefore this is an inbuilt part of our charts. You may simply enter the x value and y value for the gridline in the plotBands and the annotations for the axis label, which is a straight-forward solution to your problem. As a result, a new feature request for this requirement will not be considered. Please contact us if you require any additional assistance. 
 
Thanks, 
Dharanitharan. P 


Loader.
Up arrow icon