Hello. I need to provide custom point marker with height and width based on my data, but trying to implement BasePointMarker I have the center points but not the original data to make the width and height based in my original binding. Is there a solution to do that? Thank you.
Tommy Garcia.
- Tommy Garcia asked 10 years ago
- You must login to post comments
Hi Tommy,
The short answer is no, the BasePointMarker.Draw method is defined like this and has no access to the original data
/// <summary>
/// Renders the PointMarker on each <see cref="Point"/> passed in. Each point is a coordinate in the centre of the PointMarker.
/// The Pens and Brushes passed in are defaults, which are used in case the local Fill or Stroke are not set
/// </summary>
/// <param name="context">The RenderContext to draw too</param>
/// <param name="centers">The collection of Points to render the Point Markers at</param>
/// <param name="defaultPen">The default Stroke pen (if current pen is not set)</param>
/// <param name="defaultBrush">The default Fill brush (if current brush is not set)</param>
/// <seealso cref="IRenderContext2D"/>
/// <seealso cref="IPen2D"/>
/// <seealso cref="IBrush2D"/>
public virtual void Draw(IRenderContext2D context, IEnumerable<Point> centers, IPen2D defaultPen, IBrush2D defaultBrush)
{
// ... Draw marker at Centres using Pen, Brush
}
We do however support a Bubble series, which sounds a lot like what you want.
Maybe this can help?
- Andrew Burnett-Thompson answered 10 years ago
- last edited 10 years ago
- You must login to post comments
Thanks for the answer Andrew,
I’ve tried a solution by providing the original data to the custom implementation of the BasePointMarker, however I’m wondering if the center points are strictly in the same order as the data was provided in the view model. could you please confirm me that?, this is to decide if we buy or not this product.
Thanks
- Tommy Garcia answered 10 years ago
-
Hi Tommy, the centre points in BasePointMarker.Draw() are in the original order, but they are pixel coordinates, not data values and they have gone through the process of being resampled, then converted to pixel coords. If you want per-point sizing/drawing and BubbleSeries isn't doing it for you then you could potentially achieve what you want with a CustomRenderableSeries and using our Drawing context directly.
- You must login to post comments
I understand. I will try the CustomRenderableSeries
Thank you.
- Tommy Garcia answered 10 years ago
- You must login to post comments
Please login first to submit.