KendoUI DataViz duplicate category values

1.1k Views Asked by At

I have a Column chart that I have duplicate category values for (because the item it represents was "reborn") and I want to display both individually-but it appears that Kendo takes only one unique category and so ignores the second value. For example:

Items: [
{category: 1, value: 1}, 
{category: 2, value: 2},
{category: 1, value: 3} ]

So I want three column markers, but instead I get only two:

Items: [
{category: 2, value: 2},
{category: 1, value: 3} ]

Does anyone have an idea how I can achieve this? I tried calling it the Xfield in the series definition, because on other non-categorical charts you can have multiple x values-but it didnt work. I would like to keep it a column chart, but it seems like I may not have a choice...however please let me know if you have a workaround I haven't thought of. Thanks so much!

1

There are 1 best solutions below

1
On BEST ANSWER

Do you have your categoryField defined in the series definition ? Something like

series: [{ field: 'value', categoryField: 'category', type: 'column' }]

I get a chart with only two category columns (http://jsbin.com/AcetIXAL/1/edit). But if I define the category in the categoryAxis as in

series: [{ field: 'value', type: 'column' }],
categoryAxis: { field: 'category' },

I get all three columns (http://jsbin.com/AcetIXAL/2/edit).