Results 1 to 7 of 7

Thread: Line chart tooltip not shown exact value

  1. #1
    Sencha User
    Join Date
    Mar 2015
    Location
    Chennai
    Posts
    10

    Default Line chart tooltip not shown exact value

    When we have two line series closer in gxt 3.1 chart, tooltip is not showing the exact value.Also tooltip is not hiding immediately once if I remove the mouse point.(Please refer attachment ) I gave the follwing parameter in my code,

    tooltip.setShowDelay(0);
    tooltip.setHideDelay(0);
    tooltip.setDismissDelay(0);


    Thanks in Advance
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by marudhai_S View Post
    When we have two line series closer in gxt 3.1 chart, tooltip is not showing the exact value.Also tooltip is not hiding immediately once if I remove the mouse point.(Please refer attachment ) I gave the follwing parameter in my code,

    tooltip.setShowDelay(0);
    tooltip.setHideDelay(0);
    tooltip.setDismissDelay(0);


    Thanks in Advance
    Hmm, it seems like 5,47 is the value or the tooltip of the other series. Isn't it?
    Is there one tooltip for both series or a tooltip for each lineseries?
    Please provide more code or a showcase.

  3. #3
    Sencha User
    Join Date
    Mar 2015
    Location
    Chennai
    Posts
    10

    Default

    Hello Andreas Samjeske,
    5.47 is the value of upper line(there are two line) ,but its displaying in bottom line.Bottom line value is 0,instead of displaying 0 its displayed 5.47.
    I am creating line series dynamically,for each and every line series new tooltip i am creating,the method is,

    private LineSeries<ModelItem> createLine(String field) {
    MapValueProvider valueProvider = new MapValueProvider(field);


    LineSeries<ModelItem> series = new LineSeries<ModelItem>();
    series.setYAxisPosition(Position.LEFT);
    Color color = new RGB((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255));
    series.setStroke(color);
    series.setStrokeWidth(2);
    SeriesToolTipConfig<ModelItem> tooltip = new SeriesToolTipConfig<ModelItem>();
    tooltip.setLabelProvider(new SeriesLabelProvider<ModelItem>() {

    public String getLabel(ModelItem item, ValueProvider<? super ModelItem, ? extends Number> valueProvider) {
    if(valueProvider.getValue(item).toString().contains(".")){
    return NumberFormat.getFormat("0.00").format(valueProvider.getValue(item));
    }else{
    return ""+valueProvider.getValue(item);
    }
    }
    });
    tooltip.setShowDelay(0);
    tooltip.setHideDelay(0);
    tooltip.setDismissDelay(0);
    series.setToolTipConfig(tooltip);

    series.setYField(valueProvider);


    series.setLineHighlighter(new SeriesHighlighter() {


    public void highlight(Sprite sprite) {
    DrawFx.createStrokeWidthAnimator(sprite, 6).run(250);
    }


    public void unHighlight(Sprite sprite) {
    DrawFx.createStrokeWidthAnimator(sprite, 3).run(250);
    }
    });


    return series;
    }

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    If you post code please use code tags like these [ CODE ]<your code here>[ /CODE ] (without spaces). It makes the code much easier to read.

    Do these wrong values only appear, where the two lines are close to each other?
    My guess is, there are two tooltips ontop of each other.
    Try this:
    Code:
    series.setSelectionTolerance(2.0);
    One last thing: where do the tooltips appear? Always close to xAxis or close to series?

  5. #5
    Sencha User
    Join Date
    Mar 2015
    Location
    Chennai
    Posts
    10

    Default

    Thanks Andreas Samjeske,its worked for me. But still some issues are there,
    1. When I move the cursor from one line to another ToolTip get overlapped and not hided immediately.
    2. Multiple items in chart legend area get hided in legend portion itself.(In attachment 6 lines are there,if I have more then that,chart legend is not enough to display all the items).
    Please see the attachment,thanks for your reply .
    Attached Images Attached Images

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by marudhai_S View Post
    Thanks Andreas Samjeske,its worked for me. But still some issues are there,
    1. When I move the cursor from one line to another ToolTip get overlapped and not hided immediately.
    I guess
    Code:
    tooltip.setDismissDelay(0);
    is to blame. Setting it to zero has special meaning: tooltips never disappear. In fact they do, but only if you leave chart area with mouse.
    Give it a try and set it to 1000.
    Quote Originally Posted by marudhai_S View Post
    2. Multiple items in chart legend area get hided in legend portion itself.(In attachment 6 lines are there,if I have more then that,chart legend is not enough to display all the items).
    Please see the attachment,thanks for your reply .
    I think this is a known bug. Do you use the latest GXT 3.1.x? Search the forum for bugs on chart legend. Maybe you shall put the legend on charts right side, if you have a lot of lines in it.

  7. #7
    Sencha User
    Join Date
    Mar 2015
    Location
    Chennai
    Posts
    10

    Default

    thanks a lot
    Yes I am using gxt 3.1

    Thanks,
    Marudhai

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •