Recently I've used zedgraph barchart to create a chart with 12 bars. I did want to put each bar on an x-axis scale and change the label name of that scale, but I did not success. Could you please show me the way the put my bars inside the scales?

Hi,

Can you show us you're code?

Sure. Here's my code:

        'Naming the axis scale as string
        Dim lablex() As String
        ReDim lablex(0 To dsRp.Tables(2).Columns.Count - 1)
        For xa As Integer = 0 To dsRp.Tables(2).Columns.Count - 1
            lablex(xa) = dsRp.Tables(2).Rows(0).Item(xa)
        Next
        myPane.XAxis.Type = AxisType.Text
        myPane.XAxis.Scale.TextLabels = lablex

        'Creating Bars with legend names
        Dim colN1 As String = ""
        Dim colN2 As String = ""
        Dim x As Integer = 0, y As Double = 0

        For i As Integer = 0 To dsRp.Tables(1).Rows(0).Item("So_ky") - 1
            Dim list As New PointPairList
            list.Clear()
            colN1 = "Ky" + (i + 1).ToString
            colN2 = "NKy" + (i + 1).ToString
            x = i + 1
            y = dsRp.Tables(0).Rows(0).Item(colN1.Trim)
            list.Add(x, y)
            Dim e As BarItem
            e = myPane.AddBar(dsRp.Tables(2).Rows(0).Item(colN2), list, RandomColor())
            e.Color = RandomColor()
        Next

Hi,

Because I doesn't use Zedgraph found this.
I hope it helps you,

Thks Luc. Al last, I couldn't find a good solution then I removed zedgraph and now using my friend's dll.

Hi,

I don't know which VB.Net version you're uusing, but there is a Chart Control provided.
You can find some information, Here

@LUc: Thks again. But, Chart tool's only been available since .NET 3.0, VS 2008. Cause I'm Using VS 2005 and .NET 2.0, I couldn't add chart tool if not installing .NET 3.0. And, in fact, in some of my tries, Microsoft Chart tool is quite... not good, right?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.