Change the orientation of the chart and legend using excel VBA
For some reason if there are less than four rows of data and you try to scatter the graph, the cluster (column A) is shown in the legend, but if there are more than 4 rows of data, the other columns (A, B, C ) are on the legend (Y axis).
Could you show me with VBA how I can orient this chart as a chart (2) ?
- How to manage multiple datasets in Excel mac 2011
- The table shows different results depending on the size of the field
- How to get Excel XValue of a chart in C #
- How to add chart to specific cell with VBA Macro
- Dynamically select charts in excel
I need to reorient the legend series to be on the horizontal axis axis using VBA (since the macro recorder doesn’t show how to do that.
GRAPHICS 1 STARTI EXCLUSIVELY LOOKING LIKE THIS
GRAPH 2 THIS IS HOW I DO MANUAL
- Fill an Excel XYchart chart programmatically?
- Invalid parameter – c # Excel Interop Series.Points ()
- Converting Chart in Excel sheet to PDF
- Cannot set excel chart style
- How to list properties of a graphic object in VBA?
(reoriented legend entries – left and category labels – right)
GRAPH 3 The scatterchart dialog ends up looking like this, which is what I want to do in VBA
GRAPH 4 The final graph looks like this, this is what I want to get in VBA
Finally this is what the macro recorder creates, but when I try to run it, it is missing, the Plotby range and parameters and fails
Range("A1:D3").Select Range("D3").Activate ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlXYScatter ActiveChart.SetSourceData
Your columns and rows are reversed. When you have selected the chart and go to the “Design” contextual tab and click on “Switch Row / Column”. Does it solve it? If yes you can use:
to do it programmatically. |
- How to draw simple graphs in excel with multiple dates for comparison
- Plot data exceeds the maximum axis as the maximum
- Excel VBA, choosing the color of the chart based on the series comparison
- VBA Excel: Find and replace chart titles
- Excel scatterplot chart from List (Of Decimal) values - VB.NET
- Error when trying to set pie chart title using C # Excel Interop
- The Excel Worksheet.Copy method copies some links to the chart as external
- creating a chart in an Excel spreadsheet using NPOI