[OPEN] [#37] Column gradient problem

  1. #1

    [OPEN] [#37] Column gradient problem

    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,10},
                    new object[] {2,20},
                    new object[] {3,21},
                    new object[] {4,1},
                    new object[] {5,18},
                    new object[] {6,30},
                    new object[] {7,25},
                    new object[] {8,14},
                    new object[] {9,11},
                    new object[] {10,9},
                    new object[] {11,3},
                    new object[] {12,45},           
                    new object[] {13,10},
                    new object[] {14,15},
                    new object[] {15,21},
                    new object[] {16,1},
                    new object[] {17,18},
                    new object[] {18,30},
                    new object[] {19,25},
                    new object[] {20,14}
            };
            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">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Panel ID="Panel2" runat="server" Layout="HBoxLayout" BaseCls="x-plain" Width="800px" Height="30px" >
                            <LayoutConfig>
                                <ext:HBoxLayoutConfig Align="Middle" Pack="Start"></ext:HBoxLayoutConfig>
                            </LayoutConfig>
                            <Items>
                                <ext:Button ID="btnsaveChart" runat="server" Icon="Disk">
                                    <Listeners>
                                        <Click Handler="saveChart('chartETTR')">
                                        </Click>
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            </ext:Panel>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <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" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                                </store>
    
                                <Axes>
                                    <ext:NumericAxis Fields="Value1" 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>
                                <Gradients>
                                    <ext:Gradient GradientID="bar-gradient" Angle="90">
                                        <Stops>
                                            <ext:GradientStop Offset="0" Color="#CCFFFF" />
                                            <ext:GradientStop Offset="70" Color="#00FFFF" />
                                            <ext:GradientStop Offset="100" Color="#0000FF" />
                                        </Stops>
                                    </ext:Gradient>
                                </Gradients>
    
                                <Series>
                                    <ext:ColumnSeries Axis="Left" XField="Month" YField="Value1"  Title="Value1">             
                                        <Style Fill="url(#bar-gradient)" StrokeWidth="2" />
                                    </ext:ColumnSeries>
    
                                </Series>
                            </ext:Chart>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Window>
        </form>    
    </body>
    </html>
    Question : what's wrong with the gradient? I take example from the mixed chart examples
    Last edited by Baidaly; Nov 17, 2012 at 12:36 AM.
  2. #2
    Hi,

    Thank you for the report.

    I reported to Sencha.
    http://www.sencha.com/forum/showthread.php?243382

    Lets wait what they will answer.
  3. #3
    Sencha opened a bug ticket. I will monitor.
  4. #4
    I have updated the thread with a temporary workaround.
    http://www.sencha.com/forum/showthre...l=1#post895747

    Example
    <Renderer Handler="attributes.fill = 'red'; return attributes;" />
  5. #5
    Thanks, but it's used to fill the column with a fixed color, not a gradient one, if I understand well, so I will wait for a fix, as it is not the goall I want to achieve.
  6. #6
    It should work with gradients as well.
  7. #7
    I'm on Ext.JS documentation now, but where I can find properties for attributes? If I search attributes I found nothing.
  8. #8
    Please use:
    <Renderer Handler="attributes.fill = 'url(#bar-gradient)'; return attributes;" />
    I'm on Ext.JS documentation now, but where I can find properties for attributes?
    I think it is standard SVG attributes.
  9. #9
    Thanks, it works.
  10. #10
    Opened an Issue to track this defect, see

    https://github.com/extnet/Ext.NET/issues/37

Similar Threads

  1. Problem with column editor
    By wszbdyyy in forum 2.x Help
    Replies: 1
    Last Post: Aug 14, 2012, 10:52 AM
  2. Problem with Ext.Net Chart - Column
    By OCaglayan in forum 2.x Help
    Replies: 1
    Last Post: Jul 31, 2012, 12:43 PM
  3. [CLOSED] And now, what about gradient color in collumn chart?
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 05, 2012, 2:04 PM
  4. Replies: 2
    Last Post: Mar 02, 2012, 1:07 PM
  5. problem with fixing command column
    By oseqat in forum 1.x Help
    Replies: 6
    Last Post: Jul 25, 2011, 3:13 PM

Posting Permissions