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

Posted on 2009-04-15
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










    ' Add series into the chart's series collection


Open in new window

Question by:Cerixus
    LVL 15

    Expert Comment

    This is what there in MSDN for VB
    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

    LVL 1

    Author Comment

    Sorry, I'm talking about THIS MSchart:

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

    Accepted Solution

    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)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now