[CLOSED] [#44] Bug in tooltip in chart or not?

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] [#44] Bug in tooltip in chart or not?

    Hello

    Please look at this example:

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new object[]
            {
       new object[] {1,1000,200,1550},
                    new object[] {2,1500,300,1450},
                    new object[] {3,2102,452,3200},
                    new object[] {4,1,125,952},
                    new object[] {5,18,214,458},
                    new object[] {6,30,57,480},
                    new object[] {7,25,38,452},
                    new object[] {8,14,189,650},
                    new object[] {9,11,170,520},
                    new object[] {10,9,98,152},
                    new object[] {11,3,78,259},
                    new object[] {12,45,120,454},           
                    new object[] {13,10,200,550},
                    new object[] {14,15,300,450},
                    new object[] {15,21,452,800},
                    new object[] {16,1,125,952},
                    new object[] {17,18,214,458},
                    new object[] {18,30,57,480},
                    new object[] {19,25,38,452},
                    new object[] {20,14,189,650},
                    new object[] {21,11,170,520},
                    new object[] {22,9,98,152},
                    new object[] {23,3,78,259},
                    new object[] {24,45,120,454},
                    new object[] {25,10,200,550},
                    new object[] {26,15,300,450},
                    new object[] {27,21,452,800},
                    new object[] {28,1,125,952},
                    new object[] {29,1800,214,4580},
                    new object[] {30,3000,57,4800},
                    new object[] {31,2500,38,4520}
            };
            this.Store1.DataBind();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>Charts - Ext.NET Examples</title>
    
        <style type="text/css">    
            .x-panel {
                margin-bottom : 20px;
            }
        </style>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
            <ext:Window 
                ID="wndETTRChart"
                runat="server" 
                Width="320"
                Height="505"
                Hidden="False" 
                ExpandOnShow="True" 
                MinWidth="320" 
                MinHeight="505" 
                Maximizable="true" 
                Minimizable="false"
                Closable="false"
                Resizable="true" 
                TitleCollapse="false" 
                Title="Test" 
                TitleAlign="Center"
                Collapsible="false"
                Layout="FitLayout">
                <Items>
                    <ext:Panel ID="Panel1"
                        runat="server"
                        Layout="FitLayout">
                        <Items>
                            <ext:Chart runat="server" InsetPadding="5" ID="chartETTR" Animate="true">
                                <LegendConfig Position="Bottom" />
                                <store>
                                <ext:Store ID="Store1" runat="server">
                                    <Reader>
                                        <ext:ArrayReader />
                                    </Reader>
                                    <Model>
                                        <ext:Model ID="Model1" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="Month" />
                                                <ext:ModelField Name="Value1" />
                                                <ext:ModelField Name="Value2" />
                                                <ext:ModelField Name="Value3" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                                </store>
    
                                <Axes>
                                    <ext:NumericAxis Fields="Value1, Value2, Value3" Grid="true" >
                                        <Label Font="10px Arial">
                                            <Renderer Handler="return Ext.util.Format.number(value, '0,0');" />
                                        </Label>
                                    </ext:NumericAxis>
    
                                    <ext:CategoryAxis Position="Bottom" Fields="Month" AdjustEnd="true">
                                        <Label>
                                            <Rotate Degrees="270" />
                                        </Label>
                                    </ext:CategoryAxis>
                                </Axes>
    
                                <Series>
                                    <ext:LineSeries Axis="Left" XField="Month" YField="Value1" Title="P25">
                                        <Tips ID="Tips1" runat="server" TrackMouse="true" Width="80" Height="40">                            
                                            <Renderer Handler="this.setTitle(storeItem.get('Month') + '<br />' + storeItem.get('Value1')); this.update(storeItem.get('Value1'));"></Renderer>
                                        </Tips>
                                        <MarkerConfig 
                                            Type="Circle" 
                                            Size="2" 
                                            Radius="2" 
                                            StrokeWidth="0" 
                                            />
                                    </ext:LineSeries>
                                    <ext:LineSeries Axis="Left" XField="Month" YField="Value2" Title="P50">
                                        <Tips ID="Tips2" runat="server" TrackMouse="true" Width="80" Height="40">                            
                                            <Renderer Handler="this.setTitle(storeItem.get('Month') + '<br />' + storeItem.get('Value2')); this.update(storeItem.get('Value2'));"></Renderer>
                                        </Tips>
                                        <MarkerConfig 
                                            Type="Circle" 
                                            Size="2" 
                                            Radius="2" 
                                            StrokeWidth="0" 
                                            />
                                    </ext:LineSeries>
                                    <ext:LineSeries Axis="Left" XField="Month" YField="Value3" Title="P75">
                                        <Tips ID="Tips3" runat="server" TrackMouse="true" Width="80" Height="40">                            
                                            <Renderer Handler="this.setTitle(storeItem.get('Month') + '<br />' + storeItem.get('Value3')); this.update(storeItem.get('Value3'));"></Renderer>
                                        </Tips>
                                        <MarkerConfig 
                                            Type="Circle" 
                                            Size="2" 
                                            Radius="2" 
                                            StrokeWidth="0" 
                                            />
                                    </ext:LineSeries>
                                </Series>
                            </ext:Chart>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Window>
        </form>    
    </body>
    </html>
    Look at 2 first and 2 last tooltip, then grow up the window and look again.

    You can see that if window is small, dirst and last item tooltip did not show the right value, but the chart is well drawn (that means, that it is the good value that are drawn).

    Look particularly to 29, 30 and 31 value, when window is small, pointing on 31 show 29, it is like the point 29 and 31 was too close to display the good value, pointing on item 31 show item 29.
    And compare P75 to P50 item, P75 are goof (point are far), P75 not, points are close.
    Last edited by Daniil; Apr 19, 2013 at 2:26 PM. Reason: [CLOSED]
  2. #2
    Hi @feanor91,

    Thank you for the excellent example as usual.

    I would agree it is a bug. I think it will not be easy to fix, but, anyway, I will report to Sencha. It will take some time to prepare a bug report.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @feanor91,

    Thank you for the excellent example as usual.

    I would agree it is a bug. I think it will not be easy to fix, but, anyway, I will report to Sencha. It will take some time to prepare a bug report.
    You'r welcome :)

    I investigate a little more, and I found it is the mouse position that is not well returned if 2 points are too close, I didn't know how the browser make the discrimination in pixel from one point to another and perhaps, it works on a browser and not into another, I will try tomorrow and report. For now, I only conduct tests in Chrome.
  4. #4
    I tested with FireFox.

    I guess these "sensitive" areas are managed on ExtJS level. I am just not sure there is a good possibility to shrink these areas.
  5. #5
    Quote Originally Posted by Daniil View Post
    I tested with FireFox.
    OK

    I guess these "sensitive" areas are managed on ExtJS level. I am just not sure there is a good possibility to shrink these areas.
    Yes, me too :(
  6. #6
    I reported:
    http://www.sencha.com/forum/showthread.php?243347

    Lets wait what they will answer.

    Here is a simplified ASPX example to reproduce.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new object[]
            {
                    new object[] {1, 1550},
                    new object[] {2, 1450},
                    new object[] {3, 3200},
                    new object[] {4, 952},
                    new object[] {5, 458},
                    new object[] {6, 480},
                    new object[] {7, 452},
                    new object[] {8, 650},
                    new object[] {9, 520},
                    new object[] {10, 152},
                    new object[] {11, 259},
                    new object[] {12, 454},           
                    new object[] {13, 550},
                    new object[] {14, 450},
                    new object[] {15, 800},
                    new object[] {16, 952},
                    new object[] {17, 458},
                    new object[] {18, 480},
                    new object[] {19, 452},
                    new object[] {20, 650},
                    new object[] {21, 520},
                    new object[] {22, 152},
                    new object[] {23, 259},
                    new object[] {24, 454},
                    new object[] {25, 550},
                    new object[] {26, 450},
                    new object[] {27, 800},
                    new object[] {28, 952},
                    new object[] {29, 4580},
                    new object[] {30, 4800},
                    new object[] {31, 4520}
            };
            this.Store1.DataBind();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Examples</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:Chart runat="server" Width="300" Height="500">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Reader>
                        <ext:ArrayReader />
                    </Reader>
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="Month" />
                                <ext:ModelField Name="Value" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <Axes>
                <ext:NumericAxis Fields="Value" />
                <ext:CategoryAxis Position="Bottom" Fields="Month" />
            </Axes>
            <Series>
                <ext:LineSeries XField="Month" YField="Value">
                    <Tips runat="server" TrackMouse="true">
                        <Renderer Handler="this.update(storeItem.get('Month') + '<br />' + storeItem.get('Value'));" />
                    </Tips>
                </ext:LineSeries>
            </Series>
        </ext:Chart>
    </body>
    </html>
    Last edited by Daniil; Sep 21, 2012 at 7:25 AM.
  7. #7
    Perfect

    wait and see
  8. #8
    Sencha opened a bug ticket. I will monitor.
  9. #9
    Opened an Issue to track this defect, see

    https://github.com/extnet/Ext.NET/issues/44
  10. #10
    This thread led me to gave this issue another try.
    http://forums.ext.net/showthread.php?24430

    And bingo, I found the selectionTolerance property. It is all that we need.
    http://docs.sencha.com/extjs/4.2.0/#...ctionTolerance

    It is 20 by default. Nothing stops us to decrease it.
    <ext:LineSeries ... SelectionTolerance="3">
    3 is the default radius of markers.

    @feanor91, apologize that I did not discover it earlier. This property exists since ExtJS 4.0.0.

    I am closing the ticket.
Page 1 of 2 12 LastLast

Similar Threads

  1. Pie chart example
    By Gamerome in forum 2.x Help
    Replies: 2
    Last Post: Sep 09, 2012, 7:17 PM
  2. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  3. Replies: 1
    Last Post: Jun 02, 2012, 7:12 AM
  4. Chart
    By zanotto in forum 2.x Help
    Replies: 7
    Last Post: Mar 09, 2012, 11:47 AM
  5. How to Add Chart in Ext.Net Applicatim
    By archana in forum 1.x Help
    Replies: 1
    Last Post: Jan 08, 2012, 5:19 AM

Posting Permissions