?
Solved

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

Posted on 2009-04-15
3
Medium Priority
?
744 Views
Last Modified: 2012-05-06
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
    series.ShadowOffset = 2
 
    ' Populate new series with data
    series.Points.AddY(67)
    series.Points.AddY(57)
    series.Points.AddY(83)
    series.Points.AddY(23)
    series.Points.AddY(70)
    series.Points.AddY(60)
    series.Points.AddY(90)
    series.Points.AddY(20)
 
    ' Add series into the chart's series collection
    Chart1.Series.Add(series)

Open in new window

example.jpg
0
Comment
Question by:Cerixus
  • 2
3 Comments
 
LVL 15

Expert Comment

by:spprivate
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

Open in new window

0
 
LVL 1

Author Comment

by:Cerixus
ID: 24152693
Sorry, I'm talking about THIS MSchart: http://code.msdn.microsoft.com/mschart

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

Accepted Solution

by:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question