![]() However, after formatting the X-axis to Number (with no digits after the decimal in this case) rather than General, the chart should display correctly. When you do this, the X-axis values of the chart will probably all changed to whatever the format name is (i.e., Age). Then format the chart to display the label for X or Y value. Just enter "Age" (including the quotation marks) for the Custom format for the cell. For example, if you have the values Age, 15, and 23 in cells A3 to C3, you can format either cell B3 or C3 to show the word "Age" even though the value will remain 15 or 23, respectively. All you need to do is set up a bunch of custom formats that contain only the text you want to be displayed. One rather unique non-macro approach is to use Excel's custom formats. Despite the book's title, the macro still works just fine with later versions of Excel.) (This macro approach is actually a variation of a macro found on pages 570-571 of John Walkenbach's book Excel 2003 Power Programming with VBA. If the data really begins in row 1, then change "i + 1" to simply "i". The macro assumes that the first row of the worksheet contains header information and that the actual data begins in row 2. Ptcnt = Cht.SeriesCollection(1).Points.CountĬht.SeriesCollection(1).Points(i).DataLabel.Text = _ Set Cht = ActiveSheet.ChartObjects(1).ChartĬht.SeriesCollection(1).ApplyDataLabels _ One idea is to use a macro similar to the following, which steps through the data points in the X-Y chart and reads the label values from column A. For 50 rows it would quickly be brutal, so it is best to look at a macro-oriented approach. This can be done manually, but it is tedious at best. Martin wonders if there is a way he can easily use Column A to label the plotted data points. When he tries to label the data points the only available options are to label each point with its X value, Y value, or Series Name. However, Martin can't seem to label the data points with their individual names (from column A). ![]() When he creates an X-Y scatter chart (column B against column C) the result, as desired, is a graph showing an array of points showing the location of the objects. Column A contains the name of the object, column B contains its X coordinate, and column C contains its Y coordinate. Martin has a worksheet containing 50 rows of data, each row describing a single object.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |