[CLOSED] Column Series Grouping - Help

  1. #1

    [CLOSED] Column Series Grouping - Help

    Dear Team

    I want to generate a chart like shown below by using ext.net charts, please see the image below FYI


    I am not getting any idea how to use Numeric Axis, Category Axis and Bar/Column Series for the below data structure. Please advise any possible solution.

    public class CompetencyCount
        {
            public string Competency { get; set; }
            public double Count { get; set; }
        }
        public class EmployeeCompetencyData
        {
            public string JobTitle { get; set; }
            public List<CompetencyCount> CompetencyCount { get; set; }
        }
        public partial class columnSeries : System.Web.UI.Page
        {
            string[] jobTitles = { "Developer", "Team Lead", "Project Manager", "Quality Control", "Business Analyst", "Region Head" };
            string[] competency = { "Surveying", "Scientific Method", "Engagement", "Public Awareness", "Ethics", "Business Management", "Information Management", "Poeple Management", "Self Management", "Health and Safety" };
    
            public List<EmployeeCompetencyData> GetEmpCompetencyLevels()
            {
                List<EmployeeCompetencyData> data = new List<EmployeeCompetencyData>();
                Random random = new Random();
                for (int i = 0; i < jobTitles.Length; i++)
                {
                    EmployeeCompetencyData objData = new EmployeeCompetencyData();
                    List<CompetencyCount> lstComptencyCount = new List<CompetencyCount>();
                    for (int j = 0; j < competency.Length; j++)
                    {
                        CompetencyCount objCount = new CompetencyCount { Competency = competency[j], Count = random.Next(1, 10) };
                        lstComptencyCount.Add(objCount);
                    }
                    objData.CompetencyCount = lstComptencyCount;
                    data.Add(objData);
                }
                return data;
            }
    
            protected void Page_Load(object sender, EventArgs e)
            {
                Store3.Data = this.GetEmpCompetencyLevels();
                Store3.DataBind();
            }
        }
    
    <ext:ResourceManager ID="rm" runat="server" Theme="Neptune" />
                <ext:CartesianChart ID="Chart1" runat="server" Height="400" Width="400">
                    <Store>
                        <ext:Store ID="Store3" runat="server">
                            <Model>
                                <ext:Model ID="Model9" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="JobTitle" />
                                        <ext:ModelField Name="CompetencyCount">
                                            <Model>
                                                <ext:Model ID="Model1" runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="Competency" />
                                                        <ext:ModelField Name="Count" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:ModelField>
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <Axes>
                        <ext:NumericAxis Grid="true">
                        </ext:NumericAxis>
                        <ext:CategoryAxis />
                    </Axes>
                    <Series>
                        <ext:BarSeries >
                        </ext:BarSeries>
                    </Series>
                </ext:CartesianChart>
    Regards
    Mohan
    Attached Thumbnails Click image for larger version. 

Name:	example.png 
Views:	7 
Size:	6.5 KB 
ID:	23321  
    Last edited by Daniil; Apr 10, 2015 at 2:03 PM. Reason: [CLOSED]
  2. #2
    Hi Mohan,

    My recommendation would be investigating this example. Especially, the data structure.
    https://examples3.ext.net/#/Chart/Bar/Grouped

    You should prepare/organize/transform your data in the same manner as it is in the example. It meas that you should use very similar (or even same) Store, Chart, Axes, BarSeries configuration as it is in the example. The only thing you should do it transform your data.
  3. #3
    Hi Daniil

    Thanks for the recommendation :).

    I have gone through the examples, the MODEL in the example you have suggested have static number of DATA FIELDS. Where as in my case DATA FIELDS are dynamic that is the only concern.

    I am waiting for your valluable suggestion.

    Thanks & Regards
    Mohan
  4. #4
    Please build a Model via C# in Page_Load.

Similar Threads

  1. Replies: 5
    Last Post: Mar 11, 2014, 3:03 PM
  2. Replies: 5
    Last Post: Jul 12, 2013, 5:45 AM
  3. Issue with GridPanel grouping Column
    By rishu in forum 2.x Help
    Replies: 0
    Last Post: Jun 11, 2013, 11:19 AM
  4. [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
  5. Autowrap Grouping Summary Column
    By sachin.munot in forum 1.x Help
    Replies: 1
    Last Post: Nov 23, 2009, 1:04 AM

Posting Permissions