vb Mschart Rotate et Size ( urgent )

Hi experts
here are my 2 questions

1- i need to rotate my Axis. I'm not sure what exactly the words are. I think its AXIS. On the rigth and left of the chart, i got the percentages = 10 , 20 , 30 ...
i need to rotate them like this when i rotate my sheet, there straigth

2- I'm using 2dbars and i want to make my BARS smaller size, the .width is too big, how can i change that

this is an urgent questions, i really need your help and fast plz

i would really appreciate and fast answer
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Italbro5Author Commented:
oh ya.
forgot to tell you this.
i dont know if it will make a difference

but i'm using this to create my charts.

Set cmdObject = Form3.Controls.Add("MSChart20Lib.MSChart", "achart" + Trim(Str(n + 1)))

If you didn't already know, right clicking the chart control and choosing "properties" brings up a properties dialog box that lets you adjust the most important visual aspects of your chart control.
Italbro5Author Commented:
i create then dynamicly so i cant rigth click on it
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Silly me.

Then (if you haven't already looked), the achart.Plot.* properties are what you want to look at.  Check out MSDN for a link of which plot properties do what:

As for 1), I'm not sure what you exactly mean by "rotate"...could you elaborate.

For 2), it looks as though increasing achart.Plot.BarGap will decrease the width of the bars, and vice-versa.
Italbro5Author Commented:
I'm gonna check but if you know
wich one i should work  for

#1 and #2
Italbro5Author Commented:
as for 1),

the Axis Y as a scale






now the thing is i need to rotate those number. TO change there oriantation.
Italbro5Author Commented:

you know an other then
Set cmdObject = Form3.Controls.Add("MSChart20Lib.MSChart", "achart" + Trim(Str(n + 1)))

cause if i do
with cmdObject
end with

if i do : . Something
it dosent work
the properties dont come if i press " . " and if i write
cmdObject.Plot.BarGap = 20 wont work

but if i create an MsChart1
and then do
MsChart1.Plot.BarGap = 20, this will work
how come
What type exactly is "cmdObject"?  Is it a command button?  I couldn't figure out your syntax, when you were calling "set" on it.  Are you dynamically creating the command button and attaching a directive to it somehow?  I've never actually seen that done before.
Italbro5Author Commented:
Set cmdObject = Form3.Controls.Add("MSChart20Lib.MSChart", "achart" + Trim(Str(n + 1)))

i create an MsChart dynamicly
thats how its done

is there an other way ??

cmdObject is the name i give to it
i can do it like that :

Set oChart = Form3.Controls.Add("MSChart20Lib.MSChart", "achart" + Trim(Str(n + 1)))

it will do the same thing
after i can do

oChart.visible = true  // this will work
but when i write oChart. // it dosent show the different properties i can use

At any rate, you probably want to do something like

Form3.Controls.achart1.Plot.BarGap = 20
Form3.Controls.achart2.Plot.BarGap = 20
Form3.Controls.achart3.Plot.BarGap = 20
Form3.Controls.achart4.Plot.BarGap = 20

Or, more elegantly, dynamically create one chart object, set the plot properties as you like, and then instantiate new chart objects, setting them equal to the formatted one you just created (or just copy the .Plot object).  After you've created your 4 chart objects, they would be formatted, and all you have to do is put data in them.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
oChart is just an object returned from that call that adds the chart to the controls container on the form (thus giving you the power to dynamically name the control).

If you name the charts explicitly in your code, you can just do "Dim bChart As MSChart20Lib.MSChart" and do whatever you'd like with it.  Otherwise, to manipulate the chart, you should do so by interacting through the Form.Controls container, as above.
Italbro5Author Commented:
nothing works

if i do : Dim bChart As MSChart20Lib.MSChart

it works but dosent create a new one
if i do
with bChart

end with

gives me an error
nothing workds with that stupid ****
4 days i've been spending on properties when MsChart added dynamicly, nothing works

i really need your help
I made a project and got the following code working:

Public oChart As Object
Private n As Integer

Private Sub Command1_Click()
    Set oChart = Me.Controls.Add("MSChart20Lib.MSChart", "aChart" + Trim(Str(n + 1)))
    oChart.Height = Me.Height
    oChart.Width = Me.Width
    oChart.Visible = True
    oChart.Plot.BarGap = 100
    n = n + 1
End Sub

Basically, the reason why you can't see the properties of the oChart object directly is because the IDE doesn't tokenize your code enough during development time to understand that oChart is an MSChart and not an "Object".  Just make sure you scope those chart objects accordingly.

Ignore what I had said about using "Dim" to instantiate an instance...it doesn't seem to be happy with the MSChart.  MSChart doesn't let you use "new" to allocate memory for it, so it's all pretty shady.

Also, setting the .Plot object of one chart equal to another just doesn't work...I tried this with the "set" directive and without...just wouldn't do it.  You'll have to set the .Plot property of each chart object seperately.
Italbro5Author Commented:
HarmnKardn :

so there is no way i can do this then
i got read a file and create a # of chart
so i'm screwed then , is that it ??
I'm thinking you might want to make some architectural changes to your project to do what you're looking to do.  First of all, make a new form (call it frmChart) and drop a chart control onto it (MSChart1).  Size and position it the way you want, format it, and such.

Now, organize your code so that when you parse the text file, you create a new window for each chart you want to create.  Dynamically creating form objects is much more elegant then trying to manage a metric assload of charts on a single form.

After that, every time you need to make a form, you do it dynamically, then consult the frmChartXXXX.MSChart1 to set your data and do whatever is necessary on it.

You should be able to do this.  I've created multiple forms to dynamically create a four charts using (Dim chartOne as frmChart) statements...that worked fine for me.  I've never seen it done for a dynamic number of charts before, but I think it should work making them as forms.
Italbro5Author Commented:
Its half of what i wanted but it still good
thx anyways
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.