Open extra topbar

Default timeframe for exchange chart

I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Default timeframe for exchange chart

dashed-slug.net Forums Exchange extension support Default timeframe for exchange chart

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11633
    LeinAd
    Participant

    is there a way to give the charts 1d or so as fixed value? i tried to change in code but it begun with 30min always.

    btw.. it is possible to use trading view??

    #11640
    alexg
    Keymaster

    Hello,

    It is unfortunately not currently possible to change the defaults. (This will be easy in the upcoming release, since the JavaScript code attached to the views will be overridable.)

    For now, you can go ahead and edit the file wp-content/plugins/wallets-exchange/assets/scripts/wallets-exchange.js on line 1260:

    self.selectedTimeframe = ko.observable( '30m' );

    It’s safe to edit this file because I don’t expect to be releasing any more exchange versions before the wallets6 release.

    The chart already uses the TradingView library.

    with regards

    #11641
    alexg
    Keymaster

    I forgot to mention, delete the minified JavaScript file wallets-exchange-{version}.min.js so that the plugin will fall back to the code you’ve edited.

    #11643
    alexg
    Keymaster

    An alternative to the above would be to simply add the following in your child theme’s functions.php:

    add_action(
    	'wp_enqueue_scripts',
    	function() {
    
    		wp_add_inline_script(
    			'wallets-exchange',
    			<<<JS
    
    				jQuery('html').on(
    					'wallets_ready',
    					function( event, coins, nonces ) {
    						wp.wallets.viewModels.walletsExchangeChart.selectedTimeframe('1d');
    					}
    				);
    JS
    		);
    	}
    );

    The JS characters must be the first characters on the line, because they close a heredoc string.

    #11674
    LeinAd
    Participant

    ok ty… but i need to find out, why charts so ugly.. maybe my theme

    Attachments:
    You must be logged in to view attached files.
    #11678
    alexg
    Keymaster

    No, this is what the chart looks like.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.