I have an issue wherein a column category chart that has numbers (really that begins with a number) are displaying incorrectly. If the series name is fully a number, it does not display the series at all, if it is a partial number, it will display the series with some formatting attempted to be applied to the legend and tooltip. Below is the resulting chart along with the data bound to the dataSource. You can see there is a missing series and that the existing series 20x21 has formatted applied as if it is parsing it out in some way. A2020 is fine because it begins with a letter.
My first thought was that with JS alphabetizing object properties, the X-axis group somehow had to be first, but that doesn't seem to be the case. I looked through the source code trying to find where it reads the data object sent in to parse out the series, to no avail. Any ideas?
Hello Matt,
I have been investigating into the behavior you are seeing and discussing this with my colleagues, and I have reproduced the issue you are seeing. It appears at the moment that properties with full names that are completely numeric are being ignored, as they are being handled as indexes rather than dot-notation properties.
I am curious as to what reason you have fully-numeric named properties in this case though? Is this an attempt to have the “2022” show up in the legend? If it is, there is another way to achieve this, which is to utilize the seriesAdded event of the IgxCategoryChart. This event will allow you to get the series that is being added and set its title property, which is where the legend label comes from.
Please let me know if you have any other questions or concerns on this matter.
Thank you, Andrew. In our use case, it may be common that a year would be a series title, so in that fake-but-similar-to-reality example above, we have each team and the number of wins by year, and of course year is a number. We could swap the X-axis category and series, but I am unsure how practical that is in all applications.
I will look at seriesAdded to see if we can maybe start with an injected string prefix and then remove it in that event or something along those lines. That sounds like it ought to work. Thanks for the feedback.