Java 在列表系列的Vaadin图表中设置条形图颜色(在基本列上)

Java 在列表系列的Vaadin图表中设置条形图颜色(在基本列上),java,vaadin,vaadin-charts,Java,Vaadin,Vaadin Charts,使用Vaadin 6.x和Vaadin图表,我正在使用BasicColumn()。 我希望用户在屏幕上选择栏列颜色。我正确地从用户那里获得了颜色,但是我无法动态地设置列栏的颜色 我知道DataSeriesItem非常简单,但是ListSeries没有颜色属性 有没有办法在BasicColumn上设置条的颜色?这是我对DataSeries的实现。但当您在PlotOptions列上设置颜色时,它也应适用于ListSeries: pingDropoutSr=new DataSeries

使用Vaadin 6.x和Vaadin图表,我正在使用BasicColumn()。 我希望用户在屏幕上选择栏列颜色。我正确地从用户那里获得了颜色,但是我无法动态地设置列栏的颜色

我知道DataSeriesItem非常简单,但是ListSeries没有颜色属性


有没有办法在BasicColumn上设置条的颜色?

这是我对DataSeries的实现。但当您在PlotOptions列上设置颜色时,它也应适用于ListSeries:

        pingDropoutSr=new DataSeries();
        PlotOptionsColumn dropOptions= new PlotOptionsColumn();
        dropOptions.setColor( SolidColor.GREEN ); //Color is an interface only
        pingDropoutSr.setPlotOptions(dropOptions);
我也遇到了同样的问题,并使用plotoptions-column找到了解决方案

//Hard Coded Values
String months[] = { "DataSet 1", "DataSet 2", "DataSet 3", "DataSet 4", "DataSet 5"};

int dataArray[][] = { 
        { 8, 13, 7, 4 }, 
        { 23, 1, 30, 7 },
        { 37, 3, 22, 2 },
        { 13, 23, 4, 3 },
        { 3, 10, 9, 5 },
};

int counter = 0;

// Data series for each numeric column in the table
for (int month = 0; month < 4; month++) {

    ListSeries series = new ListSeries();
    PlotOptionsColumn options = new PlotOptionsColumn();
    options.setColor(colors[counter++]);
    series.setPlotOptions(options);
    series.setName(months[month]);

    // The rows of the table
    for (int data = 0; data < dataArray.length; data++) {
        series.addData(dataArray[data][month]);
    }

    conf.addSeries(series);
}
//硬编码值
字符串月份[]={“数据集1”、“数据集2”、“数据集3”、“数据集4”、“数据集5”};
int数据数组[][]={
{ 8, 13, 7, 4 }, 
{ 23, 1, 30, 7 },
{ 37, 3, 22, 2 },
{ 13, 23, 4, 3 },
{ 3, 10, 9, 5 },
};
int计数器=0;
//表中每个数字列的数据系列
对于(整数月=0;月<4;月++){
ListSeries=新ListSeries();
plotoptions column options=新的plotoptions column();
选项。设置颜色(颜色[计数器++);
系列。设置绘图选项(选项);
series.setName(月[月]);
//桌子上的几行
对于(int data=0;data