• Andry

    (@blackstar1991)


    Hi, I need to create chart by years. My data –

    2011	43
    2012 69
    2013 53
    2014 54
    2015 60
    2016 62
    2017 56
    2018 58
    2019 40
    2020 49
    2021 44
    2022 40
    2023 38
    2024 22

    But when I write it in the plugin, it doesn’t want to display it correctly.

    But if I add for first two cell ‘2011 year’ ‘2012 year’ it showing correct.

    If I understand correctly, it breaks on the definition of the data type. Can you fix this problem?

    *I try to set up Year for Horizontal Axis but it don’t help

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author methnen

    (@methnen)

    I don’t understand the question completely.

    The plugin will create a chart out of whatever data you put into it.

    I don’t “type” the data going in or out to Chart.js on purpose because it’s basically impossible to know what type of data it might be and trying to auto recognize things like dates is very problematic.

    Everything is either a number or a string as far as the plugin is concerned.

    You can use dates if you want and as long as those dates are formatted in a way that works and includes all of the data and date values you want to display it will work fine. There’s many examples of people doing that with this plugin including in the examples in the wiki.

    But it seems you’re trying to do something else.

    The Units thing is more for Display and Tagging purposes (it’s linked to a WP Taxonomy)

    Thread Starter Andry

    (@blackstar1991)

    Just input the data from my first post into your plugin to create a chart in type column, and you’ll see the error I’m talking about.

    Plugin Author methnen

    (@methnen)

    OK, so there’s something going on here that I’m not immediately positive on.

    But try formatting the data like this with a label on the first row for the data set:

    https://methnen-dropshare.s3.amazonaws.com/pb-67EyrN3kYB.png

    Let me know if that solves the issue you’re having?

    Thread Starter Andry

    (@blackstar1991)

    No, delite word – Suicides from first row. And move everything up
    Left only data for creating chart https://monosnap.com/file/ijpWdlaM8VFMGlAqvMfu8p1llRZLKy

    You will see trouble

    • This reply was modified 2 months, 1 week ago by Andry.
    Plugin Author methnen

    (@methnen)

    Yes, that’s why I was saying add it in and I think it will work.

    I believe, what’s happening is that the plugin is getting confused because there’s only numbers in all of the cells. So it’s having trouble deciding what is a potential label and what isn’t.

    Adding the label to the first row fixes this.

    I’ll have to figure out if I can think of an efficient way to fix this longer term.

    Oddly enough I think you might be the first person who’s ever brought this up.

    Thread Starter Andry

    (@blackstar1991)

    It’s funny.

    I solved this problem by adding a ‘SPACE’ (U+0020) -> Alt+32 for first numbers…But this is a very bad decision in my opinion.

    • This reply was modified 2 months, 1 week ago by Andry.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.