Jump to content
Software FX Community

Limit to show no of Labels (points) on X Axis in Bar Chart


Ronak
 Share

Recommended Posts

Hi,

 

I have Bar Chart where there are 5 Series on one X axis Label. Now the list of Lable may go between 0 - 1000.

 Is there any way to limit such a way that at a time user can see only 5 lables. So all the bars looks good an image does not look very bad.

If he want to see the other Lables. He has to use the scoll bar to go from 5- 10 then 11 - 15. I have tried the chart1.AxisX.SetScollView(0,5)..

but then in output i am geetin only White Sceen of Death. And my code hangs. I have also attached the screen shot with this post.

 

My code for Axis

-----------------------

  /* * Code for the Axis modifications */   chart1.AxisX.Title.Text = "Tasks";     chart1.AxisX.AutoScroll = true;   chart1.AxisX.PixelsPerUnit = 15;   chart1.AxisX.Grids.Major.Visible = true;       chart1.AxisY.Title.Text = "Statistics";     chart1.AxisY.AutoScroll = true;   chart1.AxisY.Notify = true;   chart1.AxisY.PixelsPerUnit = 15;     chart1.AxisY.DataFormat.CustomFormat = "##.##";   chart1.AxisY.Grids.Major.Visible = true;  

 

Link to comment
Share on other sites

 Try:

chart1.AxisX.AutoScroll = true; 

chart1.AxisX.SetScollView(1,5)

If this produces an error please attach project that reproduces the problem, this API works fine in my box.

I am not clear whether you want ot hide some labeles or to show less points. SetScrollView will do the later. To see less labels you can either set the Step to something. The default is automatic and will chose a value that shows the greatest number of labels possible for the available space.

Link to comment
Share on other sites

Hi,

 

I have attached my code with this Project. The problem i am having with this code.

 

1) If you minimize the window to certain height you will get the Label on X axis at 45 angle and they are very blurry.

2) Still the setScrollView is not working when i set it to (1,5) i can still see all the lables. The goal is that i dont want to hide any labels here.

I just want to show that 5 labels at a time. So, if i have 50 lables. they can see first five , then second five. Because if i do this way then only all the bars will have good width and heigth in the Graph otherwise everything becomes to small and graph becomes to dence when i saw all the labels in one screen

 3) When you click on datagrid by right clicking on the Graph you can see the Header of Datagrid is not showing properly i guess it because of the

Name of the Label is in this formate :  Name + Environment.Newline + Path..

  

Link to comment
Share on other sites

1) Do the SetScrollview after you set the data, otherwise the chart will rescale acording to the data at that time.

2) I don't see anything "blury". The labels are 45 degrees. This is by design.

In one of your other postings I explained the reason why and how to disable it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...