Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Standalone IChart suppress popup tooltips?
 Post subject: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Tue 04 Jun, 2013, 03:43 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Is there a way to suppress the tooltips, or popup labels like "Label" or "Horizontal line"
when the mouse hovers over the chart items?
I could iterate through all IChartObjects, I guess, and set the tooltip to null or nothing...
But is there a way to disable them for a chart?
Thanks!
HyperScalper


 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Wed 05 Jun, 2013, 19:22 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Hey, somebody out there knows the answer to my question. Pleeeez.

(Just the old-fashioned API...) :)

HyperScalper


 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Thu 06 Jun, 2013, 07:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hyperscalper wrote:
But is there a way to disable them for a chart?
No.
hyperscalper wrote:
I could iterate through all IChartObjects, I guess, and set the tooltip to null or nothing...
That is the way to achieve this.


 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Thu 06 Jun, 2013, 15:36 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
For my ILabelChartObject items, I am able to modify the tooltip using setTooltip(String).

Also successful for IVerticalLineChartObject items.

However, for IHorizontalLineChartObject items, it seems even though I modify the tooltip string, they continue to display the generic "Horizontal Line" where the mouse hovers over them, which looks like a bug to me.

HyperScalper


 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Mon 17 Jun, 2013, 13:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We can't replicate this please provide your case. We used the following strategy:
package jforex.charts;

import com.dukascopy.api.*;
import com.dukascopy.api.drawings.IChartObjectFactory;

public class TooltipTest implements IStrategy {

    private IChart chart;
    private IHistory history;
    private IConsole console;
   
    @Configurable("")
    public Instrument instrument = Instrument.EURUSD;
    @Configurable("line count")
    public int lineCount = 10;   
   
   
    @Override
    public void onStart(IContext context) throws JFException {
        this.chart = context.getChart(instrument);
        this.history = context.getHistory();
        this.console = context.getConsole();
       
        if(chart == null){
            console.getErr().println("No chart opened for " + instrument);
            return;
        }
        IChartObjectFactory factory = chart.getChartObjectFactory();
        double basePrice = history.getLastTick(instrument).getBid();
       
        IChartObject object;
        for(int i=0; i< lineCount; i++){
            //hline every 2 pips
            object = factory.createHorizontalLine("h"+i, basePrice + instrument.getPipValue() * 2 * i);
            object.setTooltip("Hline " + i);
            chart.add(object);
            //vline every 2 feed elements
            object = factory.createVerticalLine("v"+i, history.getFeedData(chart.getFeedDescriptor(), i * 2).getTime());
            object.setTooltip("Vline " + i);
            chart.add(object);
        } 
    }

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {    }

    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}

    @Override
    public void onMessage(IMessage message) throws JFException {}

    @Override
    public void onAccount(IAccount account) throws JFException {}

    @Override
    public void onStop() throws JFException {
        chart.removeAll();
    }

}


Attachments:
TooltipTest.java [1.88 KiB]
Downloaded 391 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Wed 19 Jun, 2013, 20:07 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
I will check. Vertical line tooltip is OK for me, it is just Horizontal which has the issue.

Thank you for investigating this, I'll get back with some more detail.

This is standalone client with standalone charting v 2.7.9 API.

HyperScalper


 
 Post subject: Re: Standalone IChart suppress popup tooltips? Post rating: 0   New post Posted: Wed 19 Jun, 2013, 20:21 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
OK, seems an error on my side.

setTooltip("") was not eliminating the tooltip.
setTooltip("*") does replace the tooltip on horizontal line.

So, it seems that an empty string is ignored, but a non-empty string works.

Problem resolved for me.

Thanks for your help !!
HyperScalper


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com