2

I need to create an Org Chart for my department. Is it possible to use a customized SP list and then that will automatically be linked to Visio for Org Chart and refreshes each time I update the list?

We are using Excel right now but I'd like it to update the Visio org chart each time excel is refreshed.

  • what version of sharepoint are you using? – Ali Jafer Oct 29 '13 at 15:34
1

things to consider:

Visio Services in SharePoint Server 2013 can render diagrams created in Visio 2010 or Visio 2013.

Visio diagrams created in Visio 2010 must be created using Visio 2010 Professional or Visio 2010 Premium and must be published to a SharePoint site as a Visio Web drawing (*.vdw) file. Standard Visio 2010 diagrams (.vsd files) are not rendered by Visio Services and require Visio 2010 to be viewed.

Visio diagrams created in Visio 2013 must be created by using Visio Professional 2013. The new standard diagram format in Visio Professional 2013 (*.vsdx files) can be rendered by Visio Services, along with the Web drawing (.vdw) format. We recommend that you use the new .vsdx format unless you require compatibility with previous versions of Visio.

and also not forgetting:

•SharePoint Server lists that are hosted on the same farm

http://technet.microsoft.com/en-us/library/ee663485.aspx

its possible, you can find out here:

http://social.technet.microsoft.com/Forums/sharepoint/en-US/7adafdbd-dafb-4818-8b6f-22326c396e54/creating-a-chart-using-visio?forum=sharepointadminprevious

if that is not what your looking for and dont mind not doing it in visio than you can create your own webpart that connects to a list, from that list set the data in an array and populate the chart.

somthing on the lines of:

    private void getSurveyGraphResultForAll(string _ListName, string _SiteName, string _ViewName, Panel BODY)
    {
        using (SPSite site = new SPSite(_SiteName))
        {
            using (SPWeb web = site.OpenWeb())
            {

                try
                {
                    if (!string.IsNullOrEmpty(_ListName))
                    {
                        SPList list = null;
                        try
                        {
                            list = web.Lists[_ListName];

                            SPUser currentUser = SPContext.Current.Web.CurrentUser;

                            SPListItemCollection items = list.GetItems();

                            string[] x = null;
                            int[] y = null;
                            int i = 0;


                                        Chart1 = new System.Web.UI.DataVisualization.Charting.Chart();
                                        Random rnd = new Random();
                                        Chart1.CssClass = "ChartLayout";
                                        Chart1.Width = 512;
                                        Chart1.Height = 396;
                                        Chart1.ImageStorageMode = ImageStorageMode.UseImageLocation;
                                        Chart1.ID = rnd.Next().ToString();

                                        Chart1.RenderType = RenderType.ImageTag;
                                        string imagespath = "/chartimages/";
                                        Chart1.ImageLocation = imagespath + "ChartPic_#SEQ(200,30)" + rnd.Next().ToString();
                                        Chart1.Palette = ChartColorPalette.BrightPastel;
                                        Title t = new Title(list.Title, Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
                                        Chart1.Titles.Add(list.Title);


                            foreach (SPListItem item in list.Items)
                            {
                                foreach (SPField field in item.Fields)
                                {
                                    if (field.TypeAsString == "Choice")
                                    {



                                        if (Chart1.Series.FindByName(field.Title) == null)
                                        {                                                //.Label = field.Title;
                                            Chart1.ChartAreas.Add(field.Title);

                                        }

                                        SPFieldChoice fd = (SPFieldChoice)field;

                                        x = new string[fd.Choices.Count];
                                        y = new int[fd.Choices.Count];
                                        i = 0;

                                        foreach (string str in fd.Choices)
                                        {
                                            Chart1.Series.Add(str);
                                            SPQuery responseQuery = new SPQuery();

                                            responseQuery.Query = @"<Where><Eq><FieldRef Name=" + field.InternalName.ToString() + " /><Value Type=\"Choice\">" + str + @"</Value></Eq></Where>";

                                            x[i] = str;
                                            y[i] = list.GetItems(responseQuery).Count;
                                            i++;
                                        }
                                        break;
                                    }
                                }
                                break;
                            }

                            Chart1.Series[0].Points.DataBindXY(x, y);

                            Chart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
                            Chart1.BorderColor = System.Drawing.Color.FromArgb(26, 59, 105);
                            Chart1.BorderlineDashStyle = ChartDashStyle.Solid;
                            Chart1.BorderWidth = 2;
                            Chart1.Series[0].LabelFormat = "LabelsAngleStep30";

                            // Set pie labels to be outside the pie chart          
                            this.Chart1.Series[0]["PieLabelStyle"] = "Outside";           
                            // Set border width so that labels are shown on the outside         
                            this.Chart1.Series[0].BorderWidth = 1;          
                            this.Chart1.Series[0].BorderColor = System.Drawing.Color.FromArgb(26, 59, 105);           
                            // Add a legend to the chart and dock it to the bottom-center         
                            this.Chart1.Legends.Add("Legend1");          
                            this.Chart1.Legends[0].Enabled = true;         
                            this.Chart1.Legends[0].Docking = Docking.Bottom;        
                            this.Chart1.Legends[0].Alignment = System.Drawing.StringAlignment.Center;      
                            // Set the legend to display pie chart values as percentages        
                            // Again, the P2 indicates a precision of 2 decimals         
                            this.Chart1.Series[0].LegendText = "#PERCENT{P2}";           
                            // By sorting the data points, they show up in proper ascending order in the legend 
                            this.Chart1.DataManipulator.Sort(PointSortOrder.Descending, Chart1.Series[0]); 





                            foreach (Series a in Chart1.Series)
                            {
                                a.ChartType = SeriesChartType.Pie;
                                a.IsValueShownAsLabel = false;

                            }

                            foreach (ChartArea a in Chart1.ChartAreas)
                            {
                                a.AxisX.IsMarksNextToAxis = false;
                                a.AxisX.Interval = 1;
                                a.Area3DStyle.Enable3D = true;
                            }

                            BODY.Controls.Add(Chart1);


                        }
                        catch (Exception a)
                        {
                            //catch exception
                        }
                    }
                }
                catch (Exception ax)
                {
                    //catch exception
                }
            }
        }
    }

there is prob a better way to do it but the above works! its gettings the sharepoint survey questions and answers, then displays it within a pie chart .... you can change it to what ever chart you want! it will update every page load from the given list!

| improve this answer | |
0

I can suggest to use 3rd party SharePoint Org Chart. I would recommend Plumsail Organization Chart which I developed. There are also other 3rd party web part TeamImprover SharePoint Org Chart.

| improve this answer | |
  • Please do not link to your own employers product without disclosure! – Robert Lindgren Dec 23 '13 at 14:56
  • Thank you for advice, I added some details. I just want to recommend the product which I'm sure. – Anton Khritonenkov Dec 24 '13 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.