Closed PavaniTatikonda27 closed 4 years ago
Thank you for the clear example images. This is presently not support in the library.
It would be possible to implement such support, but historically OxyPlot has tended to avoid features that don't directly related to plot interpretability, and I don't think gradients are considered a good way to communicate information (e.g. what can the gradient tell you that the line doesn't already?). Obviously this is somewhat subjective (smoothed lines and interpolated heatmaps, for instance, are both features I would avoid).
We are trying to achieve the fill area of the area series with a gradient color instead of solid color as it is more visually pleasing rather than solid colors, other than that it doesn't tell anything more.
Could we make any tweaks to achieve the above look ?
Any suggestions are welcome and thanks for the comment @VisualMelon
I'm afraid I can't really suggest anything apart from partially implementing the feature and shipping your own copy of the library with big changes.
To implement this properly, brush types would need to be defined, the fill
parameters and members everywhere would need to be replaced, and the appropriate render contexts would need to be modified. This could probably be done in a way that doesn't break existing code (it would be binary breaking) (and wouldn't be hard to do if you were only implementing it for one platform) but I'm afraid this isn't a feature I personally would invest in unless it got the go-ahead from the project owner. (That said, this would help with supporting something like hatching, which can be useful in e.g. printed documented).
Without modifying the library, I think this would be very painful. You could try extending the xamarin implementation of the appropriate IRenderContext
(and possibly the presentation end, as it probably isn't swappable) and area series types, to implement it as a one-off, but I have no real familiarly with Xamarin or OxyPlot-Xamarin so I don't know if it's practical.
@VisualMelon Yes, OxyPlot is opinionated and has been trying to follow the style and design principles of Edward Tufte, Stephen Few et al. https://oxyplot.readthedocs.io/en/latest/guidelines/design.html I don't think gradients should be implemented in this library!
@objorke thanks for the link: somehow I couldn't find that document (I knew it existed) when I was writing the other comments.
Steps to reproduce
Platform: Xamarin Forms
Expected behaviour
Need to show gradient color in the area series.
Need to achieve the below View :
Actual behaviour
We can only add solid colors to the fill color in area series. Could we make any tweaks to look similar to the graident color.
This is the Actual color with solid Color :