[FIXED] [#57] Am not Getting Radar Series Chart Dynamically.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [FIXED] [#57] Am not Getting Radar Series Chart Dynamically.

    Hi,
    i am unable to set the radar series style, makerconfig.radius, makerconfig.size in RadarSeries from codebehind help me,
    see the code of RadarSeries Chart.

    <%@ Page Language="C#"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            function saveChart(btn) {
                Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function (choice) {
                    if (choice == 'yes') {
                        btn.up('panel').down('chart').save({
                            type: 'image/png'
                        });
                    }
                });
            }
        </script>
    <script runat="server">
      
        protected void Page_Load(object sender, EventArgs e)
        {
           RadarSeries rs = new RadarSeries();
            rs.ShowMarkers = true;
            rs.ShowInLegend = true;
            Chart1.Series.Add(rs);
           
            RadialAxis ra = new RadialAxis();
            Chart1.Axes.Add(ra);
     
             rs.Style.Fill = "none";    //Am Getting Error here
            //rs.Style.Fill = "";
            rs.MarkerConfig.Radius = 5;  //Am Getting Error here
            rs.MarkerConfig.Size = 5;    //Am Getting Error here
            
            var ds = new[] {
                    new { Name = "Apples",  Data1 = "45.0" },
                    new { Name = "Oranges", Data1 = "35.0" },
                    new { Name = "Pears",   Data1 = "20.0" }
                };
        
            String[] str = new string[] { "Data1" };
            rs.YField = str;
            String[] str1 = new string[] { "Name" };
            rs.XField = str1;
    
            Store1.DataSource = ds;
            Store1.DataBind();
           Chart1.Render();
    }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Panel ID="Panel1" runat="server" Title="Radar Chart" Width="800" Height="600"
                StyleSpec="overflow:hidden;" Layout="FitLayout">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                            <ext:Button ID="Button3" runat="server" Text="Save Chart" Icon="Disk" Handler="saveChart" />
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:Chart ID="Chart1" runat="server" StyleSpec="background:#fff;" StandardTheme="Category2"
                        InsetPadding="20" Animate="true" >
                        <LegendConfig Position="Right" />
                        <Store>
                            <ext:Store ID="Store1" runat="server">
                                <Model>
                                    <ext:Model ID="Model1" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="Name" />
                                                <ext:ModelField Name="Data1" />
                                            </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                    </ext:Chart>
                </Items>
            </ext:Panel>
        </div>
        </form>
    </body>
    </html>
    Thank You.
    Last edited by fabricio.murta; Apr 26, 2016 at 10:10 PM.
  2. #2
    Hi @nagesh,

    Unfortunately, the sample throws:
    Parser Error Message: Could not load type 'DynamicChart3'.
  3. #3

    Hi Daniil

    Hi Daniil
    Check it once again now, it won't give any error.
    Thank You
  4. #4
    Sample now throws the following error:

    Compiler Error Message: CS0103: The name 'cn' does not exist in the current context
    Geoffrey McGill
    Founder
  5. #5
    OP updated sample, now throws following exception:

    Compiler Error Message: CS0246: The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?)
    Unfortunately, we're not going to be able to test if a SQL database is required. You'll have to create a local data source. Maybe a List of objects.
    Geoffrey McGill
    Founder
  6. #6
    when I run the sample, it throws an "Object reference not set to an instance of an object." exception on that line.

    Is the .Style property null?

    maybe you have to create a new instance of whatever object type the .Style property is and set that?
    Geoffrey McGill
    Founder
  7. #7

    Hi Mcgill

    Hi Mcgill,
    See the Below Image..
    Click image for larger version. 

Name:	fill.JPG 
Views:	135 
Size:	23.3 KB 
ID:	5100

Similar Threads

  1. [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
  2. [CLOSED] [#18] Chart: Single Column Series yField incorrect
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 29, 2012, 11:15 AM
  3. [OPEN] [#77] Chart legend problems with large amount of series
    By MWM2Dev in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Dec 21, 2012, 4:23 AM
  4. [CLOSED] chart series double click event
    By SymSure in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 04, 2012, 2:03 PM
  5. [CLOSED] Text on Series and Tool tips for Grouped Bar Chart
    By WHISHWORKS in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 16, 2012, 10:59 AM

Posting Permissions