• Resolved poleg

    (@poleg)


    Hi!
    Is it possible to change the frequency of grid on the x axis?
    For example, to show the date on the axis twice less often – not every year, but for example in three years – 1986, 1989, 1992 etc.?

    • This topic was modified 3 years, 11 months ago by poleg.

    The page I need help with: [log in to see the link]

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

    (@methnen)

    Obviously there’s no GUI control for this, but you should be able to do it via a theme (if you’re using Highcharts) or a filter hook in either case.

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

    This hook allows you to change the chart arguments right before they are passed to either charting library. Chart.js/Highcharts.

    The chart args are in the form of a PHP array that gets converted to a JS object that the charting library then uses.

    https://www.chartjs.org/docs/latest/

    https://www.highcharts.com/docs/index

    Thread Starter poleg

    (@poleg)

    Yes, I use Highcharts, could you please provide details (may be simple example) how I can control grid via a theme?

    I tried use this file

    <?php
    
    /**
     * Theme Name: Limeaid
     */
    
    return array(
    	'colors' => array(
    		'#59a80f',
    		'#9ed54c',
    		'#c4ed68',
    		'#e2ff9e',
    		'#f0F2dd',
    	),
    );

    and it works, but how I can control axis grid?

    Thank you!

    • This reply was modified 3 years, 11 months ago by poleg.
    • This reply was modified 3 years, 11 months ago by poleg.
    • This reply was modified 3 years, 11 months ago by poleg.
    Thread Starter poleg

    (@poleg)

    This works!

    <?php
    return array(
        'xAxis' => array(
            'tickInterval' =>  '15',
        ),	
    );
    Plugin Author methnen

    (@methnen)

    Yep you got it. I’d still give it a name so you know what the theme does:

    
    <?php
    /**
     * Theme Name: Tick Interval
     */
    
    return array(
        'xAxis' => array(
            'tickInterval' =>  '15',
        ),	
    );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Axis grid frequency’ is closed to new replies.