• Resolved frasermarlow

    (@frasermarlow)


    ChartJS will allow for the use of timelines for the Horizontal axis ( see seen at https://www.chartjs.org/samples/latest/scales/time/line.html ) – but I can’t figure out how to get this working in M Chart. The horizontal axis has an option for ‘Time’ under ‘units’ but it is greyed out…
    So for example, if you have three data points for 1/1/2000, 1/1/2001 and 1/1/2019 it will space out the axis accordingly, and not just show the three as evenly spaced. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter frasermarlow

    (@frasermarlow)

    Plugin Author methnen

    (@methnen)

    The Units stuff is a WP taxonomy and is not integrated with the graphing library at this point in any way.

    By default the plugin tries to use the graphing library in as generic a way as possible to support “most people’s” needs in an interface that doesn’t get overly complicated.

    That results in things like date support in the way you’re indicating not something I have a solution for yet.

    All of that said, there is a filter hook that lets you tweak the chart arguments before right before they get compiled for the graphing library.

    You can find some info about that here:

    https://github.com/methnen/m-chart/wiki/Action-and-filter-hooks#m_chart_chart_args

    I haven’t had a chance to update the docs to mention Chart.js so the example and text implies that this is all Highcharts related but it functions in exactly the same way for Chart.js only the options are different.

    Think of settings as a PHP array instead of a Javascript object and it’s fairly easy to translate what you want into something that will work.

    If you’d like some help with the actual implementation of this let me know as an issue on Github and I’m happy to do what I can usually.

    Plugin Author methnen

    (@methnen)

    Also just in general, I’ll notice requests for help on Github immediately as it sends me an alert. WordPress does not send me an alert. I try to check semi regularly but that’s why my reply was so delayed.

    Thread Starter frasermarlow

    (@frasermarlow)

    OK, thanks. Don’t worry about the speed of response. This is very useful. If you were a paid theme, that would be something else. The community really appreciates your contribution. Cheers, F

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Timeline (Horiz axis)’ is closed to new replies.