Solved

# MSChart, asp.net, naming y axis? (I'm no good at charts in general)

Posted on 2009-04-15
Medium Priority
744 Views
So the code attached, the example from the documentation, will create a chart and plot 8 columns of data with the corresponding values.  However, the y axis just says 1, 2, 3, 4, 5, 6, 7 and 8.  How do I make it say different stuff?  I don't even know what to call this so I can't effectively google it (though I have tried for days).  In my opinion it should be like Series.Points.Addy(value, "name"), but I guess my opinion doesn't matter much to Microsoft :)

I actually want something basically identical to the attached image.  I created this by using databindxy, but I'd rather do it manually for flexibility reasons...

edit: fixed attachment
``````' Create new data series and set it's visual attributes
Dim series As New Series("Spline")
series.ChartType = SeriesChartType.Spline
series.BorderWidth = 3

' Populate new series with data

' Add series into the chart's series collection
``````
example.jpg
0
Question by:Cerixus
• 2

LVL 15

Expert Comment

ID: 24152599
This is what there in MSDN for VB

http://msdn.microsoft.com/en-us/library/3ks53324(VS.71).aspx
``````With Me.chtSales.Plot
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdX).AxisTitle.Text = "Year"
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).AxisTitle.Text = "Millions of \$"
End With
``````
0

LVL 1

Author Comment

ID: 24152693

Not the "Legacy ActiveX Control Reference" you posted documentation for.
0

LVL 1

Accepted Solution

Cerixus earned 0 total points
ID: 24195600
So this is basically how you do it:

Dim yValues As Double() = {intVirtual, intPhysical}
Dim xValues As String() = {"Virtual", "Physical"}
Chart2.Series("Series1").Points.DataBindXY(xValues, yValues)
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
###### Suggested Courses
Course of the Month8 days, 8 hours left to enroll