[RESOLVED] Excel Chart Text Size
Hey guys,
I have written a bit of code to create a stackedbar100 chart on a new excel worksheet. It is created correctly, as are all labels/titles on screen. The only problem is that the text is a bit to small, and I wish for it to be bigger. Is there are simple way of increasing the text size of the entire chart? I have noted that in Excel when you right click on the chart itself, the font option there changes the font for all text within the chart. I tired recording a macro of the action but it does not provide any real information.
Is there a simple call I am missing somewhere? Here is my code to create the chart.
Code:
Dim ChartSheet As excel.Worksheet
ChartSheet = wb.Sheets.Add
ChartSheet.Name = "Cluster Chart"
Dim chartpage As excel.Chart
Dim xlcharts As excel.ChartObjects
Dim mychart As excel.ChartObject
Dim chartrange As excel.Range = PivotSheet.UsedRange
xlcharts = ChartSheet.ChartObjects
mychart = xlcharts.Add(10, 80, 1000, 500)
chartpage = mychart.Chart
chartpage.SetSourceData(chartrange)
chartpage.ChartType = excel.XlChartType.xlBarStacked100
chartpage.Legend.Position = excel.XlLegendPosition.xlLegendPositionBottom
chartpage.ApplyDataLabels(excel.XlDataLabelsType.xlDataLabelsShowValue)
For i = 1 To chartpage.SeriesCollection.count
Select Case i
Case 1
chartpage.SeriesCollection(i).interior.color = RGB(127, 255, 0)
Case 2
chartpage.SeriesCollection(i).interior.color = RGB(255, 255, 0)
Case 3
chartpage.SeriesCollection(i).interior.color = RGB(255, 165, 0)
Case 4
chartpage.SeriesCollection(i).interior.color = RGB(255, 0, 0)
Case Else
chartpage.SeriesCollection(i).interior.color = RGB(255, 255, 255)
End Select
Next
Re: Excel Chart Text Size
try like
chartpage.chartarea.font.size = 16
Re: Excel Chart Text Size
Quote:
Originally Posted by
westconn1
try like
chartpage.chartarea.font.size = 16
I love you. Exactly what I needed.