I need to put a scroll into a chart without but I can't use javax.swing, just using swt.
I want to put a ilimited number of items in the category axis,maybe 100 or 200, obviously you need a scroll for watching all data in the x axis.
I have implemented the dataset of my chart with SlidingCategoryDataset, but the scroll just working with the slice part of items,
These are the methods which creates the chart and dataset:
private static CategoryDataset createDataset() {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    for (int i = 0; i < 50; i++)
        dataset.addValue(Math.random() * 100D, "S1", "S" + i);
    return dataset;
}
private static JFreeChart createGraficaY(SlidingCategoryDataset slidingDataSet) {
    JFreeChart chart = ChartFactory.createAreaChart(
            "", 
            "", 
            "Y", 
            slidingDataSet, 
            PlotOrientation.VERTICAL,
            true, 
            true, 
            false 
    );      
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    int alpha = 127;
    Paint serie_2017 = new Color(0,150,194,alpha);
    Paint serie_2018 = new Color(0,216,180,alpha);
    AreaRenderer r = new AreaRenderer();                
    r.setSeriesPaint(0, serie_2017);
    r.setSeriesPaint(1, serie_2018);    
    plot.setRenderer(r);
    plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);        
    plot.setBackgroundPaint(Color.white);       
    plot.setRangeGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.BLACK);
    plot.setDomainGridlinesVisible(false);
    plot.setDomainGridlinePaint(Color.BLACK);
    plot.setOutlineVisible(false);
    plot.setOutlinePaint(Color.white);
    chart.getLegend().setFrame(BlockBorder.NONE);       
    return chart;
}
This is the main class:
public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell( display );
    shell.setLayout( new FillLayout() );
    final ScrolledComposite scrolledComposite = new ScrolledComposite( shell, SWT.H_SCROLL);
    scrolledComposite.setExpandVertical( true );
    scrolledComposite.setExpandHorizontal( true );
    scrolledComposite.setAlwaysShowScrollBars( true );
    SlidingCategoryDataset dataset = new SlidingCategoryDataset(createDataset(), 0, 10);
    JFreeChart chart =createGraficaY(dataset);
    chart.removeLegend();
    final ChartComposite chartComposite = new ChartComposite(scrolledComposite, SWT.NONE, chart,
            true);  
    scrolledComposite.setContent(chartComposite);
    scrolledComposite.setExpandVertical(true); 
    scrolledComposite.setExpandHorizontal(true); 
    scrolledComposite.setMinSize(chartComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); 
    scrolledComposite.addListener( SWT.Resize, event -> {
      int width = scrolledComposite.getClientArea().width;
      scrolledComposite.setMinSize( shell.computeSize( width, SWT.DEFAULT ) );      
    } );
    shell.setSize( 300, 300 );
    shell.open();
    while( !shell.isDisposed() ) {
        if( !display.readAndDispatch() )
          display.sleep();
    }
    display.dispose();
}
This code doesn't work that I want because just scrolling firstly 10 items:
Could you help with this code? Are there any way to do this only with swt? I can't use swing...
Thanks.