[CLOSED] Cartesian Chart's Highlight

  1. #1

    [CLOSED] Cartesian Chart's Highlight

    On the following sample, bar is highlighted when it's hovered



    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this._pnl.ViewModel = new
            {
                stores = new
                {
                    priceData = new
                    {
                        fields = new string[] { "month", "price" },
                        data = new object[]
                        {
                            new { month = "Jan", price = 28 },
                            new { month = "Feb", price = 25 },
                            new { month = "Mar", price = 21 },
                            new { month = "Apr", price = 18 },
                            new { month = "May", price = 18 },
                            new { month = "Jun", price = 17 },
                            new { month = "Jul", price = 16 },
                            new { month = "Aug", price = 16 },
                            new { month = "Sep", price = 16 },
                            new { month = "Oct", price = 16 },
                            new { month = "Nov", price = 15 },
                            new { month = "Dec", price = 15 }
                        }
                    }
                }
            };
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel ID="_pnl" runat="server" Height="400" Title="Bar Chart" Layout="FitLayout">
                <Items>
                    <ext:CartesianChart runat="server" Animation="false" BindString="{priceData}">
                        <AnimationConfig Duration="500" Easing="EaseOut" />
                        <Axes>
                            <ext:NumericAxis Position="Left" Grid="true" Fields="month" />
                            <ext:CategoryAxis Position="Bottom" />
                        </Axes>
                        <Series>
                            <ext:BarSeries XField="month" YField="price">
                                <StyleSpec>
                                    <ext:SeriesSprite Opacity="0.8" MinGapWidth="10" />
                                </StyleSpec>
                                <HighlightConfig>
                                    <ext:Sprite FillStyle="rgba(249, 204, 157, 1.0)" StrokeStyle="black" LineWidth="2" />
                                </HighlightConfig>
                                <Tooltip runat="server" TrackMouse="true" StyleSpec="background: #fff">
                                    <Renderer Handler="this.setHtml(storeItem.get('price'));" />
                                </Tooltip>
                                <Label Field="price" Display="InsideEnd" />
                            </ext:BarSeries>
                        </Series>
                    </ext:CartesianChart>
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
    But if BarSeries' tooltip is removed (lines 55 to 57), bar' highlight stop working.

    <ext:CartesianChart runat="server" Animation="false" BindString="{priceData}">
        <AnimationConfig Duration="500" Easing="EaseOut" />
        <Axes>
            <ext:NumericAxis Position="Left" Grid="true" Fields="month" />
            <ext:CategoryAxis Position="Bottom" />
        </Axes>
        <Series>
            <ext:BarSeries XField="month" YField="price">
                <StyleSpec>
                    <ext:SeriesSprite Opacity="0.8" MinGapWidth="10" />
                </StyleSpec>
                <HighlightConfig>
                    <ext:Sprite FillStyle="rgba(249, 204, 157, 1.0)" StrokeStyle="black" LineWidth="2" />
                </HighlightConfig>
                <Label Field="price" Display="InsideEnd" />
            </ext:BarSeries>
        </Series>
    </ext:CartesianChart>
    Any ideas to overcome it?

    Thanks in advance.
    Attached Thumbnails Click image for larger version. 

Name:	ct001.png 
Views:	7 
Size:	6.2 KB 
ID:	21981  
    Last edited by Daniil; Mar 03, 2015 at 11:08 AM. Reason: [CLOSED]
  2. #2
    Hello Raphael!

    Add this to your <ext:CartesianChart ...> definition:

                        <Interactions>
                            <ext:ItemHighlightInteraction />
                        </Interactions>
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3

Similar Threads

  1. [CLOSED] GridPanel CellEditing highlight
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 12, 2013, 11:32 AM
  2. How to highlight whole column in GridPanel
    By Pislburry in forum 2.x Help
    Replies: 5
    Last Post: Oct 29, 2013, 5:17 PM
  3. [CLOSED] Highlight a slice of pie chart programmatically
    By jchau in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 12, 2012, 12:23 PM
  4. Replies: 2
    Last Post: Jun 07, 2012, 4:29 PM
  5. Highlight changed controls
    By Zdenek in forum 1.x Help
    Replies: 1
    Last Post: Mar 19, 2012, 6:46 AM

Posting Permissions