Profile Picture

Problem - Bar Chart

Posted By John Burcher 15 Years Ago
Author
Message
John Burcher
explanationmark Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 15, Visits: 1
Hi,

I have an interesting issue when generating a bar chart. I am hoping someone can shed some light on it. Code is below:-

Dim NStackedBarChart As New Nevron.Chart.NCartesianChart

NChartTotal.Charts.Clear()
NChartTotal.Charts.Add(chart:=NStackedBarChart)
Dim NBarSeries1 As Nevron.Chart.NBarSeries = NStackedBarChart.Series.Add(type:=Nevron.Chart.SeriesType.Bar)
NBarSeries1.Values.FillFromDataTable(table:=SelectTotal, columnName:="count")

That is literally all the code, SelectTotal returns the database as expected. Attached is the actual chart that gets generated.

Thank you.

Attachments
NevronChartCANJ4YJJ.png (36 views, 27.00 KB)
Milen Metodiev
Posted 15 Years Ago
View Quick Profile
Forum Member

Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)Forum Member (48 reputation)

Group: Nevron Team
Last Active: 14 Years Ago
Posts: 48, Visits: 1

Hi John,

In general when you display a stacked bar chart you need to create at least two bar series and you have to set the MultiBarMode property of the series objects to MultiBarMode.Stack.

I guess you want to stack all the values in a single column, but the FillFromDataTable function is not very helpful in this scenario. You can do this with a simple loop that reads the rows from the table and adds a bar series for each row. Please let me know if you need a code example.

Best Regards,
Milen Metodiev

 





Similar Topics


Reading This Topic