Hi,
I'm looking for a chart to display non numerical data points. Something simple like months on the y axis, categories on the x axis, and simple points to represent them.
DataSet might look like, (Feb, Cat1), (Jan, Cat3).
I was hoping to use the scatter plot. However, the axis didn't like non numeric data.
Thank you for your suggestions in advance.
Thanks Max! That was a very helpful example.
I'm curious how far the Label formatter extends. Is it possible to bind it? Say to an ObservableCollection<string>{"something","various","whatever"} ?
Here's a small point chart example that you might be able to use: <my:XamChart Background="AliceBlue" x:Name="chart"> <my:XamChart.Series> <my:Series ChartType="Point"> <my:Series.DataPoints> <my:DataPoint Value="3" Label="Jan"/> <my:DataPoint Value="5" Label="Feb"/> <my:DataPoint Value="2" Label="Mar"/> <my:DataPoint Value="1" Label="Apr"/> </my:Series.DataPoints> </my:Series> </my:XamChart.Series> <my:XamChart.Axes> <my:Axis AxisType="PrimaryY"> <my:Axis.Label> <my:Label Format="Category:{0}"/> </my:Axis.Label> </my:Axis> </my:XamChart.Axes> </my:XamChart>
Thanks for the replies.
Max,
I was thinking about converting the "categories" to numerics, then formating the axis labels, but wasn't sure how to do it. The closest example I could find was the date converter/formatter.
I'll try a Point Chart and investigate this idea further.
Devin,
Maybe a small similar data set would help give you some context.
(Jan,HR,Fail),(Jan,Accounting,Fail),(Jan,Sales,Fail)
(Feb,HR,Fail),(Feb, Accounting,Pass),(Feb,Sales,Fail)
(Mar,HR,Fail),(Mar, Accounting,Pass),(Mar,Sales,Pass)
etc...
I built a prototype as a POC. Essentially a grid, with y axis (HR, Accounting,Sales), x axis (Jan, Feb, Mar, etc...) and each datagrid cell a color(green for pass, red for fail).
Of course it's not as pretty, functional, or elegant as Infragistics.
Gabe
Can you provide some more information about your scenario? I am not sure I have ever seen a scenario where string data is useful on a scatter chart axis.
Also, if we supported DateTime values on the Y axis would that satisfy your requirement? That would let you create a line chart, or as Max suggested a Point chart that accepts DateTime values on the Y and string data (like categories) on the X axis.
Devin
Unfortunately, at least one axis must display numeric values. Scatter and bubble charts need both axes to be numeric, otherwise it will be impossible to determine the space between points. I suggest using a Point chart, which displays a string x axis and numeric y. You will have to associate one of the data columns with some sort of numeric value (for example, Cat1 would just be 1, Cat3 - 3, etc). You can format the labels to display strings if you don't want numeric values on the y axes. I don't think there's another way to work around this.