public static void main(String[] args) {

    // The path to the documents directory.
    String dataDir = Utils.getDataDir(SettingCustomRotationAngleForTextframe.class);

    Presentation pres = new Presentation();

    IChart chart =
        pres.getSlides()
            .get_Item(0)
            .getShapes()
            .addChart(ChartType.ClusteredColumn, 50, 50, 500, 300);

    IChartSeries series = chart.getChartData().getSeries().get_Item(0);

    series.getLabels().getDefaultDataLabelFormat().setShowCategoryName(true);
    series
        .getLabels()
        .getDefaultDataLabelFormat()
        .getTextFormat()
        .getTextBlockFormat()
        .setRotationAngle(65);

    chart.hasTitle();
    chart
        .getChartTitle()
        .addTextFrameForOverriding("Custom title")
        .getTextFrameFormat()
        .setRotationAngle(-30);

    pres.save(dataDir + "out.pptx", SaveFormat.Pptx);
  }