0

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?

Edited by Eternal Newbie

Attachments BarError.PNG 33.87 KB
2
Contributors
6
Replies
18
Views
3 Years
Discussion Span
Last Post by Eternal Newbie
0

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
0

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

0

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

0

@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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.