stephenabdo Posted February 4, 2009 Report Share Posted February 4, 2009 How do I display the data labels next to each layer of a pyramid chart instead of having it in the Legend Box? Thanks, -stephen Quote Link to comment Share on other sites More sharing options...
TomasT Posted February 4, 2009 Report Share Posted February 4, 2009 Hi, All you need to do is enbale PointLabels and set their alignment: chart1.AllSeries.PointLabels.Visible = true;chart1.AllSeries.PointLabels.Alignment = StringAlignment.Near;chart1.AllSeries.PointLabels.LineAlignment = StringAlignment.Center; Hope this helps. TT Quote Link to comment Share on other sites More sharing options...
stephenabdo Posted February 4, 2009 Author Report Share Posted February 4, 2009 Hi Tomas, The LegendBox doesn't show the colors but it still does show the labels off to the side and not lined up next to each layer. Could it be a margin issue? The margins on the chart are 0. Thanks, -stephen Quote Link to comment Share on other sites More sharing options...
AndreG Posted February 5, 2009 Report Share Posted February 5, 2009 The legendbox should show the colors by default. The following sample code will reproduce the attached chart. Could you post an image and some sample code to reproduce what you currently have? chart1.Data.Series = 1;chart1.Data.Points = 4;chart1.Data[0, 0] = 13;chart1.Data[0, 1] = 20;chart1.Data[0, 2] = 17;chart1.Data[0, 3] = 9;chart1.Gallery = Gallery.Pyramid; Quote Link to comment Share on other sites More sharing options...
stephenabdo Posted February 5, 2009 Author Report Share Posted February 5, 2009 I don't want the labels in the Legend box but next to each layer in the pyramid. What do I have to do the code you posted above to do that. Thanks In Advance, -stephen ChartFXWPFTest6.zip Quote Link to comment Share on other sites More sharing options...
AndreG Posted February 5, 2009 Report Share Posted February 5, 2009 Try the code bellow. Notice I use the %l parameter to grab the labels from the X Axis. The X Axis is not drawn in a Pyramid chart, but it's labels populate the Legend Box as well in these types of chart (as well as in pie and doughnut). The pointlabels format parameters are the same as the ones for the tooltip format. They can be found in the API, under ToolTipFormat property of the chart class. Also note I increased the right margin to avoid clipping. chart1.Data.Series = 1;chart1.Data.Points = 4;chart1.Data[0, 0] = 13;chart1.Data[0, 1] = 20;chart1.Data[0, 2] = 17;chart1.Data[0, 3] = 9;chart1.AxisX.Labels[0] = "First Point";chart1.AxisX.Labels[1] = "2nd Point";chart1.AxisX.Labels[2] = "Third";chart1.AxisX.Labels[3] = "Last Point";chart1.Gallery = Gallery.Pyramid;chart1.AllSeries.PointLabels.Visible = true;chart1.AllSeries.PointLabels.Format = "%l";chart1.AllSeries.PointLabels.Alignment = StringAlignment.Near;chart1.AllSeries.PointLabels.LineAlignment = StringAlignment.Center;chart1.PlotAreaMargin.Right = 50; ChartFXTest5.zip Quote Link to comment Share on other sites More sharing options...
stephenabdo Posted February 5, 2009 Author Report Share Posted February 5, 2009 Thank you very much. That's it. 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.