+ Reply to Thread
Results 1 to 8 of 8

Histogram charting, scale change

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Question Histogram charting, scale change

    Hello,

    I have some problems to change parameters in my chart via VBA.
    I have a Chart on my sheet, I can select it and I want to change the X axis scale.

    I used :
    With ActiveChart.Axes(xlCategory)
    .MaximumScale = 16000
    End With

    It gives me an error saying that "MaximumScale" is not from the Axes Object.
    I can change the Y axis by doing the same thing but replacing xlCategory by xlValue.

    I am not sure how it works but the code with "xlCategory" did work for other charts.
    Is it different for the histogram chart ?

    Anyway, I would like to change the X axis scale, can someone help me please ?

    Thank you very much in advance.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Histogram charting, scale change

    You can only change the Category scale values if the chart has a numeric category axis.
    What chart type are you using?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Histogram charting, scale change

    Thank you for your reply.
    I am using a column type chart. I tried with the clustered and stacked (2D), I checked via the Excel options but it seems it does not have a numeric category axis.
    In fact, my data for the X axis is supposed to go to 16 000 maximum but the chart displays until 1200 (I don't know why).

    That's why I try to change the maximum scale value.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Histogram charting, scale change

    Can you post workbook example

  5. #5
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Histogram charting, scale change

    Sorry I don't have an example workbook yet, I will try to make one if I can.

    I may have done an error when applying the data in the chart. (I am using a 2D column chart).
    For X and Y axis, I set the data like this :

    With ActiveChart
    .SeriesCollection(1).XValues = x_value
    .SeriesCollection(1).Values = y_value
    End With

    x_value and y_value are some arrays with the same size (16 000)
    Is it correct ?

  6. #6
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Histogram charting, scale change

    post 2 times, sorry
    Last edited by oro77; 01-24-2012 at 10:20 AM. Reason: post 2 times

  7. #7
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Question Re: Histogram charting, scale change

    I encounter another problem using the bar chart, the limitation is 255 bars in a graph, is there something to change this ?

    My example book exceeds the limitation size so I show you my example code :

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-31-2011
    Location
    Tokyo
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Histogram charting, scale change

    I have an additional question concerning the format. I have some Date data on my X axis and I would like to format it, it does not give any error but it does not do anything. Could someone check my code ?

    I have put my data in my histogram graph like this:
    Please Login or Register  to view this content.
    The Axis displays the date label but its format is like : 12:00:00 AM instead of 00:00

    Thank you in advance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1