[CLOSED] Hide pie chart when total value is 0

  1. #1

    [CLOSED] Hide pie chart when total value is 0

    Hi guys,

    i have a pie chart same: https://examples2.ext.net/#/Chart/Pie/Basic/

    i would like hide chart but display legend when total value is 0.

    Click image for larger version. 

Name:	chart.png 
Views:	62 
Size:	2.9 KB 
ID:	5146

    Regards

    Yoann
    Last edited by Daniil; Nov 22, 2012 at 1:05 PM. Reason: [CLOSED]
  2. #2
    Hi Yoann,

    I see a legend item for the "0" pie. Please provide your test case.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store s = this.Chart1.GetStore();
                s.Data = new object[]
                {
                    new 
                    {
                        name = "1",
                        x = 0
                    },
                    new 
                    {
                        name = "2",
                        x = 50
                    },
                    new 
                    {
                        name = "3",
                        x = 100
                    }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Chart 
            ID="Chart1" 
            runat="server" 
            Width="400" 
            Height="400">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="name" />
                                <ext:ModelField Name="x" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <LegendConfig />
            <Series>
                <ext:PieSeries AngleField="x" ShowInLegend="true" />
            </Series>
        </ext:Chart>
    </body>
    </html>
  3. #3
    Thanks for this,
    i have replace my List<T> by your object and it's ok

Similar Threads

  1. [CLOSED] [#109] How to hide label in pie chart when value is 0
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 14, 2013, 11:48 AM
  2. [CLOSED] [#8] Chart: Hide Line Series values
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 14, 2013, 5:41 AM
  3. [CLOSED] How to set Paging toolbar total page count and total records?
    By rnachman in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 10, 2012, 4:38 PM
  4. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  5. [CLOSED] store total record count assign (e.Total)
    By majestic in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 23, 2012, 12:13 PM

Posting Permissions