Hi,
I am trying to create a bar chart for two metrics (with the same set of categorical values) and want two axis top and bottom for the bar chart. I create the chart and add a PrimaryX, SecondaryX and PrimaryY axis.
I then add two series, both of ChartType.Bar and add to the chart. When I set the AxisY and AxisX values of the bar chart I am unable to get the bars to work as standard series values and instead the bars sit on top of each other. If I point both series at the same X axis (PrimaryX for example) this works fine, but obviously I only then have one axis displaying.
Here is the code I am using to create the series:
var barSeries1 = new Series { ChartType = ChartType.Bar, DataSource = seriesData1, DataMapping = "Value = Value1; Label = ShortLabel1", Label = seriesData1.Title + ", " + seriesData1.Measure1, AxisX = "PrimaryX", DataPointStyle = Application.Current.Resources["BarChart"] as Style, Fill = brush };
var barSeries2 = new Series { ChartType = ChartType.Bar, DataSource = seriesData2, DataMapping = "Value = Value2; Label = ShortLabel2", Label = seriesData2.Title + ", " + seriesData2.Measure2, AxisX = "SecondaryX", DataPointStyle = Application.Current.Resources["BarChart"] as Style, Fill = brush };
And the resulting chart:
Please advice if this is a known bug, or any possible workaround for the problem.
Thanx,
Chris
Hello Chris,
Excuse me for the late reply on this. I have been looking into your requirement, however this is the designed behavior of the XamDataChart also when using LineSeries. With LineSeries the series are again one behind the other, however there is no big surface that would show off the arrangement like with the ColumnSeries. This being said I also tried figuring out some custom approach, but to no avail. If you have something in mind that can we can implement, in coherence with the CategoryAxis’s architecture, I’d be to log in on your behalf as new Product Idea for the XamDataChart.
Please let me know if I can be of any further assistance on the matter.
Ideally the BarSeries would just work in the same way as the ColumnSeries. The xamDataChart will present the columns for the two series next to each other rather than on top of each other, in the same way it would present the columns next to each other for multiple ColumnSeries linked to the same axis.
It sounds like there is some logic implemented for column series that is not there for bar.
What we are trying to achieve is the ability to create different visualisation options when analysing data with two or more metrics/measures involved. If I have a piece of analysis looking at two distinct metrics, split by some shared categorical data item, being able to visualise the data in a column/bar/series/scatter/grid, is what we want. We have been able to do this successfully for everything apart from the bar series due the above noted behaviour.
If you need more information let me know.
Regards,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Hi Peta,
Apologies for not replying.
I was able to resolve the issue by switching to the xamDataChart, which handles multiple axes better than the xamWebChart.