LolaC Posted August 26, 2013 Report Share Posted August 26, 2013 Hi, I have a stacked bar with 3 series and each series represents a task complete percentage per project. The problem is that I need to display the task completion percentage and the number of task completed for each series per project. How can i go about this? Thanks. Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 26, 2013 Report Share Posted August 26, 2013 Not exactly sure what you mean. Can you post a mock chart and maybe some mock data? Quote Link to comment Share on other sites More sharing options...
LolaC Posted August 26, 2013 Author Report Share Posted August 26, 2013 I need to display the number of "Tasks Completed" for each project and the "Task Completion %". Right now, each embedded number in the graph represents the "Task Completion %". For instance, the first bar "ARAS" has 25, 3, and 72 but I need the embedded number to represent the number of "Tasks completed" and the bar height to represent the "Task Completion %". ARAS 100% Completion (Number of Tasks Completed): 8 100% Completion Percentage: 25 50% to 100% Completion (Number of Tasks Completed): 1 50% to 100% Completion Percentage: 3 Less than 50% Completion (Number of Tasks Completed): 23 Less than 50% Completion Percentage: 72 This is how I assign the Completion percentage for each series: Chart2.Data.Y(0, J) = (CompletePercent(J)) Chart2.Data.Y(1, J) = (Morethan50CompletePercent(J)) Chart2.Data.Y(2, J) = (Lessthan50CompletePercent(J)) The number of tasks completed are retrieved from three different arrays: countcomplete, Morethan50Complete and Less than50Complete. I hope that helps. Thanks Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 26, 2013 Report Share Posted August 26, 2013 The image did not work. Please make sure you are using the options tab (when replying) to attach the image. Otherwise upload the image somewhere else on the web and link to it. Quote Link to comment Share on other sites More sharing options...
LolaC Posted August 26, 2013 Author Report Share Posted August 26, 2013 Attached is the mock chart. The embedded numbers are the "Number of Tasks Completed". Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 26, 2013 Report Share Posted August 26, 2013 Thanks! So you would like different data to be displayed as point labels. Take a look at the documentation for point labels: http://support.softwarefx.com/Chart_FX_7/api#web_htmls/pointlabelattributes_format.htm Maybe add the number of tasks completed as text and change the PointLabelAttributes.Format to "%L"? Quote Link to comment Share on other sites More sharing options...
LolaC Posted August 27, 2013 Author Report Share Posted August 27, 2013 Thanks for your reply. I tried using the PointLabelAttributes.Format Property but is not doing what I need. The chart still displays Y data ("Completion Percentage") instead of the data I'm setting for the Point Labels ("Number of Tasks Completed"). The "Number of Tasks Completed" is generated dynamically so I cannot add it as text. This is how i'm calling the Point Labels. Also, the last series point label is not visible in the chart even though I'm making all the series visible. Please see file attached. Thanks. Chart2.Data.Points = temp While (J < temp) Chart2.Data.Y(0, J) = (CompletePercent(J)) Chart2.Data.Y(1, J) = (Morethan50CompletePercent(J)) Chart2.Data.Y(2, J) = (Lessthan50CompletePercent(J)) Chart2.AllSeries.PointLabels.Visible = True Chart2.AllSeries.PointLabels.Format = (countcomplete(J)) Chart2.AllSeries.PointLabels.Format = (Morethan50Complete(J)) Chart2.AllSeries.PointLabels.Format = (Lessthan50Complete(J)) J += 1 End While Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 27, 2013 Report Share Posted August 27, 2013 The last series point labels work for me. What version dll are you using? A service pack can be downloaded from www.mysoftwarefx.com, using your serial number. Quote Link to comment Share on other sites More sharing options...
LolaC Posted August 27, 2013 Author Report Share Posted August 27, 2013 I'm using version 7.0.4259.28993 Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 28, 2013 Report Share Posted August 28, 2013 This works for me. Can you post your results (C#, sorry, not so good with VB)? chart1.Data.Series = 3; chart1.Data.Points = 10; Random r = new Random(); for (int i = 0; i < chart1.Data.Series; i++) { for (int j = 0; j < chart1.Data.Points; j++) { chart1.Data[i, j] = r.Next(100); } } chart1.Gallery = Gallery.Bar; chart1.AllSeries.Stacked = Stacked.Stacked100; chart1.AllSeries.PointLabels.Visible = true; Quote Link to comment Share on other sites More sharing options...
LolaC Posted August 28, 2013 Author Report Share Posted August 28, 2013 I was able to get it to work. This is how I did it: Chart2.Data.Series = 3 Dim temp As Integer = 0 Dim J As Integer = 0 Chart2.Data.Points = temp While (J < temp) Chart2.AxisX.Labels(J) = tempProject Chart2.Data.Y(0, J) = (CompletePercent(J)) Chart2.Data.Y(1, J) = (Morethan50CompletePercent(J)) Chart2.Data.Y(2, J) = (Lessthan50CompletePercent(J)) If Lessthan50CompletePercent(J) = "0" Then Chart2.Data.Y(2, J) = "100" End If Chart2.Series(0).PointLabels.Visible = True Chart2.Series(1).PointLabels.Visible = True Chart2.Series(2).PointLabels.Visible = True Chart2.Points(0, J).Text = countcomplete(J) Chart2.AllSeries.PointLabels.Format = "%L" Chart2.AllSeries.PointLabels.LineAlignment = StringAlignment.Center Chart2.Points(1, J).Text = Morethan50Complete(J) Chart2.Points(2, J).Text = Lessthan50Complete(J) J += 1 End While Chart2.Series(0).Color = Color.LightGreen Chart2.Series(1).Color = Color.LightYellow Chart2.Series(2).Color = Color.Salmon Chart2.Series(0).Text = "100% Completion" Chart2.Series(1).Text = "50% to 100% Completion" Chart2.Series(2).Text = "Less than 50% Completion" Chart2.Series(0).Gallery = Gallery.Bar Chart2.Series(1).Gallery = Gallery.Bar Chart2.Series(2).Gallery = Gallery.Bar Dim tempMax As Integer = GetmaxAxisY(TBStart.Text, tempEnddate, measuredate) Chart2.AxisY.Max = tempMax Chart2.AxisY.Min = 0 Chart2.AxisY.Max = 100 Chart2.AxisY.Min = 0 Chart2.AxisY.Step = 10 Dim custom1 As ChartFX.WebForms.CustomGridLine custom1 = New ChartFX.WebForms.CustomGridLine custom1.Value = 85 custom1.Color = Color.MediumSlateBlue custom1.Width = 1.5 custom1.Style = Drawing2D.DashStyle.Dash Chart2.AxisY.CustomGridLines.Add(custom1) custom1.Text = "Org Goal (85%)" Quote Link to comment Share on other sites More sharing options...
AndreG Posted August 28, 2013 Report Share Posted August 28, 2013 Great! Thanks for posting the solution. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.