miunsi63 / gflot

Automatically exported from code.google.com/p/gflot
0 stars 0 forks source link

Feature Request - Include multibar plugin #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great to have a multibar option like in this flot example. 
http://jsfiddle.net/ryleyb/B3uGP/2/

Original issue reported on code.google.com by wolfgang...@movilitas.com on 11 Jun 2012 at 8:25

GoogleCodeExporter commented 9 years ago

Original comment by nmr.morel on 12 Jun 2012 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by nmr.morel on 16 Jun 2012 at 4:30

GoogleCodeExporter commented 9 years ago

Original comment by nmr.morel on 16 Jun 2012 at 4:31

GoogleCodeExporter commented 9 years ago
Thanks for the quick response. The multibar plugin seems to be included now in 
2.4.2. However, I did the following and still get stacked bars. Any idea, why? 
For me this looks like the gflot equivalent of the flot example here 
http://jsfiddle.net/ryleyb/B3uGP/2/

PlotModel model = new PlotModel();
        PlotOptions options = new PlotOptions();
        options.setMultipleBars(true);

        SeriesHandler s1 = model.addSeries("one");
        SeriesHandler s2 = model.addSeries("two");
        SeriesHandler s3 = model.addSeries("three");

        for (int i = 0; i < 10; i++)
        {
            s1.add(new DataPoint(i, i));
            s2.add(new DataPoint(i, i * 2));
            s3.add(new DataPoint(i, i * 3));
        }

        BarSeriesOptions barOptions = new BarSeriesOptions().setBarWidth(0.3).setShow(true).setAlignment(BarAlignment.CENTER);
        options.setGlobalSeriesOptions(new GlobalSeriesOptions().setBarsSeriesOptions(barOptions));

        SimplePlot plot = new SimplePlot(model, options);
        return plot;

Thanks for you work. It helps a lot.

Original comment by wolfgang...@movilitas.com on 21 Jun 2012 at 7:15

GoogleCodeExporter commented 9 years ago
There are 2 options to set. One that enable the fix on flot script and one that 
activate the plugin. 
I had to do it because the fix on flot script made the stack plugin stop 
working.

Look at the example here (method createSecondPlot) :
http://gflot2.appspot.com/#bar:filename=BarExample&rawSource=false

Original comment by nmr.morel on 21 Jun 2012 at 7:34

GoogleCodeExporter commented 9 years ago
I copy/pasted createSecondPlot() from the example. However, the bars are still 
stacked. I'm using Google Chrome 19.0.1084.56.

Original comment by wolfgang...@movilitas.com on 25 Jun 2012 at 9:14