Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
900
Custom series with CategoryXAxis
posted

I'm trying creating a Heatmap chart and I am using a DataChart with a CustomSeries.

I overrido the RenderSeriesOverride method, and provided my own rendering for the heatmap.  This works great when my rows and columns are all numeric, as with NumericXAxis, I can calculate the value on the canvas by doing:

double scaledXCoord = XAxis.GetScaledValue(myDataPoint.MyIntValue, params);

and plot by heatmap square on the grid at the desired coordinate.

However, my data is not numeric, and I'd like to use Category, where my axis (rows and colums) are textual values.  By default, the Axis figure out which labels go where, but the CategoryXAxis doesn't seem to give me a method where I can find out to what coordinate on the grid the label falls, so I can figure out where I should map my squares to.

In other words, what I'd like to do is be able to pass a string, and get the coordinate on the grid based on where the string matches the label on the axis
double scaledXCoord = XAxis.GetScaledValue(myDataPoint.MyTextValue, params);

How can I do this?

Thanks