This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jason, We have started creating stacked bar charts, and we find that the StackedBarSeries really doesn't handle negative values reasonably. It seems that depending on the order of the positive and negative values sometimes a negative bar value will plot below zero, and other times it will plot above zero, reducing the total bar height and partially or completely covering up other bar values. What I would expect is that negative bar values plot below zero, positive bar values plot above zero, and the total bar height is the sum of the absolute values. Is there any way to achieve this, or could the StackedBarSeries be updated to support this? Thanks Peter |
|
|
Hi Peter, I've made some tweaks to help with negative numbers in a stacked bar series. Please note that this will only work if each individual series contains all positive numbers, or all negative numbers. If this matches the data you will be plotting, grab the next nightly build and do the following. Knowing which series contain positive numbers, set the StackIdentifier property on those series to be the same arbitrary value. Do the same to the series containing negative numbers, but with a different stack identifier value. Finally, set BarRenderingMode on all series to Overlap. That all should give you the result you're looking for. If each of your series contain a mix of positive and negative numbers, then this approach will not be applicable and unfortunately we do not have any plans to support such scenario. If this is the case for you, the best option would be to try using FloatingBarSeries instead which gives you the control of setting the logical position of both ends of each and every bar which would allow you to achieve the visual result you're looking for. Make sure to set BarRenderingMode = Overlap in this set up too. Let me know if you have any questions. -Jason Fauchelle |
|
|
Hi Jason, Thanks for your reply. Unfortunately, in general I expect the data series we need to plot to contain a mix of negative and positive values. Rather than following your other suggestion to try FloatingBarSeries I decided to try my hand at creating a new series type (PxStackedBarSeries) to achieve the results I need (since we get the source code). I am quite pleased with the result so far. The new series seems to handle negative numbers fine, though I still need to test a few situations (like missing values). This leads to another problem: since my new series must override various virtual methods which happen to be internal, it cannot be compiled separately from the WpfElements DLL. This is highly non-ideal because I don't want to be modifying your DLL (outside of testing), since then I would have complications whenever I got updates from Mindscape. I see two solutions:
Are either of these solutions possible? Peter |
|
|
Hi Peter, Thanks for your feedback about this. I plan to make those methods public to support implementing custom series. I'll get back to you soon once this is available. -Jason Fauchelle |
|
|
Hi Peter, I've made those methods protected which will be available in the next nightly build. Let me know any additional members that you'll need access to for your custom series implementation. -Jason Fauchelle |
|
|
Hi Jason, Thanks for this update. However, as you suspected there are additional members that I need to be public for my custom data series to access: Constructor for Bar - internal Bar(object data, Orientation orientation) DataSeries.Canvas - internal Canvas Canvas Constructor for DataLabel - internal DataLabel(DataPoint dataPoint, object dependentData) This covers all compile errors I am currently seeing, but more things could easily turn up. In general, anything that any of the existing DataSeries subclasses access might be needed. I know this is kind of broad. Peter |
|
|
Hi Peter, These members will be made public for the next nightly build. Regards -Jason Fauchelle |
|
|
Hi Jason, Thanks for the update. However, apparently I gave you a very incomplete list of things I can't access due to being Mindscape internal. I really don't know what I was thinking, and I apologize for not getting this right the first time. Here are additional members I need to be made public DataSeries.ReverseAxes BarSeries.ReverseAxes BoxplotSeries.ReverseAxes DataSeries.MinDelta (getter only) DataSeries.GetDataPoint(object o, int index) DataSeries.GetPoint(CartesianDataPoint dataPoint, int index) DataSeries.GetPoint(int index) DataSeries.Series (getter only) ChartAxis.ActualMajorTickMarkSpacing ChartAxis.ConvertLogicalToPhysicalSize(double logicalSize) Bar.IsNegative (setter, currently registered as readonly) Of course this results in a lot of missing XML comment warnings. Thanks Peter |
|
|
No worries Peter, Those members will be public in the next nightly build. Let me know if there are anymore that are required. -Jason Fauchelle |
|
|
Hi Jason, Thanks again. This time it works! Peter |
|