Hi Aspose support team,
My requirement is to show the value axis in the top of the chart with 45 degree rotation. It is working fine with one minor issue. The issue is, value of the value axis is littlebit removed(Top Right Corner) from the chart area. I have used the following code:
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts.Add(ChartType.BarStacked, 2, 0, 25, 10);
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PivotSource = "Berth Performance!PivotTable";
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].RefreshPivotData();
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].NSeries[0].Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].NSeries[0].Area.Transparency = 1;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ChartArea.Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PlotArea.Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].Title.Text = "";
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ShowLegend = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].Legend.Position = LegendPositionType.Top;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabels.Rotation = 45;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabels.Font.IsBold = false;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabelPosition = TickLabelPositionType.NextToAxis;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.MajorTickMark = TickMarkType.Outside;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.MinorTickMark = TickMarkType.None;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.IsPlotOrderReversed = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.HasMultiLevelLabels = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.MajorTickMark = TickMarkType.Inside;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.MinorTickMark = TickMarkType.None;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.TickLabelPosition = TickLabelPositionType.NextToAxis;
Please refer the attached PlotArea1.Xlsx and PlotArea1.Jpeg.
Thats why i changed the code like belew. this time Legends are overwritten in the value axis.
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts.Add(ChartType.BarStacked, 2, 0, 25, 10);
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PivotSource = "Berth Performance!PivotTable";
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].RefreshPivotData();
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].NSeries[0].Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].NSeries[0].Area.Transparency = 1;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ChartArea.Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PlotArea.Width = 3500;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PlotArea.Height = 2500;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].PlotArea.Area.ForegroundColor = Color.White;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].Title.Text = "";
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ShowLegend = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].Legend.Position = LegendPositionType.Top;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabels.Rotation = 45;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabels.Font.IsBold = false;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.TickLabelPosition = TickLabelPositionType.NextToAxis;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.MajorTickMark = TickMarkType.Outside;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].ValueAxis.MinorTickMark = TickMarkType.None;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.IsPlotOrderReversed = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.HasMultiLevelLabels = true;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.MajorTickMark = TickMarkType.Inside;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.MinorTickMark = TickMarkType.None;
obj.ExcelWorkBook.Worksheets["Berth Performance"].Charts[0].CategoryAxis.TickLabelPosition = TickLabelPositionType.NextToAxis;
Please refer the attached PlotArea2.Xlsx and PlotArea2.Jpeg.
But my requirement is like Expected.Xlsx
Please help me to achive to feature and provide the sample piece of code.
Thanks
Saravanan