Module: Asposeslidesjava::ChartSeries

Defined in:
lib/asposeslidesjava/Charts/chartseries.rb

Instance Method Summary collapse

Instance Method Details

#add_overlap_for_chartObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/asposeslidesjava/Charts/chartseries.rb', line 8

def add_overlap_for_chart()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Instantiate Presentation class that represents the presentation file
    pres = Rjb::import('com.aspose.slides.Presentation').new

    # Adding chart
    chart = pres.getSlides().get_Item(0).getShapes().addChart(Rjb::import('com.aspose.slides.ChartType').ClusteredColumn, 50, 50, 600, 400, true)
    series = chart.getChartData().getSeries()
    if series.get_Item(0).getOverlap() == 0
       # Setting series overlap
       series.get_Item(0).getParentSeriesGroup().setOverlap(-30)
    end

    # Saving the presentation
    pres.save(data_dir + "Overlap.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)

    puts "Added chart series overlap for charts, please check the output file."
end

#initializeObject



3
4
5
6
# File 'lib/asposeslidesjava/Charts/chartseries.rb', line 3

def initialize()
    # Adding Chart Series Overlap for Charts
    add_overlap_for_chart()
end