X-axis with non-numeric/datetime values?

Micro Charts for WPF Forum

Posted 6 years ago by Mick
Version: 13.1.0582
Avatar

I'm trying to create a microchart with a bar series that has string,decimal pairs. 

"Apple", 10M

"Orange", 7M

"Pear", 8M

etc.

 

Is it possible to create this chart? I'm getting the error "Type 'System.String' is not a supported axis type.".

MicroXYChart chart = new MicroXYChart();
Dictionary<string, decimal> values = GetValues(item);
MicroBarSeries series = new MicroBarSeries();
series.ItemsSource = values.ToArray();
series.XPath = "Key";
series.YPath = "Value";
chart.IsHotTrackingEnabled = true;
MicroSeriesPaletteStyleSelector microSeriesPaletteStyleSelector = new MicroSeriesPaletteStyleSelector();
microSeriesPaletteStyleSelector.Palette = new MicroPalette(MicroPaletteKind.Default);
chart.SeriesStyleSelector = microSeriesPaletteStyleSelector;
chart.Series.Add(series);

Comments (1)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mick,

Micro charts only support basic numeric types for the axes.  If you had a series of data for each fruit type (e.g. Apple: 3, 4, 3), then you could make a series with those three data points and put a Description of "Apple" on it.  Then add another series with three data points and a description of "Orange", etc.  If you had them all in the same chart with hot tracking on (see our "Hot Tracking" QuickStart), you could then show each item's value at that point.

Our large charts product (not micro charts) does support what you are looking to do though, at least in the newer versions.  See our "Grouped Axis" QuickStart for an example of that.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.