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 axisdouble scaledXCoord = XAxis.GetScaledValue(myDataPoint.MyTextValue, params);
How can I do this?
Thanks
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thank you! That answers my label centering question!
I have created a sample project for you where I centered the horizontal labels using DataTemplate for the Label. I bound its RenderTransform and translate it based on the grid lines. You can follow the same approach for the vertical labels.
Hope this helps you.
This example illustrates centered X axis labels in the first bar chart:
http://es.infragistics.com/products/wpf/sample/data-chart/axis-types
However, with my custom series, when I apply CategoryXAxis and CategoryYAxis, my values still appear at the tick marks, like the NumericXAxis instead of centered. How can I get my labels to be centered like it is shown in the bar chart?
Unfortunately that doesn't help me. Perhaps I shouldn't have said Heatmap, as the "heatmap" I'm trying to create is rather unique, with some unique requirements.
I just need to know how to center the labels between tickmarks on a chart. The chart with a custom series allows me to do what I need, but these minor issues are becoming a limiting factor. I can't see why it wouldn't be possible to center the labels between each tickmark, as the bar chart does it.