Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSChart

Status
Not open for further replies.

topone

Programmer
Jul 28, 2004
21
0
0
GB
Hello,
I am trying to convert an excel graph into a Visual Basic Graph. I do manage to get the data from either a db or a file.The problem that I have encountered is that I cannot display the value of the column in the graph.
The Y shows only values like 10, 20, 30 so if the value of a specific column is difficult to understand.
I would like my column to display on the top their real value like 22,24, etc.
Any ideas?
Thanks
Paolo
 
Hi,

What is your code so far?

Skip,
[sub]
[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue][/sub]
 
Hello SkipVought,
The code is a bit here and there,but the one that should interest you is this :

Private Sub cmdRepPharmacy_Click()
Dim retrdata As New ClsModGet
Dim vColNames() As Variant
With chtData
.chartType = VtChChartType2dBar
.ChartData = retrdata.GetData(vColNames)
.TitleText = "Weekly Pharmacy Data"
.Title.VtFont.Size = 18
.Plot.Axis(VtChAxisIdY2).AxisTitle.Visible = False
.Plot.Axis(VtChAxisIdY2).ValueScale.Auto = True
End With

End Sub

clsModGet is a class module that I have created it with some methods inside, one of the is GetData. In there a create a connection to the db open it and then submit the data to an array.
Then the method return the array to the .CharData method.
Well this is it more or less.
I also change the settings in design time of the orinetation of the text for the x-axis by going to Property page, text orientation in the MSChart.
Any suggestions ?
Thanks
Paolo
 
Hello all,
It seems that I overlooked some of the existings posts. I have modified a little bit the code of Cajun Centurion and now it works fine.
I put the code just in case somebody may need it.
Thanks again
Paolo

Private Sub columntop()

With chtData.Plot.SeriesCollection(1)
With .DataPoints.Item(-1).DataPointLabel
.Component = VtChLabelComponentValue
.LocationType = VtChLabelLocationTypeAbovePoint
.VtFont.Size = 8
End With
End With
End Sub
 
Paolo,

Be sure to thank Cajun Centurion.

Skip,
[sub]
[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top