How to Override Category Frequency or Use Custom Category Labels

Using XLSIO, I've output a chart like this:



The design of this chart is dictated by the same chart as generated by a different program -- they need to be as identical as possible. 

Nearly every aspect of this chart is good, but as you can see, the Category Labels along the horizontal access are useless. That happened as soon as I turned on both Major and Minor grid lines. Do the labels have to be connected to the gridlines? Or, put another way, how can I modify or override the interval of the labels? On this chart, my desired interval is 1500 units, which in this case would be "liters per minute".

I've tried setting 

chart.PrimaryCategoryAxis.DisplayUnitCustom = X

But this gives unexpected results. How can I regain control over those labels on the bottom?



8 Replies 1 reply marked as answer

SK Shamini Kiruba Sobers Syncfusion Team November 18, 2020 02:31 PM UTC

Hi Jon, 
 
Greetings from Syncfusion support. 
 
Kindly try setting the MajorUnit value to 1500 as below and let us know if this helps. 
 
Code snippet: 
 
chart.PrimaryCategoryAxis.MajorUnit = 1500; 
 
If this doesn’t resolve your issue, kindly share us the issue reproducing sample so that we can analyze and provide prompt solution at the earliest. 
 
Regards, 
Shamini 



JO Jon November 18, 2020 06:44 PM UTC

Oh, that's it! Thank you! I had both the major unit and the minor unit locked down to 50, thinking that that was the magic sauce that got the grid to display the way I need, but apparently that is mostly based on the minor unit only, so that frees up the major unit to control the display of the labels. Awesome!

While I've got your attention... How do I make just the major grid lines a little heavier? I found docs for it last night, but didn't understand how to apply it.

Thanks!


KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team November 19, 2020 06:34 AM UTC

Hi Jon, 

Thanks for the update. We are glad that the provided solution helped you. 

We suggest you to use the following code snippet to increase the weight of major gridlines.  

Code Snippet: 

chart.PrimaryValueAxis.MajorGridLines.Border.Weight = 5; 
chart.PrimaryCategoryAxis.MajorGridLines.Border.Weight = 5; 

Kindly try and let us know if the provided code snippet helps. 

Regards, 
Keerthi. 


Marked as answer

JO Jon November 19, 2020 04:48 PM UTC

Hello,

No, that doesn't help -- the first line does not seem to have any effect at all, even when I jack it up to 15:

chart.PrimaryValueAxis.MajorGridLines.Border.Weight = 5


This line does not compile; I'm on VB.Net, is there a different way to reference that?

chart.PrimaryCategoryAxis.MajorGridLines.Border.Weight = 5



SK Shamini Kiruba Sobers Syncfusion Team November 20, 2020 12:04 PM UTC

Hi Jon, 
 
Weight property is just exposed from our latest version 18.2.0.44. We suspect that you are using a version older than that and we recommend you to upgrade to our latest version which contains more bug fixes and feature implementations. 

You can download our latest 2020 Volume 3 service pack v18.3.0.47 from the following link. 
 
Kindly confirm us the Syncfusion XlsIO version that you are using at your end so that we can check the feasibility and provide patch in your required version. 

Regards, 
Shamini 



JO Jon November 20, 2020 01:23 PM UTC

Hello,

I am using XLSIO via NuGet, and am currently using 18.3.0.42.

I checked, and NuGet is not offering any upgrades as of yet.

Some of the other SF packages I was using did have an upgrade to offer, but even after upgrading everything, the result is the same.

Thanks for looking into this!!!

--Jon



JO Jon November 21, 2020 03:19 PM UTC

OK, so I went ahead and upgraded everything in NuGet, and now it shows v18.3.0.50 on all of the XlsIo components:



When I look at the properties of the reference to XlsIO.Base, it shows Version 18.3460.0.50.



SK Shamini Kiruba Sobers Syncfusion Team November 23, 2020 12:26 PM UTC

Hi Jon, 
 
Thanks for the update. 
 
Kindly look into the following video screenshot which shows how Weight property is accessible in the latest version v18.3.0.50. 
 
Please let us know if it helps. The sample we tried at our end can be downloaded from the following link. 
 
If you are still facing any issue, kindly modify the sample to reproduce the issue and send us the modified sample so that we can provide prompt solution at the earliest. 
 
Regards, 
Shamini 


Loader.
Up arrow icon