Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
I am trying to configure a chart to display horizontal bars that are clustered and have overlap to represent an amount spent on top of a limit allowed. Basically I am trying to to be able to get a chart to show data for departments group together by their facilities that have an amount spent for their budget limit. I have seen similar examples to what I am looking for using a clustered stacked bar chart, but nothing quite like this. My goal would be to actually be able to have the bars representing the amount spent in front and not as wide as the bars behind representing the limit. Is there a built in way I can make this happen, or at least a way I can achieve the same result? I am still a little new using these controls, so I apologize if I missed something obvious. My searches so far have not turned up any results on this, so I am not sure if this functionality does not exist or I am searching the wrong terms. I don't expect anyone to do the work for me, but it would be helpful to know if what I am looking for is possible. Any examples to help out would be appreciated also.
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
Hello Tim, If you simply add two bar series to the chart - the second one will appear behind the first one. By default the bar widths will be equal, but you can decrease the WidthPercent property of the foremost bar series so that the front bars don't cover the back bars fully.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
Thank you for the response. Sorry about the delay in mine. I got bounced around on a couple of other urgent projects and just now am able to revisit this. I am still having an issue, and I think it may have to do with the MultiBarMode settings I need to get the cluster effect. When I take this out I am able to get the overlay effect, but I lose the clustering. Below is the VB code I used to generate the look I am going for, but of course stacking causes some other problems such as widths. Is there a way to get this effect with the clustering here, or maybe I can create my own clustering by changing the distance between bars depending on if they are in a cluster or the start of a new cluster? Thanks again for the help.
' first cluster Dim c1bar1 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c1bar1.Name = "Medical Spent" c1bar1.BarShape = BarShape.Cylinder c1bar1.DataLabelStyle.Visible = True c1bar1.DataLabelStyle.VertAlign = VertAlign.Center
Dim c1bar2 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c1bar2.Name = "Medical Budget" c1bar2.BarShape = BarShape.Cylinder c1bar2.DataLabelStyle.Visible = True c1bar2.DataLabelStyle.VertAlign = VertAlign.Top
c1bar1.MultiBarMode = MultiBarMode.Series c1bar2.MultiBarMode = MultiBarMode.Stacked ' stack on c1bar1
' second cluster Dim c2bar1 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c2bar1.Name = "Incontinence Spent" c2bar1.BarShape = BarShape.Cylinder c2bar1.DataLabelStyle.Visible = True c2bar1.DataLabelStyle.VertAlign = VertAlign.Center
Dim c2bar2 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c2bar2.Name = "Incontinence Budget" c2bar2.BarShape = BarShape.Cylinder c2bar2.DataLabelStyle.Visible = True c2bar2.DataLabelStyle.VertAlign = VertAlign.Top
c2bar1.MultiBarMode = MultiBarMode.Clustered ' display next to c1bar1 c2bar2.MultiBarMode = MultiBarMode.Stacked ' stack on c2bar1
' third cluster Dim c3bar1 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c3bar1.Name = "Housekeeping Spent" c3bar1.BarShape = BarShape.Cylinder c3bar1.DataLabelStyle.Visible = True c3bar1.DataLabelStyle.VertAlign = VertAlign.Center
Dim c3bar2 As NBarSeries = DirectCast(chart.Series.Add(SeriesType.Bar), NBarSeries) c3bar2.Name = "Housekeeping Budget" c3bar2.BarShape = BarShape.Cylinder c3bar2.DataLabelStyle.Visible = True c3bar2.DataLabelStyle.VertAlign = VertAlign.Top
c3bar1.MultiBarMode = MultiBarMode.Clustered c3bar2.MultiBarMode = MultiBarMode.Stacked
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
Is it possible for you to post an image of the chart that you want to display?
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
Sure. Here is an Excel image of something similar to what I am going for except that the bars on my chart need to be horizontal instead of vertical.
|
Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
Hello Tim, You can simply use two series - the first one for the foreground bars and the second for the background bars. To emulate the clustering effect you can add two empty data points after every group of three successive data points. This is the simplest approach and probably the best one. It is also possible to set custom X values instead of adding empty data points, but this is only in case you need fine control over the bar positions. The built-in clustering can also display the bars like on the image, but in this case the axis labels will be a problem, because there is no easy way to set labels for individual series in the cluster (the labels are per category).
Best Regards, Nevron Support Team
|